Owned pixel buffer for no-copy presentation
This is based on the API that will be used for no-copy presentation. But wraps it in `set_buffer`. This also fixes the Wayland buffer code to set `self.width` and `self.height` on resize, and set the length of the shared memory file when the buffer is created. Co-authored-by: jtnunley <jtnunley01@gmail.com>
This commit is contained in:
parent
e5d546ff9e
commit
a09e4cf679
19 changed files with 1176 additions and 438 deletions
|
|
@ -1,8 +1,10 @@
|
|||
use raw_window_handle::{RawDisplayHandle, RawWindowHandle};
|
||||
use std::error::Error;
|
||||
use std::num::NonZeroU32;
|
||||
use thiserror::Error;
|
||||
|
||||
#[derive(Error, Debug)]
|
||||
#[allow(missing_docs)] // TODO
|
||||
#[non_exhaustive]
|
||||
pub enum SoftBufferError {
|
||||
#[error(
|
||||
|
|
@ -27,6 +29,12 @@ pub enum SoftBufferError {
|
|||
#[error("The provided display handle is null.")]
|
||||
IncompleteDisplayHandle,
|
||||
|
||||
#[error("Surface size {width}x{height} out of range for backend.")]
|
||||
SizeOutOfRange {
|
||||
width: NonZeroU32,
|
||||
height: NonZeroU32,
|
||||
},
|
||||
|
||||
#[error("Platform error")]
|
||||
PlatformError(Option<String>, Option<Box<dyn Error>>),
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue