Struct webrender::batch::BatchBuilder

source ·
pub struct BatchBuilder {
    glyph_fetch_buffer: Vec<GlyphFetchResult>,
    batcher: AlphaBatchBuilder,
}
Expand description

Supports (recursively) adding a list of primitives and pictures to an alpha batch builder. In future, it will support multiple dirty regions / slices, allowing the contents of a picture to be spliced into multiple batch builders.

Fields§

§glyph_fetch_buffer: Vec<GlyphFetchResult>

A temporary buffer that is used during glyph fetching, stored here to reduce memory allocations.

§batcher: AlphaBatchBuilder

Implementations§

source§

impl BatchBuilder

source

pub fn new(batcher: AlphaBatchBuilder) -> Self

source

pub fn finalize(self) -> AlphaBatchBuilder

source

fn add_brush_instance_to_batches( &mut self, batch_key: BatchKey, features: BatchFeatures, bounding_rect: &PictureRect, z_id: ZBufferId, segment_index: i32, edge_flags: EdgeAaSegmentMask, clip_task_address: RenderTaskAddress, brush_flags: BrushFlags, prim_header_index: PrimitiveHeaderIndex, resource_address: i32, )

source

fn add_split_composite_instance_to_batches( &mut self, batch_key: BatchKey, features: BatchFeatures, bounding_rect: &PictureRect, z_id: ZBufferId, prim_header_index: PrimitiveHeaderIndex, polygons_address: i32, )

source

fn clear_batches(&mut self)

Clear all current batchers. This is typically used when a primitive is encountered that occludes all previous content in this batch list.

source

pub fn add_prim_to_batch( &mut self, cmd: &PrimitiveCommand, prim_spatial_node_index: SpatialNodeIndex, ctx: &RenderTargetContext<'_, '_>, gpu_cache: &mut GpuCache, render_tasks: &RenderTaskGraph, prim_headers: &mut PrimitiveHeaders, transforms: &mut TransformPalette, root_spatial_node_index: SpatialNodeIndex, surface_spatial_node_index: SpatialNodeIndex, z_generator: &mut ZBufferIdGenerator, prim_instances: &[PrimitiveInstance], gpu_buffer_builder: &mut GpuBufferBuilder, segments: &[RenderTaskId], )

source

fn add_compositor_surface_cutout( &mut self, prim_rect: LayoutRect, local_clip_rect: LayoutRect, clip_task_index: ClipTaskIndex, transform_id: TransformPaletteId, z_id: ZBufferId, bounding_rect: &PictureRect, ctx: &RenderTargetContext<'_, '_>, gpu_cache: &mut GpuCache, render_tasks: &RenderTaskGraph, prim_headers: &mut PrimitiveHeaders, )

Draw a (potentially masked) alpha cutout so that a video underlay will be blended through by the compositor

source

fn add_segment_to_batch( &mut self, segment: &BrushSegment, segment_data: &SegmentInstanceData, segment_index: i32, batch_kind: BrushBatchKind, prim_header_index: PrimitiveHeaderIndex, alpha_blend_mode: BlendMode, features: BatchFeatures, brush_flags: BrushFlags, edge_aa_mask: EdgeAaSegmentMask, bounding_rect: &PictureRect, transform_kind: TransformedRectKind, z_id: ZBufferId, prim_opacity: PrimitiveOpacity, clip_task_index: ClipTaskIndex, ctx: &RenderTargetContext<'_, '_>, render_tasks: &RenderTaskGraph, )

Add a single segment instance to a batch.

edge_aa_mask Specifies the edges that are allowed to have anti-aliasing, if and only if the segments enable it. In other words passing EdgeAaSegmentFlags::all() does not necessarily mean all edges will be anti-aliased, only that they could be.

source

fn add_segmented_prim_to_batch( &mut self, brush_segments: Option<&[BrushSegment]>, prim_opacity: PrimitiveOpacity, params: &BrushBatchParameters, blend_mode: BlendMode, features: BatchFeatures, brush_flags: BrushFlags, edge_aa_mask: EdgeAaSegmentMask, prim_header_index: PrimitiveHeaderIndex, bounding_rect: &PictureRect, transform_kind: TransformedRectKind, z_id: ZBufferId, clip_task_index: ClipTaskIndex, ctx: &RenderTargetContext<'_, '_>, render_tasks: &RenderTaskGraph, )

Add any segment(s) from a brush to batches.

edge_aa_mask Specifies the edges that are allowed to have anti-aliasing, if and only if the segments enable it. In other words passing EdgeAaSegmentFlags::all() does not necessarily mean all edges will be anti-aliased, only that they could be.

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

source§

const ALIGN: usize = _

The alignment of pointer.
§

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, U> TryFrom<U> for T
where U: Into<T>,

§

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

§

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.