mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
compositing: Send CompositorDisplayListInfo
as bytes to compositor (#36484)
`CompositorDisplayListInfo` is a large data structure that scales with the size of the display list. Serializing it onto the Compositor's IPC channel can cause deadlocks. This change serializes it with bincode and sends it alongside the rest of the serialized display list information on the IPC `bytes_channel`. This should prevent deadlocks when the compositor API is unified. Testing: This is covered by existing WPT tests. Signed-off-by: Martin Robinson <mrobinson@igalia.com> Signed-off-by: Martin Robinson <mrobinson@igalia.com>
This commit is contained in:
parent
084fe007a1
commit
5f0f457ac3
5 changed files with 27 additions and 8 deletions
|
@ -16,7 +16,7 @@ use base::cross_process_instant::CrossProcessInstant;
|
|||
use base::id::{PipelineId, WebViewId};
|
||||
use base::{Epoch, WebRenderEpochToU16};
|
||||
use bitflags::bitflags;
|
||||
use compositing_traits::display_list::{HitTestInfo, ScrollTree};
|
||||
use compositing_traits::display_list::{CompositorDisplayListInfo, HitTestInfo, ScrollTree};
|
||||
use compositing_traits::rendering_context::RenderingContext;
|
||||
use compositing_traits::{
|
||||
CompositionPipeline, CompositorMsg, CompositorReceiver, CrossProcessCompositorMessage,
|
||||
|
@ -740,11 +740,23 @@ impl IOCompositor {
|
|||
|
||||
CrossProcessCompositorMessage::SendDisplayList {
|
||||
webview_id,
|
||||
display_list_info,
|
||||
display_list_descriptor,
|
||||
display_list_receiver,
|
||||
} => {
|
||||
// This must match the order from the sender, currently in `shared/script/lib.rs`.
|
||||
let display_list_info = match display_list_receiver.recv() {
|
||||
Ok(display_list_info) => display_list_info,
|
||||
Err(error) => {
|
||||
return warn!("Could not receive display list info: {error}");
|
||||
},
|
||||
};
|
||||
let display_list_info: CompositorDisplayListInfo =
|
||||
match bincode::deserialize(&display_list_info) {
|
||||
Ok(display_list_info) => display_list_info,
|
||||
Err(error) => {
|
||||
return warn!("Could not deserialize display list info: {error}");
|
||||
},
|
||||
};
|
||||
let items_data = match display_list_receiver.recv() {
|
||||
Ok(display_list_data) => display_list_data,
|
||||
Err(error) => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue