It derives from <GtkWidget>.
Bypasses gsk rendering by passing the content of its child 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 doesn’t.
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 dmabuf textures (see
<GdkDmabufTextureBuilder>), in
particular if it may be fullscreen.
Numerous factors can prohibit graphics offload:
display:get-dmabuf-formats)
To investigate problems related graphics offload, GTK offers debug flags to print out information about graphics offload and dmabuf use:
GDK_DEBUG=offload GDK_DEBUG=dmabuf
The GTK inspector provides a visual debugging tool for graphics offload.
Whether to draw a black background.
Its value is a boolean.
Set it with (set! (graphics-offload:black-background self)
value).
The child widget.
Its value is a <GtkWidget>, or #f.
Set it with (set! (graphics-offload:child self) value).
Whether graphics offload is enabled.
Its value is a
<GtkGraphicsOffloadEnabled> (or, to
set it, one of its symbols).
Set it with (set! (graphics-offload:enabled self) value).
Returns whether the widget draws a black background.
See graphics-offload:set-black-background.
Passed: a <GtkGraphicsOffload>.
Returned: a boolean.
TRUE if black background is drawn
Gets the child of self.
Passed: a <GtkGraphicsOffload>.
Returned: a <GtkWidget>, or #f.
the child widget
Returns whether offload is enabled for self.
Passed: a <GtkGraphicsOffload>.
Returned: a
<GtkGraphicsOffloadEnabled>.
whether offload is enabled
Creates a new GtkGraphicsOffload widget.
Passed, or left out: a <GtkWidget>, or #f.
the child widget
Returned: a <GtkWidget>.
the new widget
Sets whether this GtkGraphicsOffload widget will draw a black background.
A main use case for this is _letterboxing_ where black bars are visible next to the content if the aspect ratio of the content does not match the dimensions of the monitor.
Using this property for letterboxing instead of CSS allows compositors to show content with maximum efficiency, using direct scanout to avoid extra copies in the compositor.
On Wayland, this is implemented using the single-pixel buffer protocol.
Passed: a <GtkGraphicsOffload>.
Passed: a boolean.
whether to draw a black background behind the content
Sets the child of self.
Passed: a <GtkGraphicsOffload>.
Passed, or left out: a <GtkWidget>, or #f.
the child widget
Sets whether this GtkGraphicsOffload widget will attempt to offload the content of its child widget.
Passed: a <GtkGraphicsOffload>.
Passed: a
<GtkGraphicsOffloadEnabled>, or one
of its symbols.
whether to enable offload