Trait webrender::texture_pack::AtlasAllocator
source · pub trait AtlasAllocator {
type Parameters;
// Required methods
fn new(size: i32, parameters: &Self::Parameters) -> Self;
fn allocate(
&mut self,
size: DeviceIntSize,
) -> Option<(AllocId, DeviceIntRect)>;
fn deallocate(&mut self, id: AllocId);
fn is_empty(&self) -> bool;
fn allocated_space(&self) -> i32;
fn dump_into_svg(
&self,
rect: &Box2D<f32>,
output: &mut dyn Write,
) -> Result<()>;
}
Required Associated Types§
sourcetype Parameters
type Parameters
Specific parameters of the allocator.
Required Methods§
sourcefn new(size: i32, parameters: &Self::Parameters) -> Self
fn new(size: i32, parameters: &Self::Parameters) -> Self
Constructor
sourcefn allocate(&mut self, size: DeviceIntSize) -> Option<(AllocId, DeviceIntRect)>
fn allocate(&mut self, size: DeviceIntSize) -> Option<(AllocId, DeviceIntRect)>
Allocate a rectangle.
sourcefn deallocate(&mut self, id: AllocId)
fn deallocate(&mut self, id: AllocId)
Deallocate a rectangle and return its size.
sourcefn allocated_space(&self) -> i32
fn allocated_space(&self) -> i32
Allocated area in pixels.
Object Safety§
This trait is not object safe.