diff options
author | 2022-10-31 13:37:56 -0700 | |
---|---|---|
committer | 2022-11-05 03:19:37 +0100 | |
commit | 2c7c42ee93a61f39562590f6a75eb2dd8b220fb8 (patch) | |
tree | 83279bcbd9ef0ca5ea8c8b763d38259555640216 /wgpu/src/image/atlas | |
parent | 7b129917281baaa6688158c303922f94341ab69f (diff) | |
download | iced-2c7c42ee93a61f39562590f6a75eb2dd8b220fb8.tar.gz iced-2c7c42ee93a61f39562590f6a75eb2dd8b220fb8.tar.bz2 iced-2c7c42ee93a61f39562590f6a75eb2dd8b220fb8.zip |
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.
Diffstat (limited to 'wgpu/src/image/atlas')
-rw-r--r-- | wgpu/src/image/atlas/entry.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/wgpu/src/image/atlas/entry.rs b/wgpu/src/image/atlas/entry.rs index 9b3f16df..0c2f67fc 100644 --- a/wgpu/src/image/atlas/entry.rs +++ b/wgpu/src/image/atlas/entry.rs @@ -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, |