Struct DisplayListBuilder

Source
pub(crate) struct DisplayListBuilder<'a> {
    current_scroll_node_id: ScrollTreeNodeId,
    current_reference_frame_scroll_node_id: ScrollTreeNodeId,
    current_clip_id: ClipId,
    pub webrender_display_list_builder: &'a mut DisplayListBuilder,
    pub compositor_info: &'a mut CompositorDisplayListInfo,
    inspector_highlight: Option<InspectorHighlight>,
    paint_body_background: bool,
    clip_map: Vec<ClipChainId>,
    image_resolver: Arc<ImageResolver>,
    device_pixel_ratio: Scale<f32, CSSPixel, DevicePixel>,
}

Fields§

§current_scroll_node_id: ScrollTreeNodeId

The current ScrollTreeNodeId for this DisplayListBuilder. This allows only passing the builder instead passing the containing stacking_context::StackingContextContent::Fragment as an argument to display list building functions.

§current_reference_frame_scroll_node_id: ScrollTreeNodeId

The current ScrollTreeNodeId for this DisplayListBuilder. This is necessary in addition to the Self::current_scroll_node_id, because some pieces of fragments as backgrounds with background-attachment: fixed need to not scroll while the rest of the fragment does.

§current_clip_id: ClipId

The current ClipId for this DisplayListBuilder. This allows only passing the builder instead passing the containing stacking_context::StackingContextContent::Fragment as an argument to display list building functions.

§webrender_display_list_builder: &'a mut DisplayListBuilder§compositor_info: &'a mut CompositorDisplayListInfo

The CompositorDisplayListInfo used to collect display list items and metadata.

§inspector_highlight: Option<InspectorHighlight>

Data about the fragments that are highlighted by the inspector, if any.

This data is collected during the traversal of the fragment tree and used to paint the highlight at the very end.

§paint_body_background: bool

Whether or not the <body> element should be painted. This is false if the root <html> element inherits the <body>’s background to paint the page canvas background. See https://drafts.csswg.org/css-backgrounds/#body-background.

§clip_map: Vec<ClipChainId>

A mapping from ClipId To WebRender ClipChainId used when building this WebRender display list.

§image_resolver: Arc<ImageResolver>

An ImageResolver to use during display list construction.

§device_pixel_ratio: Scale<f32, CSSPixel, DevicePixel>

The device pixel ratio used for this Document’s display list.

Implementations§

Source§

impl DisplayListBuilder<'_>

Source

pub(crate) fn build( stacking_context_tree: &mut StackingContextTree, fragment_tree: &FragmentTree, image_resolver: Arc<ImageResolver>, device_pixel_ratio: Scale<f32, StyloCSSPixel, StyloDevicePixel>, highlighted_dom_node: Option<OpaqueNode>, debug: &DebugOptions, ) -> BuiltDisplayList

Source

fn wr(&mut self) -> &mut DisplayListBuilder

Source

fn pipeline_id(&mut self) -> PipelineId

Source

fn mark_is_contentful(&mut self)

Source

fn spatial_id(&self, id: ScrollTreeNodeId) -> SpatialId

Source

fn clip_chain_id(&self, id: ClipId) -> ClipChainId

Source

pub(crate) fn add_all_spatial_nodes(&mut self)

Source

pub(crate) fn add_clip_to_display_list(&mut self, clip: &Clip) -> ClipChainId

Add the given Clip to the WebRender display list and create a mapping from its ClipId to a WebRender ClipChainId. This happens:

  • When WebRender display list construction starts: All clips created during the StackingContextTree construction are added in one batch. These clips are used for things such as overflow: scroll elements.
  • When a clip is added during WebRender display list construction for individual items. In that case, this is called by Self::maybe_create_clip.
Source

fn maybe_create_clip( &mut self, radii: BorderRadius, rect: LayoutRect, force_clip_creation: bool, ) -> Option<ClipChainId>

Add a new clip to the WebRender display list being built. This only happens during WebRender display list building and these clips should be added after all clips from the StackingContextTree have already been processed.

Source

fn common_properties( &self, clip_rect: LayoutRect, style: &ComputedValues, ) -> CommonItemProperties

Source

fn paint_dom_inspector_highlight(&mut self)

Draw highlights around the node that is currently hovered in the devtools.

Auto Trait Implementations§

§

impl<'a> Freeze for DisplayListBuilder<'a>

§

impl<'a> !RefUnwindSafe for DisplayListBuilder<'a>

§

impl<'a> Send for DisplayListBuilder<'a>

§

impl<'a> !Sync for DisplayListBuilder<'a>

§

impl<'a> Unpin for DisplayListBuilder<'a>

§

impl<'a> !UnwindSafe for DisplayListBuilder<'a>

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> AsVoidPtr for T

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> Filterable for T

Source§

fn filterable( self, filter_name: &'static str, ) -> RequestFilterDataProvider<T, fn(DataRequest<'_>) -> bool>

Creates a filterable data provider with the given name for debugging. Read more
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

Source§

impl<T> WasmNotSend for T
where T: Send,