Package ch.bailu.gtk.gsk
Klasse Renderer
java.lang.Object
ch.bailu.gtk.type.Type
ch.bailu.gtk.type.Pointer
ch.bailu.gtk.gobject.Object
ch.bailu.gtk.type.PropertyHolder
ch.bailu.gtk.gsk.Renderer
- Alle implementierten Schnittstellen:
PointerInterface
- Bekannte direkte Unterklassen:
BroadwayRenderer
,CairoRenderer
,GLRenderer
,NglRenderer
,VulkanRenderer
A class that renders a scene graph defined via a tree of
[class@Gsk.RenderNode] instances.
Typically you will use a `GskRenderer` instance to repeatedly call
[method@Gsk.Renderer.render] to update the contents of its associated
[class@Gdk.Surface].
It is necessary to realize a `GskRenderer` instance using
[method@Gsk.Renderer.realize] before calling [method@Gsk.Renderer.render],
in order to create the appropriate windowing system resources needed
to render the scene.
[class@Gsk.RenderNode] instances.
Typically you will use a `GskRenderer` instance to repeatedly call
[method@Gsk.Renderer.render] to update the contents of its associated
[class@Gdk.Surface].
It is necessary to realize a `GskRenderer` instance using
[method@Gsk.Renderer.realize] before calling [method@Gsk.Renderer.render],
in order to create the appropriate windowing system resources needed
to render the scene.
-
Verschachtelte Klassen - Übersicht
Von Klasse geerbte verschachtelte Klassen/Schnittstellen ch.bailu.gtk.gobject.Object
Object.OnBindingTransformFunc, Object.OnDestroyNotify, Object.OnDuplicateFunc, Object.OnNotify, Object.OnToggleNotify, Object.OnWeakNotify
-
Feldübersicht
Von Klasse geerbte Felder ch.bailu.gtk.gobject.Object
SIGNAL_ON_NOTIFY
-
Konstruktorübersicht
Konstruktoren -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungstatic ClassHandler
static int
static long
static TypeSystem.TypeSize
Retrieves the surface that the renderer is associated with.static long
static TypeSystem.TypeSize
boolean
Checks whether the renderer is realized or not.static Renderer
newForSurfaceRenderer
(Surface surface) Creates an appropriate `GskRenderer` instance for the given surface.boolean
Creates the resources needed by the renderer.boolean
realizeForDisplay
(Display display) Creates the resources needed by the renderer.void
render
(RenderNode root, Region region) Renders the scene graph, described by a tree of `GskRenderNode` instances
to the renderer's surface, ensuring that the given region gets redrawn.renderTexture
(RenderNode root, Rect viewport) Renders a scene graph, described by a tree of `GskRenderNode` instances,
to a texture.void
Releases all the resources created by [method@Gsk.Renderer.realize].Von Klasse geerbte Methoden ch.bailu.gtk.type.PropertyHolder
getBooleanProperty, getIntProperty, getObjectProperty, getStringProperty, getStrProperty, setBooleanProperty, setIntProperty, setObjectProperty, setStringProperty, setStrProperty
Von Klasse geerbte Methoden ch.bailu.gtk.gobject.Object
addToggleRef, bindProperty, bindProperty, bindPropertyFull, bindPropertyFull, bindPropertyWithClosures, bindPropertyWithClosures, compatControl, connect, connect, disconnect, disconnect, dupData, dupData, dupQdata, forceFloating, freezeNotify, get, get, getData, getData, getProperty, getProperty, getQdata, interfaceFindProperty, interfaceInstallProperty, isFloating, notify, notify, notifyByPspec, onNotify, ref, refSink, removeToggleRef, replaceData, replaceData, replaceQdata, runDispose, set, set, setData, setData, setDataFull, setDataFull, setProperty, setProperty, setQdata, setQdataFull, stealData, stealData, stealQdata, takeRef, thawNotify, unref, watchClosure, weakRef, weakUnref
Von Klasse geerbte Methoden ch.bailu.gtk.type.Pointer
asCPointer, cast, connectSignal, disconnectSignals, disconnectSignals, equals, hashCode, throwIfNull, throwNullPointerException, toString, unregisterCallbacks, unregisterCallbacks
Von Klasse geerbte Methoden ch.bailu.gtk.type.Type
asCPointer, asCPointer, asCPointerNotNull, asJnaPointer, asJnaPointer, asPointer, asPointer, cast, cast, throwIfNull
Von Klasse geerbte Methoden java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Von Schnittstelle geerbte Methoden ch.bailu.gtk.type.PointerInterface
asCPointerNotNull, asJnaPointer, asPointer, isNotNull, isNull
-
Konstruktordetails
-
Renderer
-
-
Methodendetails
-
getClassHandler
-
newForSurfaceRenderer
Creates an appropriate `GskRenderer` instance for the given surface.
If the `GSK_RENDERER` environment variable is set, GSK will
try that renderer first, before trying the backend-specific
default. The ultimate fallback is the cairo renderer.
The renderer will be realized before it is returned.- Parameter:
surface
- a surface- Gibt zurück:
- the realized renderer
-
getSurface
Retrieves the surface that the renderer is associated with.
If the renderer has not been realized yet, `NULL` will be returned.- Gibt zurück:
- the surface
-
isRealized
public boolean isRealized()Checks whether the renderer is realized or not.- Gibt zurück:
- true if the renderer was realized, false otherwise
-
realize
Creates the resources needed by the renderer.
Since GTK 4.6, the surface may be `NULL`, which allows using
renderers without having to create a surface. Since GTK 4.14,
it is recommended to use [method@Gsk.Renderer.realize_for_display]
for this case.
Note that it is mandatory to call [method@Gsk.Renderer.unrealize]
before destroying the renderer.- Parameter:
surface
- the surface that renderer will be used on- Gibt zurück:
- whether the renderer was successfully realized
- Löst aus:
AllocationError
-
realizeForDisplay
Creates the resources needed by the renderer.
Note that it is mandatory to call [method@Gsk.Renderer.unrealize]
before destroying the renderer.- Parameter:
display
- the display that the renderer will be used on- Gibt zurück:
- whether the renderer was successfully realized
- Löst aus:
AllocationError
-
render
Renders the scene graph, described by a tree of `GskRenderNode` instances
to the renderer's surface, ensuring that the given region gets redrawn.
If the renderer has no associated surface, this function does nothing.
Renderers must ensure that changes of the contents given by the @root
node as well as the area given by @region are redrawn. They are however
free to not redraw any pixel outside of @region if they can guarantee that
it didn't change.
The renderer will acquire a reference on the `GskRenderNode` tree while
the rendering is in progress.- Parameter:
root
- the render node to renderregion
- the `cairo_region_t` that must be redrawn or `NULL` for the whole surface
-
renderTexture
Renders a scene graph, described by a tree of `GskRenderNode` instances,
to a texture.
The renderer will acquire a reference on the `GskRenderNode` tree while
the rendering is in progress.
If you want to apply any transformations to @root, you should put it into a
transform node and pass that node instead.- Parameter:
root
- the render node to renderviewport
- the section to draw or `NULL` to use @root's bounds- Gibt zurück:
- a texture with the rendered contents of @root
-
unrealize
public void unrealize()Releases all the resources created by [method@Gsk.Renderer.realize]. -
getTypeID
public static long getTypeID() -
getParentTypeID
public static long getParentTypeID() -
getTypeSize
-
getParentTypeSize
-
getInstanceSize
public static int getInstanceSize()
-