Remove redundant features in iced_wgpu and iced_glow
This commit is contained in:
parent
d3b613df44
commit
0a23f518c7
8 changed files with 35 additions and 37 deletions
|
|
@ -10,7 +10,7 @@ use iced_graphics::{Primitive, Viewport};
|
|||
use iced_native::alignment;
|
||||
use iced_native::{Font, Size};
|
||||
|
||||
#[cfg(any(feature = "image_rs", feature = "svg"))]
|
||||
#[cfg(any(feature = "image", feature = "svg"))]
|
||||
use crate::image;
|
||||
|
||||
/// A [`wgpu`] graphics backend for [`iced`].
|
||||
|
|
@ -23,7 +23,7 @@ pub struct Backend {
|
|||
text_pipeline: text::Pipeline,
|
||||
triangle_pipeline: triangle::Pipeline,
|
||||
|
||||
#[cfg(any(feature = "image_rs", feature = "svg"))]
|
||||
#[cfg(any(feature = "image", feature = "svg"))]
|
||||
image_pipeline: image::Pipeline,
|
||||
|
||||
default_text_size: u16,
|
||||
|
|
@ -47,7 +47,7 @@ impl Backend {
|
|||
let triangle_pipeline =
|
||||
triangle::Pipeline::new(device, format, settings.antialiasing);
|
||||
|
||||
#[cfg(any(feature = "image_rs", feature = "svg"))]
|
||||
#[cfg(any(feature = "image", feature = "svg"))]
|
||||
let image_pipeline = image::Pipeline::new(device, format);
|
||||
|
||||
Self {
|
||||
|
|
@ -55,7 +55,7 @@ impl Backend {
|
|||
text_pipeline,
|
||||
triangle_pipeline,
|
||||
|
||||
#[cfg(any(feature = "image_rs", feature = "svg"))]
|
||||
#[cfg(any(feature = "image", feature = "svg"))]
|
||||
image_pipeline,
|
||||
|
||||
default_text_size: settings.default_text_size,
|
||||
|
|
@ -98,7 +98,7 @@ impl Backend {
|
|||
);
|
||||
}
|
||||
|
||||
#[cfg(any(feature = "image_rs", feature = "svg"))]
|
||||
#[cfg(any(feature = "image", feature = "svg"))]
|
||||
self.image_pipeline.trim_cache(device, encoder);
|
||||
}
|
||||
|
||||
|
|
@ -148,7 +148,7 @@ impl Backend {
|
|||
);
|
||||
}
|
||||
|
||||
#[cfg(any(feature = "image_rs", feature = "svg"))]
|
||||
#[cfg(any(feature = "image", feature = "svg"))]
|
||||
{
|
||||
if !layer.images.is_empty() {
|
||||
let scaled = transformation
|
||||
|
|
@ -294,7 +294,7 @@ impl backend::Text for Backend {
|
|||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "image_rs")]
|
||||
#[cfg(feature = "image")]
|
||||
impl backend::Image for Backend {
|
||||
fn dimensions(&self, handle: &iced_native::image::Handle) -> Size<u32> {
|
||||
self.image_pipeline.dimensions(handle)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue