pub struct NormalBorderScratch {
pub task_ids: Range<RenderTaskId>,
pub brush_segments_range: Range<BrushSegment>,
pub border_segments_range: Range<BorderSegmentInfo>,
pub gpu_address: GpuBufferAddress,
pub may_need_repetition: bool,
}Expand description
Per-frame scratch data for a NormalBorder primitive.
Fields§
§task_ids: Range<RenderTaskId>Range into PrimitiveScratchBuffer::border_task_ids holding the
cached render-task ids for this border’s segments.
brush_segments_range: Range<BrushSegment>Range into PrimitiveFrameScratch::segments holding the per-
frame brush segments for this border. Built fresh each frame
against the prim’s current size in prepare_prim_for_render,
so the segmentation matches the rendered rect.
border_segments_range: Range<BorderSegmentInfo>Range into PrimitiveFrameScratch::border_segments holding the
per-frame edge/corner cache-key + task-size records for this
border. Parallel to brush_segments_range and built alongside.
gpu_address: GpuBufferAddressPer-instance GPU buffer address for the brush + segment blocks
written by NormalBorderData::write_brush_gpu_blocks. Per-
instance because the block contents (stretch_size and segments)
depend on the prim’s per-instance size.
may_need_repetition: boolTrue if any side uses a Dotted or Dashed style. Read by batch
to set BatchFeatures::REPETITION so the cached dot/dash tile
repeats across the rendered segment via brush_image.
Implementations§
Source§impl NormalBorderScratch
impl NormalBorderScratch
Sourcepub fn build_for_prim(
data_handle: Handle<NormalBorderPrim>,
prim_instance_index: PrimitiveInstanceIndex,
prim_size: LayoutSize,
data_stores: &DataStores,
scratch: &mut PrimitiveScratchBuffer,
)
pub fn build_for_prim( data_handle: Handle<NormalBorderPrim>, prim_instance_index: PrimitiveInstanceIndex, prim_size: LayoutSize, data_stores: &DataStores, scratch: &mut PrimitiveScratchBuffer, )
Build the per-frame brush + border segments and the parallel
task-id slot for a NormalBorder prim, push the resulting
NormalBorderScratch entry, and wire it up to the prim’s
PrimitiveDrawHeader.kind_scratch.
Called from the prep-pass before update_clip_task runs, since
update_clip_task_for_brush reads the brush segments via the
NormalBorderScratch allocated here. The segment list is built
against the prim’s per-instance size, with the two arenas
(scratch.frame.segments and scratch.frame.border_segments)
receiving direct pushes through data_mut to avoid intermediate
Vec allocations.
Trait Implementations§
Source§impl Clone for NormalBorderScratch
impl Clone for NormalBorderScratch
Source§fn clone(&self) -> NormalBorderScratch
fn clone(&self) -> NormalBorderScratch
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for NormalBorderScratch
impl Debug for NormalBorderScratch
Source§impl Serialize for NormalBorderScratch
impl Serialize for NormalBorderScratch
impl Copy for NormalBorderScratch
Auto Trait Implementations§
impl Freeze for NormalBorderScratch
impl RefUnwindSafe for NormalBorderScratch
impl Send for NormalBorderScratch
impl Sync for NormalBorderScratch
impl Unpin for NormalBorderScratch
impl UnsafeUnpin for NormalBorderScratch
impl UnwindSafe for NormalBorderScratch
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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