Struct layout_2020::context::LayoutContext
source · pub struct LayoutContext<'a> {
pub id: PipelineId,
pub use_rayon: bool,
pub origin: ImmutableOrigin,
pub style_context: SharedStyleContext<'a>,
pub font_context: Arc<FontContext>,
pub image_cache: Arc<dyn ImageCache>,
pub pending_images: Mutex<Vec<PendingImage>>,
pub iframe_sizes: Mutex<IFrameSizes>,
pub webrender_image_cache: Arc<RwLock<FnvHashMap<(ServoUrl, UsePlaceholder), WebRenderImageInfo>>>,
}
Fields§
§id: PipelineId
§use_rayon: bool
§origin: ImmutableOrigin
§style_context: SharedStyleContext<'a>
Bits shared by the layout and style system.
font_context: Arc<FontContext>
A FontContext to be used during layout.
image_cache: Arc<dyn ImageCache>
Reference to the script thread image cache.
pending_images: Mutex<Vec<PendingImage>>
A list of in-progress image loads to be shared with the script thread.
iframe_sizes: Mutex<IFrameSizes>
A collection of <iframe>
sizes to send back to script.
webrender_image_cache: Arc<RwLock<FnvHashMap<(ServoUrl, UsePlaceholder), WebRenderImageInfo>>>
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