pub(super) struct BoundsSink<'a> {
outlines: OutlineGlyphs<'a>,
transforms: SmallVec<[Matrix<f32>; 8]>,
clips: SmallVec<[Bounds; 8]>,
groups: SmallVec<[Bounds; 8]>,
}Expand description
A sink that paints nothing and measures what would have been painted.
Fields§
§outlines: OutlineGlyphs<'a>§transforms: SmallVec<[Matrix<f32>; 8]>The transformation matrix at each depth. The last one is current.
clips: SmallVec<[Bounds; 8]>The clip at each depth, in root coordinates. The last one is current.
groups: SmallVec<[Bounds; 8]>The area painted by each open layer. The last one is current.
Implementations§
Source§impl<'a> BoundsSink<'a>
impl<'a> BoundsSink<'a>
pub(super) fn new(outlines: OutlineGlyphs<'a>) -> Self
Sourcepub(super) fn bounds(&self) -> BoundingBox<f32>
pub(super) fn bounds(&self) -> BoundingBox<f32>
Returns the bounding box of everything painted, or an empty box at the origin if nothing was painted.
fn current_transform(&self) -> &Matrix<f32>
fn current_clip(&self) -> Bounds
Trait Implementations§
Source§impl PaintSink for BoundsSink<'_>
impl PaintSink for BoundsSink<'_>
Source§fn push_transform(&mut self, transform: Matrix<f32>)
fn push_transform(&mut self, transform: Matrix<f32>)
Concatenates
transform to the current transformation matrix.Source§fn pop_transform(&mut self)
fn pop_transform(&mut self)
Restores the transformation matrix from before the last
push_transform.Source§fn push_clip_glyph(&mut self, glyph: GlyphId)
fn push_clip_glyph(&mut self, glyph: GlyphId)
Clips to the outline of
glyph.Source§fn push_clip_box(&mut self, clip_box: BoundingBox<f32>)
fn push_clip_box(&mut self, clip_box: BoundingBox<f32>)
Clips to
clip_box.Source§fn pop_clip(&mut self)
fn pop_clip(&mut self)
Restores the clip from before the last
push_clip_glyph or
push_clip_box.Source§fn push_layer(&mut self, _composite_mode: CompositeMode)
fn push_layer(&mut self, _composite_mode: CompositeMode)
Pushes a new layer that
pop_layer composites
onto the layer below with composite_mode.Source§fn pop_layer_with_mode(&mut self, composite_mode: CompositeMode)
fn pop_layer_with_mode(&mut self, composite_mode: CompositeMode)
Source§fn fill_glyph(
&mut self,
glyph: GlyphId,
brush_transform: Option<Matrix<f32>>,
brush: Brush<'_>,
)
fn fill_glyph( &mut self, glyph: GlyphId, brush_transform: Option<Matrix<f32>>, brush: Brush<'_>, )
Clips to the outline of
glyph and fills it with brush, with
brush_transform applied to the brush alone. Read moreSource§fn paint_cached_color_glyph(
&mut self,
_glyph: GlyphId,
) -> Result<PaintCachedColorGlyph, Error>
fn paint_cached_color_glyph( &mut self, _glyph: GlyphId, ) -> Result<PaintCachedColorGlyph, Error>
Paints a nested color glyph from the sink’s cache, if it has one. Read more
Source§fn pop_layer(&mut self)
fn pop_layer(&mut self)
Composites the last layer onto the layer below, using the mode passed
to the matching
push_layer.Auto Trait Implementations§
impl<'a> !RefUnwindSafe for BoundsSink<'a>
impl<'a> !UnwindSafe for BoundsSink<'a>
impl<'a> Freeze for BoundsSink<'a>
impl<'a> Send for BoundsSink<'a>
impl<'a> Sync for BoundsSink<'a>
impl<'a> Unpin for BoundsSink<'a>
impl<'a> UnsafeUnpin for BoundsSink<'a>
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