Use IpcBytesReceiver to send Display list data

This commit is contained in:
Wu Yu Wei 2022-03-10 17:51:53 +08:00
parent 34b3dafab8
commit 2cffbd7527
2 changed files with 28 additions and 20 deletions

View file

@ -1123,7 +1123,7 @@ pub enum WebrenderMsg {
LayoutSize,
webrender_api::PipelineId,
LayoutSize,
Vec<u8>,
ipc::IpcBytesReceiver,
BuiltDisplayListDescriptor,
),
/// Perform a hit test operation. The result will be returned via
@ -1181,16 +1181,21 @@ impl WebrenderIpcSender {
(pipeline, size2, list): (webrender_api::PipelineId, LayoutSize, BuiltDisplayList),
) {
let (data, descriptor) = list.into_data();
let (sender, receiver) = ipc::bytes_channel().unwrap();
if let Err(e) = self.0.send(WebrenderMsg::SendDisplayList(
webrender_api::Epoch(epoch.0),
size,
pipeline,
size2,
data,
receiver,
descriptor,
)) {
warn!("Error sending display list: {}", e);
}
if let Err(e) = sender.send(&data) {
warn!("Error sending display data: {}", e);
}
}
/// Perform a hit test operation. Blocks until the operation is complete and