Struct webrender::internal_types::TextureUpdateList

source ·
pub struct TextureUpdateList {
    pub clears_shared_cache: bool,
    pub allocations: Vec<TextureCacheAllocation>,
    pub updates: FastHashMap<CacheTextureId, Vec<TextureCacheUpdate>>,
    pub copies: FastHashMap<(CacheTextureId, CacheTextureId), Vec<TextureCacheCopy>>,
}
Expand description

Atomic set of commands to manipulate the texture cache, generated on the RenderBackend thread and executed on the Renderer thread.

The list of allocation operations is processed before the updates. This is important to allow coalescing of certain allocation operations.

Fields§

§clears_shared_cache: bool

Indicates that there was some kind of cleanup clear operation. Used for sanity checks.

§allocations: Vec<TextureCacheAllocation>

Commands to alloc/realloc/free the textures. Processed first.

§updates: FastHashMap<CacheTextureId, Vec<TextureCacheUpdate>>

Commands to update the contents of the textures. Processed second.

§copies: FastHashMap<(CacheTextureId, CacheTextureId), Vec<TextureCacheCopy>>

Commands to move items within the cache, these are applied before everything else in the update list.

Implementations§

source§

impl TextureUpdateList

source

pub fn new() -> Self

Mints a new TextureUpdateList.

source

pub fn is_nop(&self) -> bool

Returns true if this is a no-op (no updates to be applied).

source

pub fn note_clear(&mut self)

Sets the clears_shared_cache flag for renderer-side sanity checks.

source

pub fn push_update(&mut self, id: CacheTextureId, update: TextureCacheUpdate)

Pushes an update operation onto the list.

source

pub fn push_debug_clear( &mut self, id: CacheTextureId, origin: DeviceIntPoint, width: i32, height: i32, )

Sends a command to the Renderer to clear the portion of the shared region we just freed. Used when the texture cache debugger is enabled.

source

pub fn push_alloc(&mut self, id: CacheTextureId, info: TextureCacheAllocInfo)

Pushes an allocation operation onto the list.

source

pub fn push_reset(&mut self, id: CacheTextureId, info: TextureCacheAllocInfo)

Pushes a reallocation operation onto the list, potentially coalescing with previous operations.

source

pub fn push_free(&mut self, id: CacheTextureId)

Pushes a free operation onto the list, potentially coalescing with previous operations.

source

pub fn push_copy( &mut self, src_id: CacheTextureId, src_rect: &DeviceIntRect, dst_id: CacheTextureId, dst_rect: &DeviceIntRect, )

Push a copy operation from a texture to another.

The source and destination rectangles must have the same size. The copies are applied before every other operations in the texture update list.

source

fn debug_assert_coalesced(&self, id: CacheTextureId)

Trait Implementations§

source§

impl Default for TextureUpdateList

source§

fn default() -> TextureUpdateList

Returns the “default value” for a type. Read more

Auto Trait Implementations§

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

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>,

§

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>,

§

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.