Use static dispatch

This commit is contained in:
jtnunley 2022-12-22 10:09:47 -08:00
parent 58d4fd41b7
commit 319ff565a5
7 changed files with 75 additions and 49 deletions

View file

@ -1,4 +1,4 @@
use crate::{error::unwrap, GraphicsContextImpl, SwBufError};
use crate::{error::unwrap, SwBufError};
use raw_window_handle::{WaylandDisplayHandle, WaylandWindowHandle};
use std::collections::VecDeque;
use wayland_client::{
@ -78,10 +78,8 @@ impl WaylandImpl {
self.buffers.push_back(buffer);
self.buffers.back().unwrap()
}
}
impl GraphicsContextImpl for WaylandImpl {
unsafe fn set_buffer(&mut self, buffer: &[u32], width: u16, height: u16) {
pub(super) unsafe fn set_buffer(&mut self, buffer: &[u32], width: u16, height: u16) {
let _ = self.event_queue.dispatch_pending(&mut State);
let surface = self.surface.clone();