IOCompositor

Struct IOCompositor 

Source
pub struct IOCompositor {
    painters: Vec<Rc<RefCell<Painter>>>,
    shutdown_state: Rc<Cell<ShutdownState>>,
    compositor_receiver: RoutedReceiver<CompositorMsg>,
    pub(crate) embedder_to_constellation_sender: Sender<EmbedderToConstellationMessage>,
    time_profiler_chan: ProfilerChan,
    _mem_profiler_registration: ProfilerRegistration,
}
Expand description

NB: Never block on the constellation, because sometimes the constellation blocks on us.

Fields§

§painters: Vec<Rc<RefCell<Painter>>>

All of the [Painters] for this IOCompositor. Each Painter handles painting to a single [RenderingContext].

§shutdown_state: Rc<Cell<ShutdownState>>

Tracks whether we are in the process of shutting down, or have shut down and should close the compositor. This is shared with the Servo instance.

§compositor_receiver: RoutedReceiver<CompositorMsg>

The port on which we receive messages.

§embedder_to_constellation_sender: Sender<EmbedderToConstellationMessage>

The channel on which messages can be sent to the constellation.

§time_profiler_chan: ProfilerChan

The channel on which messages can be sent to the time profiler.

§_mem_profiler_registration: ProfilerRegistration

A handle to the memory profiler which will automatically unregister when it’s dropped.

Implementations§

Source§

impl IOCompositor

Source

pub fn new(state: InitialCompositorState) -> Rc<RefCell<Self>>

Source

pub(crate) fn painter<'a>(&'a self) -> Ref<'a, Painter>

Source

pub(crate) fn painter_mut<'a>(&'a self) -> RefMut<'a, Painter>

Source

pub fn painter_id(&self) -> PainterId

Source

pub fn deinit(&mut self)

Source

pub fn rendering_context_size(&self) -> Size2D<u32, DevicePixel>

Source

pub fn webgl_threads(&self) -> WebGLThreads

Source

pub fn webrender_external_images( &self, ) -> Arc<Mutex<WebRenderExternalImageRegistry>>

Source

pub fn webxr_running(&self) -> bool

Source

pub fn webxr_main_thread_registry(&self) -> Registry

Source

pub fn webgpu_image_map(&self) -> WGPUImageMap

Source

pub fn webviews_needing_repaint(&self) -> Vec<WebViewId>

Source

pub fn finish_shutting_down(&self)

Source

fn handle_browser_message(&self, msg: CompositorMsg)

Source

fn collect_memory_report(&self, sender: ReportsChan)

Source

fn handle_browser_message_while_shutting_down(&self, msg: CompositorMsg)

Handle messages sent to the compositor during the shutdown process. In general, the things the compositor can do in this state are limited. It’s very important to answer any synchronous messages though as other threads might be waiting on the results to finish their own shut down process. We try to do as little as possible during this time.

When that involves generating WebRender ids, our approach here is to simply generate them, but assume they will never be used, since once shutting down the compositor no longer does any WebRender frame generation.

Source

pub fn add_webview( &self, webview: Box<dyn WebViewTrait>, viewport_details: ViewportDetails, )

Source

pub fn show_webview( &self, webview_id: WebViewId, hide_others: bool, ) -> Result<(), UnknownWebView>

Source

pub fn hide_webview(&self, webview_id: WebViewId) -> Result<(), UnknownWebView>

Source

pub fn raise_webview_to_top( &self, webview_id: WebViewId, hide_others: bool, ) -> Result<(), UnknownWebView>

Source

pub fn move_resize_webview(&self, webview_id: WebViewId, rect: DeviceRect)

Source

pub fn set_hidpi_scale_factor( &self, webview_id: WebViewId, new_scale_factor: Scale<f32, DeviceIndependentPixel, DevicePixel>, )

Source

pub fn resize_rendering_context(&self, new_size: PhysicalSize<u32>)

Source

pub fn set_page_zoom(&self, webview_id: WebViewId, new_zoom: f32)

Source

pub fn page_zoom(&self, webview_id: WebViewId) -> f32

Source

pub fn render(&self)

Render the WebRender scene to the active RenderingContext.

Source

pub fn receiver(&self) -> &RoutedReceiver<CompositorMsg>

Get the message receiver for this IOCompositor.

Source

pub fn handle_messages(&self, messages: Vec<CompositorMsg>)

Source

pub fn perform_updates(&self) -> bool

Source

pub fn toggle_webrender_debug(&self, option: WebRenderDebugOption)

Source

pub fn capture_webrender(&self)

Source

pub fn notify_input_event(&self, webview_id: WebViewId, event: InputEventAndId)

Source

pub fn notify_scroll_event( &self, webview_id: WebViewId, scroll: Scroll, point: WebViewPoint, )

Source

pub fn pinch_zoom( &self, webview_id: WebViewId, pinch_zoom_delta: f32, center: DevicePoint, )

Source

pub fn device_pixels_per_page_pixel( &self, webview_id: WebViewId, ) -> Scale<f32, CSSPixel, DevicePixel>

Source

pub(crate) fn shutdown_state(&self) -> ShutdownState

Source

pub fn request_screenshot( &self, webview_id: WebViewId, rect: Option<WebViewRect>, callback: Box<dyn FnOnce(Result<RgbaImage, ScreenshotCaptureError>) + 'static>, )

Source

pub fn notify_input_event_handled( &self, webview_id: WebViewId, input_event_id: InputEventId, result: InputEventResult, )

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> Downcast<T> for T

Source§

fn downcast(&self) -> &T

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> MaybeBoxed<Box<T>> for T

Source§

fn maybe_boxed(self) -> Box<T>

Convert
Source§

impl<T> MaybeBoxed<T> for T

Source§

fn maybe_boxed(self) -> T

Convert
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> Upcast<T> for T

Source§

fn upcast(&self) -> Option<&T>

Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> MaybeSendSync for T