Implement basic presentation with softbuffer for iced_tiny_skia
This commit is contained in:
parent
8c373cd497
commit
535d7a4d57
6 changed files with 90 additions and 30 deletions
|
|
@ -52,14 +52,16 @@ impl<Theme> iced_graphics::window::Compositor for Compositor<Theme> {
|
|||
fn create_surface<W: HasRawWindowHandle + HasRawDisplayHandle>(
|
||||
&mut self,
|
||||
window: &W,
|
||||
width: u32,
|
||||
height: u32,
|
||||
) -> Surface {
|
||||
match self {
|
||||
Self::Wgpu(compositor) => {
|
||||
Surface::Wgpu(compositor.create_surface(window))
|
||||
}
|
||||
Self::TinySkia(compositor) => {
|
||||
Surface::TinySkia(compositor.create_surface(window))
|
||||
Surface::Wgpu(compositor.create_surface(window, width, height))
|
||||
}
|
||||
Self::TinySkia(compositor) => Surface::TinySkia(
|
||||
compositor.create_surface(window, width, height),
|
||||
),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue