summaryrefslogtreecommitdiffstats
path: root/wgpu/src/backend.rs
diff options
context:
space:
mode:
Diffstat (limited to 'wgpu/src/backend.rs')
-rw-r--r--wgpu/src/backend.rs11
1 files changed, 5 insertions, 6 deletions
diff --git a/wgpu/src/backend.rs b/wgpu/src/backend.rs
index 73fa5c5f..56de553f 100644
--- a/wgpu/src/backend.rs
+++ b/wgpu/src/backend.rs
@@ -8,7 +8,6 @@ use iced_graphics::font;
use iced_graphics::layer::Layer;
use iced_graphics::{Primitive, Viewport};
use iced_native::alignment;
-use iced_native::mouse;
use iced_native::{Font, Size};
#[cfg(any(feature = "image_rs", feature = "svg"))]
@@ -28,6 +27,7 @@ pub struct Backend {
image_pipeline: image::Pipeline,
default_text_size: u16,
+ primitive: Primitive,
}
impl Backend {
@@ -60,6 +60,7 @@ impl Backend {
image_pipeline,
default_text_size: settings.default_text_size,
+ primitive: Primitive::None,
}
}
@@ -67,16 +68,16 @@ impl Backend {
///
/// The text provided as overlay will be rendered on top of the primitives.
/// This is useful for rendering debug information.
- pub fn draw<T: AsRef<str>>(
+ pub fn present<T: AsRef<str>>(
&mut self,
device: &wgpu::Device,
staging_belt: &mut wgpu::util::StagingBelt,
encoder: &mut wgpu::CommandEncoder,
frame: &wgpu::TextureView,
+ primitive: &Primitive,
viewport: &Viewport,
- (primitive, mouse_interaction): &(Primitive, mouse::Interaction),
overlay_text: &[T],
- ) -> mouse::Interaction {
+ ) {
log::debug!("Drawing");
let target_size = viewport.physical_size();
@@ -102,8 +103,6 @@ impl Backend {
#[cfg(any(feature = "image_rs", feature = "svg"))]
self.image_pipeline.trim_cache();
-
- *mouse_interaction
}
fn flush(