Move image/svg handling into iced_graphics
The `TextureStore` trait is implemented by the atlas, and can also be implemented in the glow renderer or in a software renderer. The API here may be improved in the future, but API stability is presumably not a huge issue since these types will only be used by renderer backends.
This commit is contained in:
parent
7b12991728
commit
2c7c42ee93
10 changed files with 281 additions and 191 deletions
|
|
@ -1,4 +1,5 @@
|
|||
use crate::image::atlas;
|
||||
use iced_graphics::image::TextureStoreEntry;
|
||||
|
||||
#[derive(Debug)]
|
||||
pub enum Entry {
|
||||
|
|
@ -9,9 +10,8 @@ pub enum Entry {
|
|||
},
|
||||
}
|
||||
|
||||
impl Entry {
|
||||
#[cfg(feature = "image_rs")]
|
||||
pub fn size(&self) -> (u32, u32) {
|
||||
impl TextureStoreEntry for Entry {
|
||||
fn size(&self) -> (u32, u32) {
|
||||
match self {
|
||||
Entry::Contiguous(allocation) => allocation.size(),
|
||||
Entry::Fragmented { size, .. } => *size,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue