Struct webrender::texture_cache::SharedTextures
source · struct SharedTextures {
color8_nearest: AllocatorList<ShelfAllocator, TextureParameters>,
alpha8_linear: AllocatorList<ShelfAllocator, TextureParameters>,
alpha8_glyphs: AllocatorList<ShelfAllocator, TextureParameters>,
alpha16_linear: AllocatorList<ShelfAllocator, TextureParameters>,
color8_linear: AllocatorList<ShelfAllocator, TextureParameters>,
color8_glyphs: AllocatorList<ShelfAllocator, TextureParameters>,
bytes_per_texture_of_type: [i32; 7],
next_compaction_idx: usize,
}
Expand description
A set of lazily allocated, fixed size, texture arrays for each format the texture cache supports.
Fields§
§color8_nearest: AllocatorList<ShelfAllocator, TextureParameters>
§alpha8_linear: AllocatorList<ShelfAllocator, TextureParameters>
§alpha8_glyphs: AllocatorList<ShelfAllocator, TextureParameters>
§alpha16_linear: AllocatorList<ShelfAllocator, TextureParameters>
§color8_linear: AllocatorList<ShelfAllocator, TextureParameters>
§color8_glyphs: AllocatorList<ShelfAllocator, TextureParameters>
§bytes_per_texture_of_type: [i32; 7]
§next_compaction_idx: usize
Implementations§
sourcefn new(
color_formats: TextureFormatPair<ImageFormat>,
config: &TextureCacheConfig,
) -> Self
fn new( color_formats: TextureFormatPair<ImageFormat>, config: &TextureCacheConfig, ) -> Self
Mints a new set of shared textures.
sourcefn clear(&mut self, updates: &mut TextureUpdateList)
fn clear(&mut self, updates: &mut TextureUpdateList)
Clears each texture in the set, with the given set of pending updates.
sourcefn select(
&mut self,
external_format: ImageFormat,
filter: TextureFilter,
shader: TargetShader,
) -> (&mut dyn AtlasAllocatorList<TextureParameters>, BudgetType)
fn select( &mut self, external_format: ImageFormat, filter: TextureFilter, shader: TargetShader, ) -> (&mut dyn AtlasAllocatorList<TextureParameters>, BudgetType)
Returns a mutable borrow for the shared texture array matching the parameters.
How many bytes a single texture of the given type takes up, for the configured texture sizes.
fn has_multiple_textures(&self, budget_type: BudgetType) -> bool
Trait Implementations§
Auto Trait Implementations§
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