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
The wr::DisplayListBuilder
for this Servo 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<'_>
impl DisplayListBuilder<'_>
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
fn wr(&mut self) -> &mut DisplayListBuilder
fn pipeline_id(&mut self) -> PipelineId
fn mark_is_contentful(&mut self)
fn spatial_id(&self, id: ScrollTreeNodeId) -> SpatialId
fn clip_chain_id(&self, id: ClipId) -> ClipChainId
pub(crate) fn add_all_spatial_nodes(&mut self)
Sourcepub(crate) fn add_clip_to_display_list(&mut self, clip: &Clip) -> ClipChainId
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 asoverflow: 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
.
Sourcefn maybe_create_clip(
&mut self,
radii: BorderRadius,
rect: LayoutRect,
force_clip_creation: bool,
) -> Option<ClipChainId>
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.
fn common_properties( &self, clip_rect: LayoutRect, style: &ComputedValues, ) -> CommonItemProperties
Sourcefn paint_dom_inspector_highlight(&mut self)
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> 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
Source§impl<T> Filterable for T
impl<T> Filterable for T
Source§fn filterable(
self,
filter_name: &'static str,
) -> RequestFilterDataProvider<T, fn(DataRequest<'_>) -> bool>
fn filterable( self, filter_name: &'static str, ) -> RequestFilterDataProvider<T, fn(DataRequest<'_>) -> bool>
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>
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>
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