pub struct TextRunScratch {
pub used_font: FontInstance,
pub glyph_keys_range: Range<GlyphKey>,
pub local_rect: LayoutRect,
pub gpu_address: GpuBufferAddress,
pub raster_scale: f32,
pub local_raster: bool,
}Expand description
Per-frame scratch data for a TextRun primitive. Holds the snapshot
of font + glyph state captured each frame in request_resources and
read by batching. Pushed once per visible TextRun per frame.
Fields§
§used_font: FontInstancePer-frame font instance derived from the specified font + this frame’s transform + raster space. Carries subpixel direction, flags, and the device-space size.
glyph_keys_range: Range<GlyphKey>Range of glyph keys allocated for this run this frame, indexing into PrimitiveFrameScratch.glyph_keys.
local_rect: LayoutRectNormalized prim local rect for this run. .min is the run anchor:
the shader transforms it to device space and adds the per-glyph
device offsets. Stored here so batching emits the identical anchor
in PrimitiveHeader.local_rect that request_resources used to
compute those offsets.
gpu_address: GpuBufferAddressPer-instance GPU buffer address for the color block followed by the per-glyph offset blocks (two glyphs per block). In device mode these are glyph pen positions snapped to the device grid, relative to the transformed anchor; in local-raster mode they are absolute snapped raster-space positions. Per-instance because they depend on this frame’s transform.
raster_scale: f32Raster scale used when rasterizing the glyphs (1.0 in device mode; the local/zoom scale or oversize-clamp scale in local-raster mode). Passed to the shader so it can map raster space back to local.
local_raster: boolWhether this run uses local-raster mode (see request_resources).
Trait Implementations§
Source§impl Debug for TextRunScratch
impl Debug for TextRunScratch
Auto Trait Implementations§
impl Freeze for TextRunScratch
impl RefUnwindSafe for TextRunScratch
impl Send for TextRunScratch
impl Sync for TextRunScratch
impl Unpin for TextRunScratch
impl UnsafeUnpin for TextRunScratch
impl UnwindSafe for TextRunScratch
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