Struct layout_2013::context::LayoutContext
source · pub struct LayoutContext<'a> {
pub id: PipelineId,
pub origin: ImmutableOrigin,
pub style_context: SharedStyleContext<'a>,
pub image_cache: Arc<dyn ImageCache>,
pub font_context: Arc<FontContext>,
pub webrender_image_cache: Arc<RwLock<HashMap<(ServoUrl, UsePlaceholder), WebRenderImageInfo, BuildHasherDefault<FnvHasher>>>>,
pub registered_painters: &'a dyn RegisteredPainters,
pub pending_images: Mutex<Vec<PendingImage>>,
}
Expand description
Layout information shared among all workers. This must be thread-safe.
Fields§
§id: PipelineId
The pipeline id of this LayoutContext.
origin: ImmutableOrigin
The origin of this layout context.
style_context: SharedStyleContext<'a>
Bits shared by the layout and style system.
image_cache: Arc<dyn ImageCache>
Reference to the script thread image cache.
font_context: Arc<FontContext>
A FontContext to be used during layout.
webrender_image_cache: Arc<RwLock<HashMap<(ServoUrl, UsePlaceholder), WebRenderImageInfo, BuildHasherDefault<FnvHasher>>>>
A cache of WebRender image info.
registered_painters: &'a dyn RegisteredPainters
Paint worklets
pending_images: Mutex<Vec<PendingImage>>
A list of in-progress image loads to be shared with the script thread.
Implementations§
source§impl<'a> LayoutContext<'a>
impl<'a> LayoutContext<'a>
pub fn get_or_request_image_or_meta( &self, node: OpaqueNode, url: ServoUrl, use_placeholder: UsePlaceholder, ) -> Option<ImageOrMetadataAvailable>
pub fn get_webrender_image_for_url( &self, node: OpaqueNode, url: ServoUrl, use_placeholder: UsePlaceholder, ) -> Option<WebRenderImageInfo>
Trait Implementations§
Auto Trait Implementations§
impl<'a> !Freeze for LayoutContext<'a>
impl<'a> !RefUnwindSafe for LayoutContext<'a>
impl<'a> Send for LayoutContext<'a>
impl<'a> Sync for LayoutContext<'a>
impl<'a> Unpin for LayoutContext<'a>
impl<'a> !UnwindSafe for LayoutContext<'a>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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 moresource§impl<T> MaybeBoxed<Box<T>> for T
impl<T> MaybeBoxed<Box<T>> for T
source§fn maybe_boxed(self) -> Box<T>
fn maybe_boxed(self) -> Box<T>
Convert
source§impl<T> MaybeBoxed<T> for T
impl<T> MaybeBoxed<T> for T
source§fn maybe_boxed(self) -> T
fn maybe_boxed(self) -> T
Convert