From 03b34931383e701c39c653a7662a616fe21a0947 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Thu, 14 Oct 2021 16:07:22 +0700 Subject: Remove trait-specific draw logic in `iced_native` --- glow/src/window/compositor.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'glow/src/window') diff --git a/glow/src/window/compositor.rs b/glow/src/window/compositor.rs index b8157f78..36e591cd 100644 --- a/glow/src/window/compositor.rs +++ b/glow/src/window/compositor.rs @@ -3,7 +3,6 @@ use crate::{Backend, Color, Error, Renderer, Settings, Viewport}; use core::ffi::c_void; use glow::HasContext; use iced_graphics::{Antialiasing, Size}; -use iced_native::mouse; /// A window graphics backend for iced powered by `glow`. #[allow(missing_debug_implementations)] @@ -59,14 +58,13 @@ impl iced_graphics::window::GLCompositor for Compositor { } } - fn draw>( + fn present>( &mut self, renderer: &mut Self::Renderer, viewport: &Viewport, color: Color, - output: &::Output, overlay: &[T], - ) -> mouse::Interaction { + ) { let gl = &self.gl; let [r, g, b, a] = color.into_linear(); @@ -76,6 +74,8 @@ impl iced_graphics::window::GLCompositor for Compositor { gl.clear(glow::COLOR_BUFFER_BIT); } - renderer.backend_mut().draw(gl, viewport, output, overlay) + renderer.present(|backend, primitive| { + backend.present(gl, primitive, viewport, overlay); + }); } } -- cgit