Implement basic presentation with softbuffer for iced_tiny_skia

This commit is contained in:
Héctor Ramón Jiménez 2023-02-25 16:05:42 +01:00
parent 8c373cd497
commit 535d7a4d57
No known key found for this signature in database
GPG key ID: 140CC052C94F138E
6 changed files with 90 additions and 30 deletions

View file

@ -201,11 +201,15 @@ impl<Theme> iced_graphics::window::Compositor for Compositor<Theme> {
fn create_surface<W: HasRawWindowHandle + HasRawDisplayHandle>(
&mut self,
window: &W,
width: u32,
height: u32,
) -> wgpu::Surface {
#[allow(unsafe_code)]
unsafe {
self.instance.create_surface(window)
}
let mut surface = unsafe { self.instance.create_surface(window) };
self.configure_surface(&mut surface, width, height);
surface
}
fn configure_surface(