pub struct ScaleScratch { /* private fields */ }Expand description
Reusable scratch for scaling draw commands to physical pixels on the software path. Holds the
output buffer plus per-frame caches keyed by the source Arc pointer, so a style shared by many
commands (the common case for a UI tree) is scaled and heap-allocated once per frame rather than
once per command.
Implementations§
Source§impl ScaleScratch
impl ScaleScratch
pub fn new() -> Self
Sourcepub fn scale_into(
&mut self,
commands: &[DrawCommand],
sf: f32,
) -> &[DrawCommand]
pub fn scale_into( &mut self, commands: &[DrawCommand], sf: f32, ) -> &[DrawCommand]
Scales every command in commands by sf into the reusable internal buffer and returns it.
The pointer-keyed caches are cleared on entry, so a recycled allocator address can never yield
a stale hit (ABA-safe); cache reuse only spans commands within this single call.
Trait Implementations§
Source§impl Default for ScaleScratch
impl Default for ScaleScratch
Source§fn default() -> ScaleScratch
fn default() -> ScaleScratch
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !RefUnwindSafe for ScaleScratch
impl !UnwindSafe for ScaleScratch
impl Freeze for ScaleScratch
impl Send for ScaleScratch
impl Sync for ScaleScratch
impl Unpin for ScaleScratch
impl UnsafeUnpin for ScaleScratch
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