Cogl.wayland_texture_set_region_from_shm_buffer
function wayland_texture_set_region_from_shm_buffer(texture: Cogl.Texture, src_x: Number(gint), src_y: Number(gint), width: Number(gint), height: Number(gint), shm_buffer: void, dst_x: Number(gint), dst_y: Number(gint), level: Number(gint)): Cogl.Bool { // Gjs wrapper for cogl_wayland_texture_set_region_from_shm_buffer() }
Sets the pixels in a rectangular subregion of texture from a Wayland SHM buffer. Generally this would be used in response to wl_surface.damage event in a compositor in order to update the texture with the damaged region. This is just a convenience wrapper around getting the SHM buffer pointer and calling Cogl.Texture.prototype.set_region. See that function for a description of the level parameter.
<note>Since the storage for a Cogl.Texture is allocated lazily then if the given texture has not previously been allocated then this api can return false and throw an exceptional @error if there is not enough memory to allocate storage for texture.</note>
Since 1.18
- texture
- src_x
The X offset within the source bufer to copy from
- src_y
The Y offset within the source bufer to copy from
- width
The width of the region to copy
- height
The height of the region to copy
- shm_buffer
The source buffer
- dst_x
The X offset within the texture to copy to
- dst_y
The Y offset within the texture to copy to
- level
The mipmap level of the texture to copy to
- Returns
true if the subregion upload was successful, and false otherwise