From 2c7c42ee93a61f39562590f6a75eb2dd8b220fb8 Mon Sep 17 00:00:00 2001 From: Ian Douglas Scott Date: Mon, 31 Oct 2022 13:37:56 -0700 Subject: 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. --- wgpu/src/image/atlas/entry.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'wgpu/src/image/atlas') 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, -- cgit