pub(crate) struct CommandBucketer {
viewport: RectU16,
pub(super) clip_bboxes: Vec<RectU16>,
pub(super) rows: RetainVec<RowState>,
pub(crate) paint_fill_attrs: Vec<PaintFillAttrs>,
pub(crate) layer_fill_attrs: Vec<LayerFillAttrs>,
pub(crate) filter_paints: Vec<EncodedPaint>,
pub(super) active_layers: Vec<ActiveLayer>,
occupied_rows_pool: VecPool<usize>,
occupied_rows_bool_scratch: Vec<bool>,
pub(super) next_draw_id: u32,
}Expand description
A bucketer that groups commands into strip-row-sized buckets.
Fields§
§viewport: RectU16The viewport of the root/filter layer we are currently bucketing.
clip_bboxes: Vec<RectU16>The currently active stack of clip bboxes (from layer clips), always anchored at the (0, 0) origin, regardless of the viewport, tracked for two reasons:
- So we can clamp fill commands to the bbox and avoid unnecessary rendering work.
- In case we have a filter layer with a clip, it all happens in three steps:
- We first push a new intermediate layer with the clip.
- We composite the whole filter layer cropped to the active clip bbox. Note that the filter layer itself is not affected by the clip bbox, as filter layers should always be fully rendered before applying clipping. However, by limiting the composition to the coarse clip bbox we might be able to save a lot of work if only a small part of the filter layer is visible.
- Pop the intermediate layer, which will take care of doing the fine-grained clipping (e.g. applying anti-aliasing from the clip path).
rows: RetainVec<RowState>The actual render commands for each strip row.
Since this is essentially a 2D-array, we use RetainVec to preserve inner allocations
upon resetting.
paint_fill_attrs: Vec<PaintFillAttrs>§layer_fill_attrs: Vec<LayerFillAttrs>§filter_paints: Vec<EncodedPaint>§active_layers: Vec<ActiveLayer>Keeping track of currently active layers to enable lazy layer pushing.
occupied_rows_pool: VecPool<usize>A vector pool for keeping track of occupied rows in a layer.
occupied_rows_bool_scratch: Vec<bool>Scratch space used when replaying clip strips while popping clipped layers.
next_draw_id: u32A counter to assign monotonically increasing IDs to draws to enable depth buffer rendering.
Implementations§
Source§impl CommandBucketer
impl CommandBucketer
pub(crate) fn from_wh(width: u16, height: u16) -> Self
pub(crate) fn new(viewport: RectU16) -> Self
fn bbox_span(bbox: RectU16) -> Span
pub(crate) fn rows(&self) -> &[RowState]
pub(crate) fn width(&self) -> u16
fn viewport_origin(&self) -> (u16, u16)
pub(crate) fn reset(&mut self, viewport: RectU16)
fn next_draw_id(&mut self) -> u32
pub(super) fn ensure_row_layers(&mut self, row_idx: usize)
pub(crate) fn bucket_commands( &mut self, nodes: &[Node], draws: &[RecordedFill], layers: &[RecordedLayer], strips: &[Strip], encoded_paints: &[EncodedPaint], filter_ctx: &FilterContext, )
pub(crate) fn push_layer(&mut self, props: &LayerProps)
pub(crate) fn pop_layer(&mut self, strips: &[Strip])
pub(crate) fn generate_filter_layer_fill( &mut self, pixmap: Arc<Pixmap>, placement: FilterLayerPlacement, static_paint_count: usize, )
pub(crate) fn generate_fill( &mut self, strip_buf: &[Strip], attrs: &PaintFillAttrs, encoded_paints: &[EncodedPaint], )
pub(crate) fn generate<F, A>( &mut self, strip_buf: &[Strip], fill_cmd: F, alpha_fill_cmd: A, )
Trait Implementations§
Auto Trait Implementations§
impl Freeze for CommandBucketer
impl RefUnwindSafe for CommandBucketer
impl Send for CommandBucketer
impl Sync for CommandBucketer
impl Unpin for CommandBucketer
impl UnsafeUnpin for CommandBucketer
impl UnwindSafe for CommandBucketer
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
Mutably borrows from an owned value. Read more
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>
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 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>
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