pub struct GlyphRunPlacement2d<'run> { /* private fields */ }Expand description
One prepared run’s placement in an ordered atlas batch.
Translation uses local logical pixels and tint multiplies the per-glyph tint.
The optional clip is relative to the drawing viewport, is not translated with
the run, and intersects the frame item’s clip. No shaping or rasterization is
performed. A batch snapshots this input; later changes to the source run do
not alter the batch until WgpuRenderer::update_glyph_batch is called.
Implementations§
Source§impl<'run> GlyphRunPlacement2d<'run>
impl<'run> GlyphRunPlacement2d<'run>
Sourcepub const fn new(run: &'run GlyphRun2d, placement: ImageBatchPlacement) -> Self
pub const fn new(run: &'run GlyphRun2d, placement: ImageBatchPlacement) -> Self
Places an already prepared run without changing its source layout.
Sourcepub const fn with_clip(self, clip: ScreenClipRect) -> Self
pub const fn with_clip(self, clip: ScreenClipRect) -> Self
Sets a validated viewport-local clip, independent of the translation.
Sourcepub const fn run(self) -> &'run GlyphRun2d
pub const fn run(self) -> &'run GlyphRun2d
Returns the prepared source run.
Sourcepub const fn placement(self) -> ImageBatchPlacement
pub const fn placement(self) -> ImageBatchPlacement
Returns the run’s local logical translation and normalized tint.
Sourcepub const fn clip(self) -> Option<ScreenClipRect>
pub const fn clip(self) -> Option<ScreenClipRect>
Returns the optional viewport-local logical clip.
Trait Implementations§
Source§impl<'run> Clone for GlyphRunPlacement2d<'run>
impl<'run> Clone for GlyphRunPlacement2d<'run>
impl<'run> Copy for GlyphRunPlacement2d<'run>
Auto Trait Implementations§
impl<'run> !RefUnwindSafe for GlyphRunPlacement2d<'run>
impl<'run> !UnwindSafe for GlyphRunPlacement2d<'run>
impl<'run> Freeze for GlyphRunPlacement2d<'run>
impl<'run> Send for GlyphRunPlacement2d<'run>
impl<'run> Sync for GlyphRunPlacement2d<'run>
impl<'run> Unpin for GlyphRunPlacement2d<'run>
impl<'run> UnsafeUnpin for GlyphRunPlacement2d<'run>
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