iced/wgpu/src/texture/atlas/entry.rs
Héctor Ramón Jiménez 59d45a5440 Refactor texture atlas
- Split into multiple modules
- Rename some concepts
- Change API details
2020-02-26 12:34:34 +01:00

25 lines
503 B
Rust

use crate::texture::atlas;
#[derive(Debug)]
pub enum Entry {
Contiguous(atlas::Allocation),
Fragmented {
size: (u32, u32),
fragments: Vec<Fragment>,
},
}
impl Entry {
pub fn size(&self) -> (u32, u32) {
match self {
Entry::Contiguous(allocation) => allocation.size(),
Entry::Fragmented { size, .. } => *size,
}
}
}
#[derive(Debug)]
pub struct Fragment {
pub position: (u32, u32),
pub allocation: atlas::Allocation,
}