diff options
Diffstat (limited to '')
| -rw-r--r-- | wgpu/src/renderer.rs | 4 | ||||
| -rw-r--r-- | wgpu/src/renderer/widget/image.rs | 12 | 
2 files changed, 10 insertions, 6 deletions
| diff --git a/wgpu/src/renderer.rs b/wgpu/src/renderer.rs index f27a4b8a..ad081383 100644 --- a/wgpu/src/renderer.rs +++ b/wgpu/src/renderer.rs @@ -229,9 +229,9 @@ impl Renderer {                      border_radius: *border_radius as f32,                  });              } -            Primitive::Image { path, bounds } => { +            Primitive::Image { handle, bounds } => {                  layer.images.push(Image { -                    path: path.clone(), +                    handle: handle.clone(),                      position: [bounds.x, bounds.y],                      scale: [bounds.width, bounds.height],                  }); diff --git a/wgpu/src/renderer/widget/image.rs b/wgpu/src/renderer/widget/image.rs index 0006dde1..70dc5d97 100644 --- a/wgpu/src/renderer/widget/image.rs +++ b/wgpu/src/renderer/widget/image.rs @@ -2,14 +2,18 @@ use crate::{Primitive, Renderer};  use iced_native::{image, Layout, MouseCursor};  impl image::Renderer for Renderer { -    fn dimensions(&self, path: &str) -> (u32, u32) { -        self.image_pipeline.dimensions(path) +    fn dimensions(&self, handle: &image::Handle) -> (u32, u32) { +        self.image_pipeline.dimensions(handle)      } -    fn draw(&mut self, path: &str, layout: Layout<'_>) -> Self::Output { +    fn draw( +        &mut self, +        handle: image::Handle, +        layout: Layout<'_>, +    ) -> Self::Output {          (              Primitive::Image { -                path: String::from(path), +                handle,                  bounds: layout.bounds(),              },              MouseCursor::OutOfBounds, | 
