Merge pull request #56 from i509VCB/doc-wayland-set-buffer

detail platform specific behavior of set_buffer on Wayland
This commit is contained in:
David Johnson 2023-01-03 00:11:02 -06:00 committed by GitHub
commit afe6da235b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -182,6 +182,20 @@ impl GraphicsContext {
/// R: Red channel
/// G: Green channel
/// B: Blue channel
///
/// # Platform dependent behavior
///
/// This section of the documentation details how some platforms may behave when [`set_buffer`](GraphicsContext::set_buffer)
/// is called.
///
/// ## Wayland
///
/// On Wayland, calling this function may send requests to the underlying `wl_surface`. The
/// graphics context may issue `wl_surface.attach`, `wl_surface.damage`, `wl_surface.damage_buffer`
/// and `wl_surface.commit` requests when presenting the buffer.
///
/// If the caller wishes to synchronize other surface/window changes, such requests must be sent to the
/// Wayland compositor before calling this function.
#[inline]
pub fn set_buffer(&mut self, buffer: &[u32], width: u16, height: u16) {
if (width as usize) * (height as usize) != buffer.len() {