DmabufTextureBuilder.build

gdk.texture.Texture build(glib.types.DestroyNotify destroy = null, void * data = null)

Builds a new [gdk.texture.Texture] with the values set up in the builder.

It is a programming error to call this function if any mandatory property has not been set.

If the dmabuf is not supported by GTK, null will be returned and error will be set.

The destroy function gets called when the returned texture gets released.

It is possible to call this function multiple times to create multiple textures, possibly with changing properties in between.

It is the responsibility of the caller to keep the file descriptors for the planes open until the created texture is no longer used, and close them afterwards (possibly using the destroy notify).

Not all formats defined in the drm_fourcc.h header are supported. You can use [gdk.display.Display.getDmabufFormats] to get a list of supported formats.

Parameters

destroydestroy function to be called when the texture is released
datauser data to pass to the destroy function

Returns

a newly built [gdk.texture.Texture] or NULL

if the format is not supported

Throws

[ErrorWrap]