diff options
author | 2020-06-05 21:18:22 +0300 | |
---|---|---|
committer | 2021-02-13 15:53:24 +0100 | |
commit | 8f126c212b887b2621cd8220bc4a52ba4febb1eb (patch) | |
tree | 5ec5abca6b01139e6679ede53ec5432af0eb01a9 /wgpu/src/backend.rs | |
parent | 9f5c2eb0c43daa61b19769322cf3692b29e0ac0f (diff) | |
download | iced-8f126c212b887b2621cd8220bc4a52ba4febb1eb.tar.gz iced-8f126c212b887b2621cd8220bc4a52ba4febb1eb.tar.bz2 iced-8f126c212b887b2621cd8220bc4a52ba4febb1eb.zip |
Add image format options to reduce code bloat, fixes #376
Diffstat (limited to 'wgpu/src/backend.rs')
-rw-r--r-- | wgpu/src/backend.rs | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/wgpu/src/backend.rs b/wgpu/src/backend.rs index fccb5ac7..534c6cb7 100644 --- a/wgpu/src/backend.rs +++ b/wgpu/src/backend.rs @@ -9,7 +9,7 @@ use iced_graphics::{Primitive, Viewport}; use iced_native::mouse; use iced_native::{Font, HorizontalAlignment, Size, VerticalAlignment}; -#[cfg(any(feature = "image", feature = "svg"))] +#[cfg(any(feature = "image_rs", feature = "svg"))] use crate::image; /// A [`wgpu`] graphics backend for [`iced`]. @@ -22,7 +22,7 @@ pub struct Backend { text_pipeline: text::Pipeline, triangle_pipeline: triangle::Pipeline, - #[cfg(any(feature = "image", feature = "svg"))] + #[cfg(any(feature = "image_rs", feature = "svg"))] image_pipeline: image::Pipeline, default_text_size: u16, @@ -40,7 +40,7 @@ impl Backend { settings.antialiasing, ); - #[cfg(any(feature = "image", feature = "svg"))] + #[cfg(any(feature = "image_rs", feature = "svg"))] let image_pipeline = image::Pipeline::new(device, settings.format); Self { @@ -48,7 +48,7 @@ impl Backend { text_pipeline, triangle_pipeline, - #[cfg(any(feature = "image", feature = "svg"))] + #[cfg(any(feature = "image_rs", feature = "svg"))] image_pipeline, default_text_size: settings.default_text_size, @@ -92,7 +92,7 @@ impl Backend { ); } - #[cfg(any(feature = "image", feature = "svg"))] + #[cfg(any(feature = "image_rs", feature = "svg"))] self.image_pipeline.trim_cache(); *mouse_interaction @@ -142,7 +142,7 @@ impl Backend { ); } - #[cfg(any(feature = "image", feature = "svg"))] + #[cfg(any(feature = "image_rs", feature = "svg"))] { if !layer.images.is_empty() { let scaled = transformation @@ -270,7 +270,7 @@ impl backend::Text for Backend { } } -#[cfg(feature = "image")] +#[cfg(feature = "image_rs")] impl backend::Image for Backend { fn dimensions(&self, handle: &iced_native::image::Handle) -> (u32, u32) { self.image_pipeline.dimensions(handle) |