Add a Buffer::present_with_damage() method

Supported on Wayland, X11, and Win32.

Fixes https://github.com/rust-windowing/softbuffer/issues/39.

try_for_each
This commit is contained in:
Ian Douglas Scott 2023-04-21 10:37:48 -07:00
parent f12aa534e1
commit c1d6716eec
7 changed files with 186 additions and 78 deletions

View file

@ -9,7 +9,7 @@ use web_sys::HtmlCanvasElement;
use web_sys::ImageData;
use crate::error::SwResultExt;
use crate::SoftBufferError;
use crate::{Rect, SoftBufferError};
use std::convert::TryInto;
use std::num::NonZeroU32;
@ -153,6 +153,10 @@ impl<'a> BufferImpl<'a> {
Ok(())
}
pub fn present_with_damage(self, _damage: &[Rect]) -> Result<(), SoftBufferError> {
self.present()
}
}
#[inline(always)]