pub struct TileNode {
pub kind: TileNodeKind,
pub rect: PictureBox2D,
}Expand description
A node in the dirty rect tracking quadtree.
Fields§
§kind: TileNodeKindLeaf or internal node
rect: PictureBox2DRect of this node in the same space as the tile cache picture
Implementations§
Source§impl TileNode
impl TileNode
Sourcepub fn new_leaf(curr_indices: Vec<PrimitiveDependencyIndex>) -> Self
pub fn new_leaf(curr_indices: Vec<PrimitiveDependencyIndex>) -> Self
Construct a new leaf node, with the given primitive dependency index buffer
Sourcepub fn draw_debug_rects(
&self,
pic_to_world_mapper: &SpaceMapper<PicturePixel, WorldPixel>,
is_opaque: bool,
local_valid_rect: PictureRect,
scratch: &mut PrimitiveScratchBuffer,
global_device_pixel_scale: DevicePixelScale,
)
pub fn draw_debug_rects( &self, pic_to_world_mapper: &SpaceMapper<PicturePixel, WorldPixel>, is_opaque: bool, local_valid_rect: PictureRect, scratch: &mut PrimitiveScratchBuffer, global_device_pixel_scale: DevicePixelScale, )
Draw debug information about this tile node
Sourcefn get_child_rects(rect: &PictureBox2D, result: &mut [PictureBox2D; 4])
fn get_child_rects(rect: &PictureBox2D, result: &mut [PictureBox2D; 4])
Calculate the four child rects for a given node
Sourcepub fn clear(&mut self, rect: PictureBox2D)
pub fn clear(&mut self, rect: PictureBox2D)
Called during pre_update, to clear the current dependencies
Sourcepub fn add_prim(
&mut self,
index: PrimitiveDependencyIndex,
prim_rect: &PictureBox2D,
)
pub fn add_prim( &mut self, index: PrimitiveDependencyIndex, prim_rect: &PictureBox2D, )
Add a primitive dependency to this node
Sourcepub fn maybe_merge_or_split(
&mut self,
level: i32,
curr_prims: &[PrimitiveDescriptor],
max_split_levels: i32,
)
pub fn maybe_merge_or_split( &mut self, level: i32, curr_prims: &[PrimitiveDescriptor], max_split_levels: i32, )
Apply a merge or split operation to this tile, if desired
Sourcepub fn update_dirty_rects(
&mut self,
prev_prims: &[PrimitiveDescriptor],
curr_prims: &[PrimitiveDescriptor],
prim_comparer: &mut PrimitiveComparer<'_>,
dirty_rect: &mut PictureBox2D,
compare_cache: &mut FastHashMap<PrimitiveComparisonKey, PrimitiveCompareResult>,
invalidation_reason: &mut Option<InvalidationReason>,
frame_context: &FrameVisibilityContext<'_>,
)
pub fn update_dirty_rects( &mut self, prev_prims: &[PrimitiveDescriptor], curr_prims: &[PrimitiveDescriptor], prim_comparer: &mut PrimitiveComparer<'_>, dirty_rect: &mut PictureBox2D, compare_cache: &mut FastHashMap<PrimitiveComparisonKey, PrimitiveCompareResult>, invalidation_reason: &mut Option<InvalidationReason>, frame_context: &FrameVisibilityContext<'_>, )
Update the dirty state of this node, building the overall dirty rect
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TileNode
impl RefUnwindSafe for TileNode
impl Send for TileNode
impl Sync for TileNode
impl Unpin for TileNode
impl UnsafeUnpin for TileNode
impl UnwindSafe for TileNode
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
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>
Converts
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>
Converts
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