mirror of
https://github.com/servo/servo.git
synced 2025-08-07 06:25:32 +01:00
Auto merge of #8898 - vwvww:compositor_msg_refactor, r=Ms2ger
Moved CompositorMsg enum into compositing crate. moved CompositorMsg enum into compositing crate. moved from components/msg/constellation_msg.rs to components/compositing/lib.rs fixes #8832 <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8898) <!-- Reviewable:end -->
This commit is contained in:
commit
4e73a30b00
11 changed files with 47 additions and 35 deletions
|
@ -2,6 +2,7 @@
|
|||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
use CompositorMsg as ConstellationMsg;
|
||||
use app_units::Au;
|
||||
use compositor_layer::{CompositorData, CompositorLayer, RcCompositorLayer, WantsScrollEventsFlag};
|
||||
use compositor_task::{CompositorEventListener, CompositorProxy};
|
||||
|
@ -28,7 +29,6 @@ use layers::scene::Scene;
|
|||
use layout_traits::LayoutControlChan;
|
||||
use msg::compositor_msg::{Epoch, EventResult, FrameTreeId, LayerId, LayerKind};
|
||||
use msg::compositor_msg::{LayerProperties, ScrollPolicy};
|
||||
use msg::constellation_msg::CompositorMsg as ConstellationMsg;
|
||||
use msg::constellation_msg::{AnimationState, Image, PixelFormat};
|
||||
use msg::constellation_msg::{Key, KeyModifiers, KeyState, LoadData, MouseButton};
|
||||
use msg::constellation_msg::{NavigationDirection, PipelineId, WindowSizeData};
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
|
||||
//! Communication with the compositor task.
|
||||
|
||||
use CompositorMsg as ConstellationMsg;
|
||||
use compositor;
|
||||
use euclid::point::Point2D;
|
||||
use euclid::size::Size2D;
|
||||
|
@ -13,7 +14,6 @@ use layers::layers::{BufferRequest, LayerBufferSet};
|
|||
use layers::platform::surface::{NativeDisplay, NativeSurface};
|
||||
use msg::compositor_msg::{Epoch, EventResult, FrameTreeId, LayerId, LayerProperties};
|
||||
use msg::compositor_msg::{PaintListener, ScriptToCompositorMsg};
|
||||
use msg::constellation_msg::CompositorMsg as ConstellationMsg;
|
||||
use msg::constellation_msg::{AnimationState, PipelineId};
|
||||
use msg::constellation_msg::{Image, Key, KeyModifiers, KeyState};
|
||||
use profile_traits::mem;
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
//! navigation context, each `Pipeline` encompassing a `ScriptTask`,
|
||||
//! `LayoutTask`, and `PaintTask`.
|
||||
|
||||
use CompositorMsg as FromCompositorMsg;
|
||||
use canvas::canvas_paint_task::CanvasPaintTask;
|
||||
use canvas::webgl_paint_task::WebGLPaintTask;
|
||||
use canvas_traits::CanvasMsg;
|
||||
|
@ -26,7 +27,6 @@ use ipc_channel::router::ROUTER;
|
|||
use layout_traits::{LayoutControlChan, LayoutTaskFactory};
|
||||
use msg::compositor_msg::Epoch;
|
||||
use msg::constellation_msg::AnimationState;
|
||||
use msg::constellation_msg::CompositorMsg as FromCompositorMsg;
|
||||
use msg::constellation_msg::PaintMsg as FromPaintMsg;
|
||||
use msg::constellation_msg::WebDriverCommandMsg;
|
||||
use msg::constellation_msg::{FrameId, PipelineId};
|
||||
|
|
|
@ -2,12 +2,12 @@
|
|||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
use CompositorMsg as ConstellationMsg;
|
||||
use compositor_task::{CompositorEventListener, CompositorReceiver};
|
||||
use compositor_task::{InitialCompositorState, Msg};
|
||||
use euclid::scale_factor::ScaleFactor;
|
||||
use euclid::{Point2D, Size2D};
|
||||
use msg::constellation_msg::AnimationState;
|
||||
use msg::constellation_msg::CompositorMsg as ConstellationMsg;
|
||||
use msg::constellation_msg::WindowSizeData;
|
||||
use profile_traits::mem;
|
||||
use profile_traits::time;
|
||||
|
|
|
@ -53,6 +53,14 @@ extern crate util;
|
|||
|
||||
pub use compositor_task::{CompositorEventListener, CompositorProxy, CompositorTask};
|
||||
pub use constellation::Constellation;
|
||||
use euclid::size::{Size2D};
|
||||
use ipc_channel::ipc::{IpcSender};
|
||||
use msg::compositor_msg::Epoch;
|
||||
use msg::constellation_msg::{FrameId, Key, KeyState, KeyModifiers, LoadData};
|
||||
use msg::constellation_msg::{NavigationDirection, PipelineId, SubpageId};
|
||||
use msg::constellation_msg::{WebDriverCommandMsg, WindowSizeData};
|
||||
use std::collections::HashMap;
|
||||
use url::Url;
|
||||
|
||||
mod compositor;
|
||||
mod compositor_layer;
|
||||
|
@ -65,3 +73,30 @@ mod scrolling;
|
|||
mod surface_map;
|
||||
mod timer_scheduler;
|
||||
pub mod windowing;
|
||||
|
||||
/// Messages from the compositor to the constellation.
|
||||
#[derive(Deserialize, Serialize)]
|
||||
pub enum CompositorMsg {
|
||||
Exit,
|
||||
FrameSize(PipelineId, Size2D<f32>),
|
||||
/// Request that the constellation send the FrameId corresponding to the document
|
||||
/// with the provided pipeline id
|
||||
GetFrame(PipelineId, IpcSender<Option<FrameId>>),
|
||||
/// Request that the constellation send the current pipeline id for the provided frame
|
||||
/// id, or for the root frame if this is None, over a provided channel
|
||||
GetPipeline(Option<FrameId>, IpcSender<Option<PipelineId>>),
|
||||
/// Requests that the constellation inform the compositor of the title of the pipeline
|
||||
/// immediately.
|
||||
GetPipelineTitle(PipelineId),
|
||||
InitLoadUrl(Url),
|
||||
/// Query the constellation to see if the current compositor output is stable
|
||||
IsReadyToSaveImage(HashMap<PipelineId, Epoch>),
|
||||
KeyEvent(Key, KeyState, KeyModifiers),
|
||||
LoadUrl(PipelineId, LoadData),
|
||||
Navigate(Option<(PipelineId, SubpageId)>, NavigationDirection),
|
||||
ResizedWindow(WindowSizeData),
|
||||
/// Requests that the constellation instruct layout to begin a new tick of the animation.
|
||||
TickAnimation(PipelineId),
|
||||
/// Dispatch a webdriver command
|
||||
WebDriverCommand(WebDriverCommandMsg),
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue