pub struct ImageScratch {
pub visible_tiles: Range<VisibleImageTile>,
pub src_color: Option<RenderTaskId>,
pub normalized_uvs: bool,
pub adjustment: AdjustedImageSource,
pub tight_local_clip_rect: LayoutRect,
pub may_need_repetition: bool,
pub gpu_address: GpuBufferAddress,
}Expand description
Per-frame scratch data for an Image primitive. Captures the per-frame
outputs of ImageData::update: the source render task (or a Range of
per-tile tasks for tiled images), normalized-uvs flag, image
adjustment from snapshots, and a tight local clip rect derived from
the prim’s clip chain. Pushed during prepare and read by batch.
Fields§
§visible_tiles: Range<VisibleImageTile>Range into PrimitiveFrameScratch.visible_image_tiles for tiled
images. Empty for non-tiled images.
src_color: Option<RenderTaskId>Source render task for non-tiled images.
normalized_uvs: boolWhether to render with normalized UVs (set for some external images).
adjustment: AdjustedImageSourceAdjustment applied when sampling from a wider source (e.g. snapshot images).
tight_local_clip_rect: LayoutRectTight local clip rect derived from the prim’s clip chain. We rely on having this in cases where decomposing repeated images can produce primitives that partially cover the original image rect, and for snapshot images where the snapshot area is tighter than the rasterized area.
may_need_repetition: boolWhether this draw needs the repetition-capable image shader. Set to false when the stretch_size covers the prim (no tiling) or when the image was decomposed into per-tile prims at scene-build time. Read by batch to choose between brush_image and brush_fast_image.
gpu_address: GpuBufferAddressAddress of the per-instance image-brush GPU block. Lives here
(rather than on the template’s PrimTemplateCommonData) because
the resolved stretch size and adjustment-mapped values vary per
instance, even when many instances share a single template.
Implementations§
Source§impl ImageScratch
impl ImageScratch
Trait Implementations§
Source§impl Debug for ImageScratch
impl Debug for ImageScratch
Auto Trait Implementations§
impl Freeze for ImageScratch
impl RefUnwindSafe for ImageScratch
impl Send for ImageScratch
impl Sync for ImageScratch
impl Unpin for ImageScratch
impl UnsafeUnpin for ImageScratch
impl UnwindSafe for ImageScratch
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