azul_webrender_api

Struct DisplayListBuilder

Source
pub struct DisplayListBuilder {
    pub data: Vec<u8>,
    pub pipeline_id: PipelineId,
    /* private fields */
}

Fields§

§data: Vec<u8>§pipeline_id: PipelineId

Implementations§

Source§

impl DisplayListBuilder

Source

pub fn new(pipeline_id: PipelineId) -> Self

Source

pub fn with_capacity(pipeline_id: PipelineId, capacity: usize) -> Self

Source

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.
Source

pub fn restore(&mut self)

Restores the state of the builder to when save() was last called.

Source

pub fn clear_save(&mut self)

Discards the builder’s save (indicating the attempted operation was successful).

Source

pub fn emit_display_list<W>( &mut self, indent: usize, range: Range<Option<usize>>, sink: W, ) -> usize
where 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.

Source

pub fn dump_serialized_display_list(&mut self)

Print the display items in the list to stdout.

Source

pub fn push_item_to_section( &mut self, item: &DisplayItem, section: DisplayListSection, )

Source

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.

Source

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.

Source

pub fn push_rect( &mut self, common: &CommonItemProperties, bounds: LayoutRect, color: ColorF, )

Source

pub fn push_rect_with_animation( &mut self, common: &CommonItemProperties, bounds: LayoutRect, color: PropertyBinding<ColorF>, )

Source

pub fn push_clear_rect( &mut self, common: &CommonItemProperties, bounds: LayoutRect, )

Source

pub fn push_hit_test(&mut self, common: &CommonItemProperties, tag: ItemTag)

Source

pub fn push_line( &mut self, common: &CommonItemProperties, area: &LayoutRect, wavy_line_thickness: f32, orientation: LineOrientation, color: &ColorF, style: LineStyle, )

Source

pub fn push_image( &mut self, common: &CommonItemProperties, bounds: LayoutRect, image_rendering: ImageRendering, alpha_type: AlphaType, key: ImageKey, color: ColorF, )

Source

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, )

Source

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.

Source

pub fn push_text( &mut self, common: &CommonItemProperties, bounds: LayoutRect, glyphs: &[GlyphInstance], font_key: FontInstanceKey, color: ColorF, glyph_options: Option<GlyphOptions>, )

Source

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.

Source

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.

Source

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.

Source

pub fn push_border( &mut self, common: &CommonItemProperties, bounds: LayoutRect, widths: LayoutSideOffsets, details: BorderDetails, )

Source

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, )

Source

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.

Source

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.

Source

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.

Source

pub fn push_reference_frame( &mut self, origin: LayoutPoint, parent_spatial_id: SpatialId, transform_style: TransformStyle, transform: PropertyBinding<LayoutTransform>, kind: ReferenceFrameKind, ) -> SpatialId

Source

pub fn push_computed_frame( &mut self, origin: LayoutPoint, parent_spatial_id: SpatialId, scale_from: Option<LayoutSize>, vertical_flip: bool, rotation: Rotation, ) -> SpatialId

Source

pub fn pop_reference_frame(&mut self)

Source

pub fn push_stacking_context( &mut self, origin: LayoutPoint, spatial_id: SpatialId, prim_flags: PrimitiveFlags, clip_id: Option<ClipId>, transform_style: TransformStyle, mix_blend_mode: MixBlendMode, filters: &[FilterOp], filter_datas: &[FilterData], filter_primitives: &[FilterPrimitive], raster_space: RasterSpace, flags: StackingContextFlags, )

Source

pub fn push_simple_stacking_context( &mut self, origin: LayoutPoint, spatial_id: SpatialId, prim_flags: PrimitiveFlags, )

Helper for examples/ code.

Source

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.

Source

pub fn pop_stacking_context(&mut self)

Source

pub fn push_stops(&mut self, stops: &[GradientStop])

Source

pub fn push_backdrop_filter( &mut self, common: &CommonItemProperties, filters: &[FilterOp], filter_datas: &[FilterData], filter_primitives: &[FilterPrimitive], )

Source

pub fn push_filters( &mut self, filters: &[FilterOp], filter_datas: &[FilterData], filter_primitives: &[FilterPrimitive], )

Source

pub fn define_scroll_frame( &mut self, parent_space_and_clip: &SpaceAndClipInfo, external_id: ExternalScrollId, content_rect: LayoutRect, clip_rect: LayoutRect, scroll_sensitivity: ScrollSensitivity, external_scroll_offset: LayoutVector2D, ) -> SpaceAndClipInfo

Source

pub fn define_clip_chain<I>( &mut self, parent: Option<ClipChainId>, clips: I, ) -> ClipChainId

Source

pub fn define_clip_image_mask( &mut self, parent_space_and_clip: &SpaceAndClipInfo, image_mask: ImageMask, points: &[LayoutPoint], fill_rule: FillRule, ) -> ClipId

Source

pub fn define_clip_rect( &mut self, parent_space_and_clip: &SpaceAndClipInfo, clip_rect: LayoutRect, ) -> ClipId

Source

pub fn define_clip_rounded_rect( &mut self, parent_space_and_clip: &SpaceAndClipInfo, clip: ComplexClipRegion, ) -> ClipId

Source

pub fn define_sticky_frame( &mut self, parent_spatial_id: SpatialId, frame_rect: LayoutRect, margins: SideOffsets2D<Option<f32>, LayoutPixel>, vertical_offset_bounds: StickyOffsetBounds, horizontal_offset_bounds: StickyOffsetBounds, previously_applied_offset: LayoutVector2D, ) -> SpatialId

Source

pub fn push_iframe( &mut self, bounds: LayoutRect, clip_rect: LayoutRect, space_and_clip: &SpaceAndClipInfo, pipeline_id: PipelineId, ignore_missing_pipeline: bool, )

Source

pub fn push_shadow( &mut self, space_and_clip: &SpaceAndClipInfo, shadow: Shadow, should_inflate: bool, )

Source

pub fn pop_all_shadows(&mut self)

Source

pub fn start_item_group(&mut self)

Source

pub fn finish_item_group(&mut self, key: ItemKey) -> bool

Source

pub fn cancel_item_group(&mut self, discard: bool)

Source

pub fn push_reuse_items(&mut self, key: ItemKey)

Source

pub fn set_cache_size(&mut self, cache_size: usize)

Source

pub fn finalize(self) -> (PipelineId, BuiltDisplayList)

Trait Implementations§

Source§

impl Clone for DisplayListBuilder

Source§

fn clone(&self) -> DisplayListBuilder

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Auto Trait Implementations§

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> 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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dst: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.