summaryrefslogtreecommitdiffstats
path: root/renderer
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2024-08-04 04:30:12 +0200
committerLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2024-08-04 04:30:12 +0200
commit92bd3ecd6b4a6618f0fc725dea3694c3b40e5314 (patch)
tree8040fe0f758eb41cbf587119c5d972f5ebaa8567 /renderer
parent974ae6d1e7cd9df6967762a6d308106f4fe03edc (diff)
downloadiced-92bd3ecd6b4a6618f0fc725dea3694c3b40e5314.tar.gz
iced-92bd3ecd6b4a6618f0fc725dea3694c3b40e5314.tar.bz2
iced-92bd3ecd6b4a6618f0fc725dea3694c3b40e5314.zip
Introduce `Image` struct in `core::image`
Diffstat (limited to 'renderer')
-rw-r--r--renderer/src/fallback.rs48
1 files changed, 7 insertions, 41 deletions
diff --git a/renderer/src/fallback.rs b/renderer/src/fallback.rs
index 73e91dc6..dc8a4107 100644
--- a/renderer/src/fallback.rs
+++ b/renderer/src/fallback.rs
@@ -3,7 +3,8 @@ use crate::core::image;
use crate::core::renderer;
use crate::core::svg;
use crate::core::{
- self, Background, Color, Point, Radians, Rectangle, Size, Transformation,
+ self, Background, Color, Image, Point, Radians, Rectangle, Size,
+ Transformation,
};
use crate::graphics;
use crate::graphics::compositor;
@@ -149,25 +150,8 @@ where
delegate!(self, renderer, renderer.measure_image(handle))
}
- fn draw_image(
- &mut self,
- handle: Self::Handle,
- filter_method: image::FilterMethod,
- bounds: Rectangle,
- rotation: Radians,
- opacity: f32,
- ) {
- delegate!(
- self,
- renderer,
- renderer.draw_image(
- handle,
- filter_method,
- bounds,
- rotation,
- opacity
- )
- );
+ fn draw_image(&mut self, image: Image<A::Handle>, bounds: Rectangle) {
+ delegate!(self, renderer, renderer.draw_image(image, bounds));
}
}
@@ -441,11 +425,10 @@ where
#[cfg(feature = "geometry")]
mod geometry {
use super::Renderer;
- use crate::core::image;
use crate::core::svg;
use crate::core::{Color, Point, Radians, Rectangle, Size, Vector};
use crate::graphics::cache::{self, Cached};
- use crate::graphics::geometry::{self, Fill, Path, Stroke, Text};
+ use crate::graphics::geometry::{self, Fill, Image, Path, Stroke, Text};
impl<A, B> geometry::Renderer for Renderer<A, B>
where
@@ -574,25 +557,8 @@ mod geometry {
delegate!(self, frame, frame.fill_text(text));
}
- fn draw_image(
- &mut self,
- handle: &image::Handle,
- bounds: Rectangle,
- filter_method: image::FilterMethod,
- rotation: Radians,
- opacity: f32,
- ) {
- delegate!(
- self,
- frame,
- frame.draw_image(
- handle,
- bounds,
- filter_method,
- rotation,
- opacity
- )
- );
+ fn draw_image(&mut self, bounds: Rectangle, image: impl Into<Image>) {
+ delegate!(self, frame, frame.draw_image(bounds, image));
}
fn draw_svg(