Struct webrender_api::DisplayListBuilder
source · pub struct DisplayListBuilder {Show 13 fields
payload: DisplayListPayload,
pub pipeline_id: PipelineId,
pending_chunk: Vec<u8>,
writing_to_chunk: bool,
next_clip_index: usize,
next_spatial_index: usize,
next_clip_chain_id: u64,
builder_start_time: u64,
save_state: Option<SaveState>,
cache_size: usize,
serialized_content_buffer: Option<String>,
state: BuildState,
rf_mapper: ReferenceFrameMapper,
}
Fields§
§payload: DisplayListPayload
§pipeline_id: PipelineId
§pending_chunk: Vec<u8>
§writing_to_chunk: bool
§next_clip_index: usize
§next_spatial_index: usize
§next_clip_chain_id: u64
§builder_start_time: u64
§save_state: Option<SaveState>
§cache_size: usize
§serialized_content_buffer: Option<String>
§state: BuildState
§rf_mapper: ReferenceFrameMapper
Helper struct to map stacking context coords <-> reference frame coords.
Implementations§
source§impl DisplayListBuilder
impl DisplayListBuilder
pub fn new(pipeline_id: PipelineId) -> Self
fn reset(&mut self)
sourcepub fn save(&mut self)
pub fn save(&mut self)
Saves the current display list state, so it may be restore()
’d.
§Conditions:
- Doesn’t support popping clips that were pushed before the save.
- Doesn’t support nested saves.
- Must call
clear_save()
if the restore becomes unnecessary.
sourcepub fn clear_save(&mut self)
pub fn clear_save(&mut self)
Discards the builder’s save (indicating the attempted operation was successful).
sourcepub fn emit_display_list<W>(
&mut self,
indent: usize,
range: Range<Option<usize>>,
sink: W,
) -> usizewhere
W: Write,
pub fn emit_display_list<W>(
&mut self,
indent: usize,
range: Range<Option<usize>>,
sink: W,
) -> usizewhere
W: Write,
Emits a debug representation of display items in the list, for debugging purposes. If the range’s start parameter is specified, only display items starting at that index (inclusive) will be printed. If the range’s end parameter is specified, only display items before that index (exclusive) will be printed. Calling this function with end <= start is allowed but is just a waste of CPU cycles. The function emits the debug representation of the selected display items, one per line, with the given indent, to the provided sink object. The return value is the total number of items in the display list, which allows the caller to subsequently invoke this function to only dump the newly-added items.
sourcepub fn dump_serialized_display_list(&mut self)
pub fn dump_serialized_display_list(&mut self)
Print the display items in the list to stdout.
fn add_to_display_list_dump<T: Debug>(&mut self, item: T)
sourcefn default_section(&self) -> DisplayListSection
fn default_section(&self) -> DisplayListSection
Returns the default section that DisplayListBuilder will write to, if no section is specified explicitly.
fn buffer_from_section(&mut self, section: DisplayListSection) -> &mut Vec<u8> ⓘ
pub fn push_item_to_section( &mut self, item: &DisplayItem, section: DisplayListSection, )
sourcepub fn push_item(&mut self, item: &DisplayItem)
pub fn push_item(&mut self, item: &DisplayItem)
Add an item to the display list.
NOTE: It is usually preferable to use the specialized methods to push display items. Pushing unexpected or invalid items here may result in WebRender panicking or behaving in unexpected ways.
pub fn push_spatial_tree_item(&mut self, item: &SpatialTreeItem)
fn push_iter_impl<I>(data: &mut Vec<u8>, iter_source: I)
sourcepub fn push_iter<I>(&mut self, iter: I)
pub fn push_iter<I>(&mut self, iter: I)
Push items from an iterator to the display list.
NOTE: Pushing unexpected or invalid items to the display list may result in panic and confusion.
fn remap_common_coordinates_and_bounds( &self, common: &CommonItemProperties, bounds: LayoutRect, ) -> (CommonItemProperties, LayoutRect)
fn remap_bounds(&self, bounds: LayoutRect) -> LayoutRect
pub fn push_rect( &mut self, common: &CommonItemProperties, bounds: LayoutRect, color: ColorF, )
pub fn push_rect_with_animation( &mut self, common: &CommonItemProperties, bounds: LayoutRect, color: PropertyBinding<ColorF>, )
pub fn push_clear_rect( &mut self, common: &CommonItemProperties, bounds: LayoutRect, )
pub fn push_hit_test( &mut self, rect: LayoutRect, clip_chain_id: ClipChainId, spatial_id: SpatialId, flags: PrimitiveFlags, tag: ItemTag, )
pub fn push_line( &mut self, common: &CommonItemProperties, area: &LayoutRect, wavy_line_thickness: f32, orientation: LineOrientation, color: &ColorF, style: LineStyle, )
pub fn push_image( &mut self, common: &CommonItemProperties, bounds: LayoutRect, image_rendering: ImageRendering, alpha_type: AlphaType, key: ImageKey, color: ColorF, )
pub fn push_repeating_image( &mut self, common: &CommonItemProperties, bounds: LayoutRect, stretch_size: LayoutSize, tile_spacing: LayoutSize, image_rendering: ImageRendering, alpha_type: AlphaType, key: ImageKey, color: ColorF, )
sourcepub fn push_yuv_image(
&mut self,
common: &CommonItemProperties,
bounds: LayoutRect,
yuv_data: YuvData,
color_depth: ColorDepth,
color_space: YuvColorSpace,
color_range: ColorRange,
image_rendering: ImageRendering,
)
pub fn push_yuv_image( &mut self, common: &CommonItemProperties, bounds: LayoutRect, yuv_data: YuvData, color_depth: ColorDepth, color_space: YuvColorSpace, color_range: ColorRange, image_rendering: ImageRendering, )
Push a yuv image. All planar data in yuv image should use the same buffer type.
pub fn push_text( &mut self, common: &CommonItemProperties, bounds: LayoutRect, glyphs: &[GlyphInstance], font_key: FontInstanceKey, color: ColorF, glyph_options: Option<GlyphOptions>, )
sourcepub fn create_gradient(
&mut self,
start_point: LayoutPoint,
end_point: LayoutPoint,
stops: Vec<GradientStop>,
extend_mode: ExtendMode,
) -> Gradient
pub fn create_gradient( &mut self, start_point: LayoutPoint, end_point: LayoutPoint, stops: Vec<GradientStop>, extend_mode: ExtendMode, ) -> Gradient
NOTE: gradients must be pushed in the order they’re created because create_gradient stores the stops in anticipation.
sourcepub fn create_radial_gradient(
&mut self,
center: LayoutPoint,
radius: LayoutSize,
stops: Vec<GradientStop>,
extend_mode: ExtendMode,
) -> RadialGradient
pub fn create_radial_gradient( &mut self, center: LayoutPoint, radius: LayoutSize, stops: Vec<GradientStop>, extend_mode: ExtendMode, ) -> RadialGradient
NOTE: gradients must be pushed in the order they’re created because create_gradient stores the stops in anticipation.
sourcepub fn create_conic_gradient(
&mut self,
center: LayoutPoint,
angle: f32,
stops: Vec<GradientStop>,
extend_mode: ExtendMode,
) -> ConicGradient
pub fn create_conic_gradient( &mut self, center: LayoutPoint, angle: f32, stops: Vec<GradientStop>, extend_mode: ExtendMode, ) -> ConicGradient
NOTE: gradients must be pushed in the order they’re created because create_gradient stores the stops in anticipation.
pub fn push_border( &mut self, common: &CommonItemProperties, bounds: LayoutRect, widths: LayoutSideOffsets, details: BorderDetails, )
pub fn push_box_shadow( &mut self, common: &CommonItemProperties, box_bounds: LayoutRect, offset: LayoutVector2D, color: ColorF, blur_radius: f32, spread_radius: f32, border_radius: BorderRadius, clip_mode: BoxShadowClipMode, )
sourcepub fn push_gradient(
&mut self,
common: &CommonItemProperties,
bounds: LayoutRect,
gradient: Gradient,
tile_size: LayoutSize,
tile_spacing: LayoutSize,
)
pub fn push_gradient( &mut self, common: &CommonItemProperties, bounds: LayoutRect, gradient: Gradient, tile_size: LayoutSize, tile_spacing: LayoutSize, )
Pushes a linear gradient to be displayed.
The gradient itself is described in the
gradient
parameter. It is drawn on
a “tile” with the dimensions from tile_size
.
These tiles are now repeated to the right and
to the bottom infinitely. If tile_spacing
is not zero spacers with the given dimensions
are inserted between the tiles as seams.
The origin of the tiles is given in layout.rect.origin
.
If the gradient should only be displayed once limit
the layout.rect.size
to a single tile.
The gradient is only visible within the local clip.
sourcepub fn push_radial_gradient(
&mut self,
common: &CommonItemProperties,
bounds: LayoutRect,
gradient: RadialGradient,
tile_size: LayoutSize,
tile_spacing: LayoutSize,
)
pub fn push_radial_gradient( &mut self, common: &CommonItemProperties, bounds: LayoutRect, gradient: RadialGradient, tile_size: LayoutSize, tile_spacing: LayoutSize, )
Pushes a radial gradient to be displayed.
See push_gradient
for explanation.
sourcepub fn push_conic_gradient(
&mut self,
common: &CommonItemProperties,
bounds: LayoutRect,
gradient: ConicGradient,
tile_size: LayoutSize,
tile_spacing: LayoutSize,
)
pub fn push_conic_gradient( &mut self, common: &CommonItemProperties, bounds: LayoutRect, gradient: ConicGradient, tile_size: LayoutSize, tile_spacing: LayoutSize, )
Pushes a conic gradient to be displayed.
See push_gradient
for explanation.
pub fn push_reference_frame( &mut self, origin: LayoutPoint, parent_spatial_id: SpatialId, transform_style: TransformStyle, transform: PropertyBinding<LayoutTransform>, kind: ReferenceFrameKind, key: SpatialTreeItemKey, ) -> SpatialId
pub fn push_computed_frame( &mut self, origin: LayoutPoint, parent_spatial_id: SpatialId, scale_from: Option<LayoutSize>, vertical_flip: bool, rotation: Rotation, key: SpatialTreeItemKey, ) -> SpatialId
pub fn pop_reference_frame(&mut self)
pub fn push_stacking_context( &mut self, origin: LayoutPoint, spatial_id: SpatialId, prim_flags: PrimitiveFlags, clip_chain_id: Option<ClipChainId>, transform_style: TransformStyle, mix_blend_mode: MixBlendMode, filters: &[FilterOp], filter_datas: &[FilterData], filter_primitives: &[FilterPrimitive], raster_space: RasterSpace, flags: StackingContextFlags, )
sourcepub fn push_simple_stacking_context(
&mut self,
origin: LayoutPoint,
spatial_id: SpatialId,
prim_flags: PrimitiveFlags,
)
pub fn push_simple_stacking_context( &mut self, origin: LayoutPoint, spatial_id: SpatialId, prim_flags: PrimitiveFlags, )
Helper for examples/ code.
sourcepub fn push_simple_stacking_context_with_filters(
&mut self,
origin: LayoutPoint,
spatial_id: SpatialId,
prim_flags: PrimitiveFlags,
filters: &[FilterOp],
filter_datas: &[FilterData],
filter_primitives: &[FilterPrimitive],
)
pub fn push_simple_stacking_context_with_filters( &mut self, origin: LayoutPoint, spatial_id: SpatialId, prim_flags: PrimitiveFlags, filters: &[FilterOp], filter_datas: &[FilterData], filter_primitives: &[FilterPrimitive], )
Helper for examples/ code.