wayland_texture_set_region_from_shm_buffer


Description:

public Bool wayland_texture_set_region_from_shm_buffer (Texture texture, int src_x, int src_y, int width, int height, void* shm_buffer, int dst_x, int dst_y, int level) throws Error

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 set_region. See that function for a description of the level parameter.

<note>Since the storage for a Texture is allocated lazily then if the given texture has not previously been allocated then this api can return false and throw an exceptional throws if there is not enough memory to allocate storage for texture. </note>

Parameters:

texture

a 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


Namespace: Cogl
Package: doc