diff options
author | Martin Robinson <mrobinson@igalia.com> | 2023-10-05 18:40:44 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-05 16:40:44 +0000 |
commit | 28315ba48a90a40340feefea646428dee45dfd65 (patch) | |
tree | 8fb3f8a565aae18ad2cc93205e004875311b9c7e /components/script_traits/lib.rs | |
parent | aadf48bd4d8afa86fa702c8709c9bc3753dd20d8 (diff) | |
download | servo-28315ba48a90a40340feefea646428dee45dfd65.tar.gz servo-28315ba48a90a40340feefea646428dee45dfd65.zip |
Rename messages forwarded from the constellation to the compositor (#30496)
The constellation forwards messages from other tasks to the compositor.
Mainly, these are passed to WebRender. This change updates the names of
these messages so it is clearer where they are coming from and where
they are going.
Diffstat (limited to 'components/script_traits/lib.rs')
-rw-r--r-- | components/script_traits/lib.rs | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/components/script_traits/lib.rs b/components/script_traits/lib.rs index 64c213955c2..77782255a4c 100644 --- a/components/script_traits/lib.rs +++ b/components/script_traits/lib.rs @@ -1116,7 +1116,7 @@ pub struct CompositorHitTestResult { /// The set of WebRender operations that can be initiated by the content process. #[derive(Deserialize, Serialize)] -pub enum WebrenderMsg { +pub enum ScriptToCompositorMsg { /// Inform WebRender of the existence of this pipeline. SendInitialTransaction(WebRenderPipelineId), /// Perform a scroll operation. @@ -1147,24 +1147,30 @@ pub enum WebrenderMsg { #[derive(Clone, Deserialize, Serialize)] /// A mechanism to communicate with the parent process' WebRender instance. -pub struct WebrenderIpcSender(IpcSender<WebrenderMsg>); +pub struct WebrenderIpcSender(IpcSender<ScriptToCompositorMsg>); impl WebrenderIpcSender { /// Create a new WebrenderIpcSender object that wraps the provided channel sender. - pub fn new(sender: IpcSender<WebrenderMsg>) -> Self { + pub fn new(sender: IpcSender<ScriptToCompositorMsg>) -> Self { Self(sender) } /// Inform WebRender of the existence of this pipeline. pub fn send_initial_transaction(&self, pipeline: WebRenderPipelineId) { - if let Err(e) = self.0.send(WebrenderMsg::SendInitialTransaction(pipeline)) { + if let Err(e) = self + .0 + .send(ScriptToCompositorMsg::SendInitialTransaction(pipeline)) + { warn!("Error sending initial transaction: {}", e); } } /// Perform a scroll operation. pub fn send_scroll_node(&self, point: LayoutPoint, scroll_id: ExternalScrollId) { - if let Err(e) = self.0.send(WebrenderMsg::SendScrollNode(point, scroll_id)) { + if let Err(e) = self + .0 + .send(ScriptToCompositorMsg::SendScrollNode(point, scroll_id)) + { warn!("Error sending scroll node: {}", e); } } @@ -1177,7 +1183,7 @@ impl WebrenderIpcSender { ) { let (display_list_data, display_list_descriptor) = list.into_data(); let (display_list_sender, display_list_receiver) = ipc::bytes_channel().unwrap(); - if let Err(e) = self.0.send(WebrenderMsg::SendDisplayList { + if let Err(e) = self.0.send(ScriptToCompositorMsg::SendDisplayList { display_list_info, display_list_descriptor, display_list_receiver, @@ -1200,7 +1206,9 @@ impl WebrenderIpcSender { ) -> Vec<CompositorHitTestResult> { let (sender, receiver) = ipc::channel().unwrap(); self.0 - .send(WebrenderMsg::HitTest(pipeline, point, flags, sender)) + .send(ScriptToCompositorMsg::HitTest( + pipeline, point, flags, sender, + )) .expect("error sending hit test"); receiver.recv().expect("error receiving hit test result") } @@ -1209,7 +1217,7 @@ impl WebrenderIpcSender { pub fn generate_image_key(&self) -> Result<ImageKey, ()> { let (sender, receiver) = ipc::channel().unwrap(); self.0 - .send(WebrenderMsg::GenerateImageKey(sender)) + .send(ScriptToCompositorMsg::GenerateImageKey(sender)) .map_err(|_| ())?; receiver.recv().map_err(|_| ()) } @@ -1249,7 +1257,7 @@ impl WebrenderIpcSender { }) .collect(); - if let Err(e) = self.0.send(WebrenderMsg::UpdateImages(updates)) { + if let Err(e) = self.0.send(ScriptToCompositorMsg::UpdateImages(updates)) { warn!("error sending image updates: {}", e); } |