Trait webrender::texture_pack::AtlasAllocatorList
source · pub trait AtlasAllocatorList<TextureParameters> {
// Required methods
fn allocate(
&mut self,
size: DeviceIntSize,
texture_alloc_cb: &mut dyn FnMut(DeviceIntSize, &TextureParameters) -> CacheTextureId,
) -> (CacheTextureId, AllocId, DeviceIntRect);
fn set_handle(
&mut self,
texture_id: CacheTextureId,
alloc_id: AllocId,
handle: &TextureCacheHandle,
);
fn deallocate(&mut self, texture_id: CacheTextureId, alloc_id: AllocId);
fn texture_parameters(&self) -> &TextureParameters;
}
Required Methods§
sourcefn allocate(
&mut self,
size: DeviceIntSize,
texture_alloc_cb: &mut dyn FnMut(DeviceIntSize, &TextureParameters) -> CacheTextureId,
) -> (CacheTextureId, AllocId, DeviceIntRect)
fn allocate( &mut self, size: DeviceIntSize, texture_alloc_cb: &mut dyn FnMut(DeviceIntSize, &TextureParameters) -> CacheTextureId, ) -> (CacheTextureId, AllocId, DeviceIntRect)
Allocate a rectangle.
If allocation fails, call the provided callback, add a new allocator to the list and try again.
fn set_handle( &mut self, texture_id: CacheTextureId, alloc_id: AllocId, handle: &TextureCacheHandle, )
sourcefn deallocate(&mut self, texture_id: CacheTextureId, alloc_id: AllocId)
fn deallocate(&mut self, texture_id: CacheTextureId, alloc_id: AllocId)
Deallocate a rectangle and return its size.