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.
This commit is contained in:
Martin Robinson 2023-10-05 18:40:44 +02:00 committed by GitHub
parent aadf48bd4d
commit 28315ba48a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 110 additions and 66 deletions

View file

@ -18,9 +18,10 @@ use ipc_channel::ipc::IpcSender;
use log::warn;
use msg::constellation_msg::{PipelineId, TopLevelBrowsingContextId};
use net_traits::image::base::Image;
use net_traits::NetToCompositorMsg;
use script_traits::{
AnimationState, ConstellationControlMsg, EventResult, LayoutControlMsg, MouseButton,
MouseEventType,
MouseEventType, ScriptToCompositorMsg,
};
use style_traits::CSSPixel;
use webrender_api::units::{DeviceIntPoint, DeviceIntSize};
@ -148,8 +149,9 @@ pub enum CompositorMsg {
/// Get screen available size.
GetScreenAvailSize(IpcSender<DeviceIntSize>),
/// Webrender operations requested from non-compositor threads.
Webrender(WebrenderMsg),
/// Messages forwarded to the compositor by the constellation from other crates. These
/// messages are mainly passed on from the compositor to WebRender.
Forwarded(ForwardedToCompositorMsg),
}
pub struct SendableFrameTree {
@ -166,21 +168,22 @@ pub struct CompositionPipeline {
pub layout_chan: IpcSender<LayoutControlMsg>,
}
pub enum WebrenderFontMsg {
pub enum FontToCompositorMsg {
AddFontInstance(FontKey, f32, Sender<FontInstanceKey>),
AddFont(gfx_traits::FontData, Sender<FontKey>),
}
pub enum WebrenderCanvasMsg {
pub enum CanvasToCompositorMsg {
GenerateKey(Sender<ImageKey>),
UpdateImages(Vec<ImageUpdate>),
}
pub enum WebrenderMsg {
Layout(script_traits::WebrenderMsg),
Net(net_traits::WebrenderImageMsg),
Font(WebrenderFontMsg),
Canvas(WebrenderCanvasMsg),
/// Messages forwarded by the Constellation to the Compositor.
pub enum ForwardedToCompositorMsg {
Layout(ScriptToCompositorMsg),
Net(NetToCompositorMsg),
Font(FontToCompositorMsg),
Canvas(CanvasToCompositorMsg),
}
impl Debug for CompositorMsg {
@ -206,7 +209,7 @@ impl Debug for CompositorMsg {
CompositorMsg::GetClientWindow(..) => write!(f, "GetClientWindow"),
CompositorMsg::GetScreenSize(..) => write!(f, "GetScreenSize"),
CompositorMsg::GetScreenAvailSize(..) => write!(f, "GetScreenAvailSize"),
CompositorMsg::Webrender(..) => write!(f, "Webrender"),
CompositorMsg::Forwarded(..) => write!(f, "Webrender"),
}
}
}