pub struct Tile {Show 20 fields
pub tile_offset: TileOffset,
pub world_tile_rect: WorldRect,
pub local_tile_rect: PictureRect,
pub local_dirty_rect: PictureRect,
pub device_dirty_rect: DeviceRect,
pub world_valid_rect: WorldRect,
pub device_valid_rect: DeviceRect,
pub current_descriptor: TileDescriptor,
pub prev_descriptor: TileDescriptor,
pub surface: Option<TileSurface>,
pub is_valid: bool,
pub is_visible: bool,
pub id: TileId,
pub is_opaque: bool,
root: TileNode,
background_color: Option<ColorF>,
invalidation_reason: Option<InvalidationReason>,
pub local_valid_rect: PictureBox2D,
pub z_id: ZBufferId,
pub sub_graphs: Vec<(PictureRect, Vec<(PictureCompositeMode, SurfaceIndex)>)>,
}
Expand description
Information about a cached tile.
Fields§
§tile_offset: TileOffset
The grid position of this tile within the picture cache
world_tile_rect: WorldRect
The current world rect of this tile.
local_tile_rect: PictureRect
The current local rect of this tile.
local_dirty_rect: PictureRect
The picture space dirty rect for this tile.
device_dirty_rect: DeviceRect
The device space dirty rect for this tile. TODO(gw): We have multiple dirty rects available due to the quadtree above. In future, expose these as multiple dirty rects, which will help in some cases.
world_valid_rect: WorldRect
World space rect that contains valid pixels region of this tile.
device_valid_rect: DeviceRect
Device space rect that contains valid pixels region of this tile.
current_descriptor: TileDescriptor
Uniquely describes the content of this tile, in a way that can be (reasonably) efficiently hashed and compared.
prev_descriptor: TileDescriptor
The content descriptor for this tile from the previous frame.
surface: Option<TileSurface>
Handle to the backing surface for this tile.
is_valid: bool
If true, this tile is marked valid, and the existing texture cache handle can be used. Tiles are invalidated during the build_dirty_regions method.
is_visible: bool
If true, this tile intersects with the currently visible screen rect, and will be drawn.
id: TileId
The tile id is stable between display lists and / or frames, if the tile is retained. Useful for debugging tile evictions.
is_opaque: bool
If true, the tile was determined to be opaque, which means blending can be disabled when drawing it.
root: TileNode
Root node of the quadtree dirty rect tracker.
background_color: Option<ColorF>
The last rendered background color on this tile.
invalidation_reason: Option<InvalidationReason>
The first reason the tile was invalidated this frame.
local_valid_rect: PictureBox2D
The local space valid rect for all primitives that affect this tile.
z_id: ZBufferId
z-buffer id for this tile
sub_graphs: Vec<(PictureRect, Vec<(PictureCompositeMode, SurfaceIndex)>)>
Implementations§
source§impl Tile
impl Tile
sourcefn new(tile_offset: TileOffset) -> Self
fn new(tile_offset: TileOffset) -> Self
Construct a new, invalid tile.
sourcefn print(&self, pt: &mut dyn PrintTreePrinter)
fn print(&self, pt: &mut dyn PrintTreePrinter)
Print debug information about this tile to a tree printer.
sourcefn update_dirty_rects(
&mut self,
ctx: &TileUpdateDirtyContext<'_>,
state: &mut TileUpdateDirtyState<'_>,
invalidation_reason: &mut Option<InvalidationReason>,
frame_context: &FrameVisibilityContext<'_>,
) -> PictureRect
fn update_dirty_rects( &mut self, ctx: &TileUpdateDirtyContext<'_>, state: &mut TileUpdateDirtyState<'_>, invalidation_reason: &mut Option<InvalidationReason>, frame_context: &FrameVisibilityContext<'_>, ) -> PictureRect
Check if the content of the previous and current tile descriptors match
sourcefn update_content_validity(
&mut self,
ctx: &TileUpdateDirtyContext<'_>,
state: &mut TileUpdateDirtyState<'_>,
frame_context: &FrameVisibilityContext<'_>,
)
fn update_content_validity( &mut self, ctx: &TileUpdateDirtyContext<'_>, state: &mut TileUpdateDirtyState<'_>, frame_context: &FrameVisibilityContext<'_>, )
Invalidate a tile based on change in content. This must be called even if the tile is not currently visible on screen. We might be able to improve this later by changing how ComparableVec is used.
sourcefn invalidate(
&mut self,
invalidation_rect: Option<PictureRect>,
reason: InvalidationReason,
)
fn invalidate( &mut self, invalidation_rect: Option<PictureRect>, reason: InvalidationReason, )
Invalidate this tile. If invalidation_rect
is None, the entire
tile is invalidated.
sourcefn pre_update(&mut self, ctx: &TilePreUpdateContext)
fn pre_update(&mut self, ctx: &TilePreUpdateContext)
Called during pre_update of a tile cache instance. Allows the tile to setup state before primitive dependency calculations.
sourcefn add_prim_dependency(&mut self, info: &PrimitiveDependencyInfo)
fn add_prim_dependency(&mut self, info: &PrimitiveDependencyInfo)
Add dependencies for a given primitive to this tile.
sourcefn update_dirty_and_valid_rects(
&mut self,
ctx: &TileUpdateDirtyContext<'_>,
state: &mut TileUpdateDirtyState<'_>,
frame_context: &FrameVisibilityContext<'_>,
)
fn update_dirty_and_valid_rects( &mut self, ctx: &TileUpdateDirtyContext<'_>, state: &mut TileUpdateDirtyState<'_>, frame_context: &FrameVisibilityContext<'_>, )
Called during tile cache instance post_update. Allows invalidation and dirty rect calculation after primitive dependencies have been updated.
sourcefn post_update(
&mut self,
ctx: &TilePostUpdateContext<'_>,
state: &mut TilePostUpdateState<'_>,
frame_context: &FrameVisibilityContext<'_>,
)
fn post_update( &mut self, ctx: &TilePostUpdateContext<'_>, state: &mut TilePostUpdateState<'_>, frame_context: &FrameVisibilityContext<'_>, )
Called during tile cache instance post_update. Allows invalidation and dirty rect calculation after primitive dependencies have been updated.
Auto Trait Implementations§
impl Freeze for Tile
impl RefUnwindSafe for Tile
impl Send for Tile
impl Sync for Tile
impl Unpin for Tile
impl UnwindSafe for Tile
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