Class: Gdk::DmabufTextureBuilder

Inherits:
Object
  • Object
show all
Defined in:
(unknown)

Instance Method Summary collapse

Constructor Details

#initializeGdk::DmabufTextureBuilder

Creates a new texture builder.

Instance Method Details

#build(destroy, data) ⇒ Gdk::Texture

Builds a new GdkTexture 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, nil 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 [methodGdk.Display.get_dmabuf_formats] to get a list of supported formats.

Parameters:

  • destroy (GLib::DestroyNotify)

    destroy function to be called when the texture is released

  • data (GObject)

    user data to pass to the destroy function

Returns:

  • (Gdk::Texture)

    a newly built GdkTexture or NULL if the format is not supported

#displayGdk::Display

The display that this texture will be used on.

Returns:

#display=(display) ⇒ Gdk::Display

The display that this texture will be used on.

Parameters:

Returns:

#fourccInteger

The format of the texture, as a fourcc value.

Returns:

  • (Integer)

    fourcc

#fourcc=(fourcc) ⇒ Integer

The format of the texture, as a fourcc value.

Parameters:

  • fourcc (Integer)

Returns:

  • (Integer)

    fourcc

  • (Integer)

    fourcc

#get_fd(plane) ⇒ Integer

Gets the file descriptor for a plane.

Parameters:

  • plane (Integer)

    the plane to get the fd for

Returns:

  • (Integer)

    the file descriptor

#get_offset(plane) ⇒ Integer

Gets the offset value for a plane.

Parameters:

  • plane (Integer)

    the plane to get the offset for

Returns:

  • (Integer)

    the offset

#get_stride(plane) ⇒ Integer

Gets the stride value for a plane.

Parameters:

  • plane (Integer)

    the plane to get the stride for

Returns:

  • (Integer)

    the stride

#heightInteger

The height of the texture.

Returns:

  • (Integer)

    height

#height=(height) ⇒ Integer

The height of the texture.

Parameters:

  • height (Integer)

Returns:

  • (Integer)

    height

  • (Integer)

    height

#modifierInteger

The modifier.

Returns:

  • (Integer)

    modifier

#modifier=(modifier) ⇒ Integer

The modifier.

Parameters:

  • modifier (Integer)

Returns:

  • (Integer)

    modifier

  • (Integer)

    modifier

#n_planesInteger

The number of planes of the texture.

Note that you can set properties for other planes, but they will be ignored when constructing the texture.

Returns:

  • (Integer)

    n-planes

#n_planes=(n_planes) ⇒ Integer

The number of planes of the texture.

Note that you can set properties for other planes, but they will be ignored when constructing the texture.

Parameters:

  • n_planes (Integer)

Returns:

  • (Integer)

    n-planes

  • (Integer)

    n-planes

#premultipliedBoolean

Whether the data is premultiplied.

Returns:

  • (Boolean)

    whether the data is premultiplied

#premultiplied=(premultiplied) ⇒ Boolean

Whether the alpha channel is premultiplied into the others.

Only relevant if the format has alpha.

Parameters:

  • premultiplied (Boolean)

Returns:

  • (Boolean)

    premultiplied

  • (Boolean)

    premultiplied

#premultiplied?Boolean

Whether the alpha channel is premultiplied into the others.

Only relevant if the format has alpha.

Returns:

  • (Boolean)

    premultiplied

#set_fd(plane, fd) ⇒ nil

Sets the file descriptor for a plane.

Parameters:

  • plane (Integer)

    the plane to set the fd for

  • fd (Integer)

    the file descriptor

Returns:

  • (nil)

#set_offset(plane, offset) ⇒ nil

Sets the offset for a plane.

Parameters:

  • plane (Integer)

    the plane to set the offset for

  • offset (Integer)

    the offset value

Returns:

  • (nil)

#set_stride(plane, stride) ⇒ nil

Sets the stride for a plane.

The stride must be set for all planes before calling [methodGdk.GLTextureBuilder.build].

Parameters:

  • plane (Integer)

    the plane to set the stride for

  • stride (Integer)

    the stride value

Returns:

  • (nil)

#update_regioncairo::Region

The update region for [propertyGdk.GLTextureBuilder:update-texture].

Returns:

  • (cairo::Region)

    update-region

#update_region=(update_region) ⇒ cairo::Region

The update region for [propertyGdk.GLTextureBuilder:update-texture].

Parameters:

  • update_region (cairo::Region)

Returns:

  • (cairo::Region)

    update-region

  • (cairo::Region)

    update-region

#update_textureGdk::Texture

The texture [propertyGdk.DmabufTextureBuilder:update-region] is an update for.

Returns:

#update_texture=(update_texture) ⇒ Gdk::Texture

The texture [propertyGdk.DmabufTextureBuilder:update-region] is an update for.

Parameters:

Returns:

#widthInteger

The width of the texture.

Returns:

  • (Integer)

    width

#width=(width) ⇒ Integer

The width of the texture.

Parameters:

  • width (Integer)

Returns:

  • (Integer)

    width

  • (Integer)

    width