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
impl BatchBuilder
pub fn new(batcher: AlphaBatchBuilder) -> Self
pub fn finalize(self) -> AlphaBatchBuilder
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, )
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, )
sourcefn clear_batches(&mut self)
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.
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], )
sourcefn 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,
)
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
sourcefn 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,
)
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.
sourcefn 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,
)
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§
impl Freeze for BatchBuilder
impl RefUnwindSafe for BatchBuilder
impl Send for BatchBuilder
impl Sync for BatchBuilder
impl Unpin for BatchBuilder
impl UnwindSafe for BatchBuilder
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> 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