Skip to main content

Tile

Struct Tile 

Source
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: TileOffset

The grid position of this tile within the picture cache

§world_tile_rect: WorldRect

The current world rect of 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.

§surface: Option<TileSurface>

Handle to the backing surface for this tile.

§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.

§z_id: ZBufferId

z-buffer id for this tile

§cached_surface: CachedSurface

Cached surface state (content tracking, invalidation, dependencies)

§local_raster_rect: RasterRect

Raster-space rect for this tile, cached to avoid recomputing per primitive.

Implementations§

Source§

impl Tile

Source

fn new(tile_offset: TileOffset) -> Self

Construct a new, invalid tile.

Source

fn print(&self, pt: &mut dyn PrintTreePrinter)

Print debug information about this tile to a tree printer.

Source

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.

Source

pub fn invalidate( &mut self, invalidation_rect: Option<PictureRect>, reason: InvalidationReason, )

Invalidate this tile. If invalidation_rect is None, the entire tile is invalidated.

Source

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.

Source

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.

Source

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.

Source

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<'a, T> Deserialize<'a> for T