summaryrefslogtreecommitdiffstats
path: root/wgpu/src/renderer/widget/image.rs
blob: c4c0498497847a8af9da41ed67d553b44da6d8e2 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
use crate::{Primitive, Renderer};
use iced_native::{image, mouse, Layout};

impl image::Renderer for Renderer {
    fn dimensions(&self, handle: &image::Handle) -> (u32, u32) {
        self.image_pipeline.dimensions(handle)
    }

    fn draw(
        &mut self,
        handle: image::Handle,
        layout: Layout<'_>,
    ) -> Self::Output {
        (
            Primitive::Image {
                handle,
                bounds: layout.bounds(),
            },
            mouse::Interaction::default(),
        )
    }
}