Remove trait-specific draw logic in iced_native
This commit is contained in:
parent
3aae45c191
commit
03b3493138
71 changed files with 641 additions and 3126 deletions
|
|
@ -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<T: AsRef<str>>(
|
||||
fn present<T: AsRef<str>>(
|
||||
&mut self,
|
||||
renderer: &mut Self::Renderer,
|
||||
viewport: &Viewport,
|
||||
color: Color,
|
||||
output: &<Self::Renderer as iced_native::Renderer>::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);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue