Package: gtk

Class gtk:graphics-offload

Superclasses

Documented Subclasses

None

Direct Slots

black-background
The black-background property of type :boolean (Read / Write)
Whether to draw a black background. Since 4.16
Default value: false
child
The child property of type gtk:widget (Read / Write)
The child widget.
enabled
The enabled property of type gtk:graphics-offload-enabled (Read / Write)
Whether graphics offload is enabled.
Default value: :enabled

Details

The gtk:graphics-offload widget is a widget that allows to bypass GSK rendering for its child by passing the content directly to the compositor. Graphics offload is an optimization to reduce overhead and battery use that is most useful for video content. It only works on some platforms and in certain situations. GTK will automatically fall back to normal rendering if it does not.

Graphics offload is most efficient if there are no controls drawn on top of the video content. You should consider using graphics offload for your main widget if it shows frequently changing content, such as a video, or a VM display, and you provide the content in the form of dma-buf textures, see the gdk:dmabuf-texture-builder documentation, in particular if it may be fullscreen.

Numerous factors can prohibit graphics offload:
  • Unsupported platforms. Currently, graphics offload only works on Linux with Wayland.
  • Clipping, such as rounded corners that cause the video content to not be rectangular.
  • Unsupported dma-buf formats, see the gdk:display-dmabuf-formats function.
  • Translucent video content, content with an alpha channel, even if it is not used.
  • Transforms that are more complex than translations and scales.
  • Filters such as opacity, grayscale or similar.
The GTK inspector provides a visual debugging tool for graphics offload.

Since 4.14
 

Returned by

Slot Access Functions

Inherited Slot Access Functions

See also

2024-11-9