Struct webrender::picture_textures::PictureTextures
source · pub struct PictureTextures {
textures: Vec<PictureTexture>,
default_tile_size: DeviceIntSize,
allocated_texture_count: usize,
filter: TextureFilter,
debug_flags: DebugFlags,
cache_entries: FreeList<PictureCacheEntry, PictureCacheEntryMarker>,
cache_handles: Vec<FreeListHandle<PictureCacheEntryMarker>>,
now: FrameStamp,
}
Expand description
The textures used to hold picture cache tiles.
Fields§
§textures: Vec<PictureTexture>
Current list of textures in the pool
default_tile_size: DeviceIntSize
Default tile size for content tiles
allocated_texture_count: usize
Number of currently allocated textures in the pool
filter: TextureFilter
Texture filter to use for picture cache textures
debug_flags: DebugFlags
§cache_entries: FreeList<PictureCacheEntry, PictureCacheEntryMarker>
Cache of picture cache entries.
cache_handles: Vec<FreeListHandle<PictureCacheEntryMarker>>
Strong handles for the picture_cache_entries FreeList.
now: FrameStamp
Implementations§
source§impl PictureTextures
impl PictureTextures
pub fn new(default_tile_size: DeviceIntSize, filter: TextureFilter) -> Self
pub fn begin_frame( &mut self, stamp: FrameStamp, pending_updates: &mut TextureUpdateList, )
pub fn default_tile_size(&self) -> DeviceIntSize
pub fn update( &mut self, tile_size: DeviceIntSize, handle: &mut Option<WeakFreeListHandle<PictureCacheEntryMarker>>, gpu_cache: &mut GpuCache, next_texture_id: &mut CacheTextureId, pending_updates: &mut TextureUpdateList, )
pub fn get_or_allocate_tile( &mut self, tile_size: DeviceIntSize, next_texture_id: &mut CacheTextureId, pending_updates: &mut TextureUpdateList, ) -> WeakFreeListHandle<PictureCacheEntryMarker>
pub fn free_tile( &mut self, id: CacheTextureId, current_frame_id: FrameId, pending_updates: &mut TextureUpdateList, )
pub fn request( &mut self, handle: &WeakFreeListHandle<PictureCacheEntryMarker>, gpu_cache: &mut GpuCache, ) -> bool
pub fn get_texture_source( &self, handle: &WeakFreeListHandle<PictureCacheEntryMarker>, ) -> TextureSource
sourcepub fn expire_old_tiles(&mut self, pending_updates: &mut TextureUpdateList)
pub fn expire_old_tiles(&mut self, pending_updates: &mut TextureUpdateList)
Expire picture cache tiles that haven’t been referenced in the last frame.
The picture cache code manually keeps tiles alive by calling request
on
them if it wants to retain a tile that is currently not visible.
pub fn clear(&mut self, pending_updates: &mut TextureUpdateList)
pub fn update_profile(&self, profile: &mut TransactionProfile)
sourcepub fn gc(&mut self, pending_updates: &mut TextureUpdateList)
pub fn gc(&mut self, pending_updates: &mut TextureUpdateList)
Simple garbage collect of picture cache tiles
pub fn entry_exists( &self, handle: &WeakFreeListHandle<PictureCacheEntryMarker>, ) -> bool
pub fn set_debug_flags(&mut self, flags: DebugFlags)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PictureTextures
impl RefUnwindSafe for PictureTextures
impl Send for PictureTextures
impl Sync for PictureTextures
impl Unpin for PictureTextures
impl UnwindSafe for PictureTextures
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> 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