pub struct Tile {
pub tile_offset: TileOffset,
pub world_tile_rect: WorldRect,
pub device_dirty_rect: DeviceRect,
pub world_valid_rect: WorldRect,
pub device_valid_rect: DeviceRect,
pub surface: Option<TileSurface>,
pub is_visible: bool,
pub id: TileId,
pub is_opaque: bool,
pub z_id: ZBufferId,
pub cached_surface: CachedSurface,
pub local_raster_rect: RasterRect,
}Expand description
Information about a cached tile.
Fields§
§tile_offset: TileOffsetThe grid position of this tile within the picture cache
world_tile_rect: WorldRectThe current world rect of this tile.
device_dirty_rect: DeviceRectThe 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: WorldRectWorld space rect that contains valid pixels region of this tile.
device_valid_rect: DeviceRectDevice space rect that contains valid pixels region of this tile.
surface: Option<TileSurface>Handle to the backing surface for this tile.
is_visible: boolIf true, this tile intersects with the currently visible screen rect, and will be drawn.
id: TileIdThe tile id is stable between display lists and / or frames, if the tile is retained. Useful for debugging tile evictions.
is_opaque: boolIf true, the tile was determined to be opaque, which means blending can be disabled when drawing it.
z_id: ZBufferIdz-buffer id for this tile
cached_surface: CachedSurfaceCached surface state (content tracking, invalidation, dependencies)
local_raster_rect: RasterRectRaster-space rect for this tile, cached to avoid recomputing per primitive.
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_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.
Sourcepub fn invalidate(
&mut self,
invalidation_rect: Option<PictureRect>,
reason: InvalidationReason,
)
pub 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,
corners_cache: &CornersCache,
prim_clamp_to_tile: bool,
)
fn add_prim_dependency( &mut self, info: &PrimitiveDependencyInfo, corners_cache: &CornersCache, prim_clamp_to_tile: bool, )
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 UnsafeUnpin 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