Resize Surface::buffer instead of reallocating in iced_tiny_skia
This commit is contained in:
parent
535d7a4d57
commit
445b31c6c5
1 changed files with 2 additions and 1 deletions
|
|
@ -58,7 +58,8 @@ impl<Theme> iced_graphics::window::Compositor for Compositor<Theme> {
|
|||
) {
|
||||
surface.pixels = tiny_skia::Pixmap::new(width, height)
|
||||
.expect("Create pixmap for window");
|
||||
surface.buffer = vec![0; (width * height) as usize];
|
||||
|
||||
surface.buffer.resize((width * height) as usize, 0);
|
||||
}
|
||||
|
||||
fn fetch_information(&self) -> Information {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue