Skip to content

Commit afe6da2

Browse files
authored
Merge pull request #56 from i509VCB/doc-wayland-set-buffer
detail platform specific behavior of set_buffer on Wayland
2 parents a800ca4 + 4aac1d2 commit afe6da2

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/lib.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,20 @@ impl GraphicsContext {
182182
/// R: Red channel
183183
/// G: Green channel
184184
/// B: Blue channel
185+
///
186+
/// # Platform dependent behavior
187+
///
188+
/// This section of the documentation details how some platforms may behave when [`set_buffer`](GraphicsContext::set_buffer)
189+
/// is called.
190+
///
191+
/// ## Wayland
192+
///
193+
/// On Wayland, calling this function may send requests to the underlying `wl_surface`. The
194+
/// graphics context may issue `wl_surface.attach`, `wl_surface.damage`, `wl_surface.damage_buffer`
195+
/// and `wl_surface.commit` requests when presenting the buffer.
196+
///
197+
/// If the caller wishes to synchronize other surface/window changes, such requests must be sent to the
198+
/// Wayland compositor before calling this function.
185199
#[inline]
186200
pub fn set_buffer(&mut self, buffer: &[u32], width: u16, height: u16) {
187201
if (width as usize) * (height as usize) != buffer.len() {

0 commit comments

Comments
 (0)