pub struct GlTextureCache {
pub solved_textures: BTreeMap<DomId, BTreeMap<NodeId, (ImageKey, ImageDescriptor, ExternalImageId)>>,
pub hashes: BTreeMap<(DomId, NodeId, ImageRefHash), ImageRefHash>,
}Fields§
§solved_textures: BTreeMap<DomId, BTreeMap<NodeId, (ImageKey, ImageDescriptor, ExternalImageId)>>§hashes: BTreeMap<(DomId, NodeId, ImageRefHash), ImageRefHash>Implementations§
Source§impl GlTextureCache
impl GlTextureCache
Sourcepub fn update_texture(
&mut self,
dom_id: DomId,
node_id: NodeId,
document_id: DocumentId,
epoch: Epoch,
new_texture: Texture,
insert_into_active_gl_textures_fn: &GlStoreImageFn,
) -> Option<ExternalImageId>
pub fn update_texture( &mut self, dom_id: DomId, node_id: NodeId, document_id: DocumentId, epoch: Epoch, new_texture: Texture, insert_into_active_gl_textures_fn: &GlStoreImageFn, ) -> Option<ExternalImageId>
Updates a given texture
This is called when a texture needs to be re-rendered (e.g., on resize or animation frame). It updates the texture in the WebRender external image cache and updates the internal descriptor to reflect the new size.
§Arguments
dom_id- The DOM ID containing the texturenode_id- The node ID of the image elementdocument_id- The WebRender document IDepoch- The current frame epochnew_texture- The new texture to useinsert_into_active_gl_textures_fn- Function to insert the texture into the cache
§Returns
The ExternalImageId if successful, None if the texture wasn’t found in the cache
Trait Implementations§
Source§impl Debug for GlTextureCache
impl Debug for GlTextureCache
Source§impl Default for GlTextureCache
impl Default for GlTextureCache
Source§fn default() -> GlTextureCache
fn default() -> GlTextureCache
Returns the “default value” for a type. Read more
impl Send for GlTextureCache
Auto Trait Implementations§
impl Freeze for GlTextureCache
impl RefUnwindSafe for GlTextureCache
impl Sync for GlTextureCache
impl Unpin for GlTextureCache
impl UnwindSafe for GlTextureCache
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