pub struct Compositor { /* private fields */ }Expand description
Scene compositor that attaches to native host windows and routes browser surfaces into a declarative composition tree.
Implementations§
Source§impl Compositor
impl Compositor
Sourcepub fn attach_window<W, E>(
&mut self,
window: W,
options: AttachWindowOptions,
emit: E,
) -> Result<CompositorWindowId, CompositorError>
pub fn attach_window<W, E>( &mut self, window: W, options: AttachWindowOptions, emit: E, ) -> Result<CompositorWindowId, CompositorError>
Attach a host-native window and return its compositor window id.
Sourcepub fn detach_window(
&mut self,
window_id: CompositorWindowId,
emit: impl FnMut(BackendCommand),
) -> Result<(), CompositorError>
pub fn detach_window( &mut self, window_id: CompositorWindowId, emit: impl FnMut(BackendCommand), ) -> Result<(), CompositorError>
Detach a previously attached compositor window.
Sourcepub fn apply(
&mut self,
command: CompositionCommand,
emit: impl FnMut(BackendCommand),
) -> Result<(), CompositorError>
pub fn apply( &mut self, command: CompositionCommand, emit: impl FnMut(BackendCommand), ) -> Result<(), CompositorError>
Apply a declarative scene update to one attached window.
Sourcepub fn update_browser_event(
&mut self,
event: &BrowserEvent,
emit: impl FnMut(BrowserCommand),
) -> Result<(), CompositorError>
pub fn update_browser_event( &mut self, event: &BrowserEvent, emit: impl FnMut(BrowserCommand), ) -> Result<(), CompositorError>
Feed browser-generic backend events into the compositor state machine.
Sourcepub fn update_chrome_event(
&mut self,
event: &ChromeEvent,
) -> Result<(), CompositorError>
pub fn update_chrome_event( &mut self, event: &ChromeEvent, ) -> Result<(), CompositorError>
Feed Chrome-specific events into the compositor.
Sourcepub fn surface_target_for_item(
&self,
item_id: CompositionItemId,
) -> Option<SurfaceTarget>
pub fn surface_target_for_item( &self, item_id: CompositionItemId, ) -> Option<SurfaceTarget>
Return the scene target currently displayed by an item.
Sourcepub fn item_ids_for_target(
&self,
target: SurfaceTarget,
) -> Vec<CompositionItemId>
pub fn item_ids_for_target( &self, target: SurfaceTarget, ) -> Vec<CompositionItemId>
Return every item currently showing the given target.
Sourcepub fn window_id_for_item(
&self,
item_id: CompositionItemId,
) -> Option<CompositorWindowId>
pub fn window_id_for_item( &self, item_id: CompositionItemId, ) -> Option<CompositorWindowId>
Return the compositor window that owns the given item.
Sourcepub fn set_active_item(
&mut self,
item_id: CompositionItemId,
) -> Result<(), CompositorError>
pub fn set_active_item( &mut self, item_id: CompositionItemId, ) -> Result<(), CompositorError>
Programmatically move the active input target to one visible input-receiving item.
Sourcepub fn transient_preferred_size(
&self,
transient_browsing_context_id: TransientBrowsingContextId,
) -> Option<(u32, u32)>
pub fn transient_preferred_size( &self, transient_browsing_context_id: TransientBrowsingContextId, ) -> Option<(u32, u32)>
Return the last preferred size hint reported for a transient popup.
Present a host-owned context menu for the given surface target.
Present a host-owned choice menu for the given surface target.
Sourcepub fn start_native_drag(
&mut self,
request: DragStartRequest,
) -> Result<bool, CompositorError>
pub fn start_native_drag( &mut self, request: DragStartRequest, ) -> Result<bool, CompositorError>
Start a host-owned native drag session from a browsing-context target.