The blend modes available for render nodes.
The implementation of each blend mode is deferred to the
rendering pipeline.
The default blend mode, which specifies no blending
The source color is multiplied by the destination
and replaces the destination
...
...
...
...
...
...
...
...
...
...
...
...
...
...
Creates a new Broadway renderer.
The Broadway renderer is the default renderer for the broadway backend.
It will only work with broadway surfaces, otherwise it will fail the
call to gdk_renderer_realize().
This function is only available when GTK was compiled with Broadway
support.
a new Broadway renderer.
Creates a new Cairo renderer.
The Cairo renderer is the fallback renderer drawing in ways similar
to how GTK 3 drew its content. Its primary use is as comparison tool.
The Cairo renderer is incomplete. It cannot render 3D transformed
content and will instead render an error marker. Its usage should be
avoided.
a new Cairo renderer.
The corner indices used by #GskRoundedRect.
The top left corner
The top right corner
The bottom right corner
The bottom left corner
Creates a new #GskRenderer using OpenGL. This is the default renderer
used by GTK.
a new GL renderer
The `GskRenderNode` structure contains only private data.
Draw the contents of @node to the given cairo context.
Typically, you'll use this function to implement fallback rendering
of #GskRenderNodes on an intermediate Cairo context, instead of using
the drawing context associated to a #GdkSurface's rendering buffer.
For advanced nodes that cannot be supported using Cairo, in particular
for nodes doing 3D operations, this function may fail.
a #GskRenderNode
cairo context to draw to
Retrieves the boundaries of the @node. The node will not draw outside
of its boundaries.
a #GskRenderNode
return location for the boundaries
Returns the type of the @node.
the type of the #GskRenderNode
a #GskRenderNode
Acquires a reference on the given #GskRenderNode.
the #GskRenderNode with an additional reference
a #GskRenderNode
Serializes the @node for later deserialization via
gsk_render_node_deserialize(). No guarantees are made about the format
used other than that the same version of GTK+ will be able to deserialize
the result of a call to gsk_render_node_serialize() and
gsk_render_node_deserialize() will correctly reject files it cannot open
that were created with previous versions of GTK+.
The intended use of this functions is testing, benchmarking and debugging.
The format is not meant as a permanent storage format.
a #GBytes representing the node.
a #GskRenderNode
Releases a reference on the given #GskRenderNode.
If the reference was the last, the resources associated to the @node are
freed.
a #GskRenderNode
This function is equivalent to calling gsk_render_node_serialize()
followed by g_file_set_contents(). See those two functions for details
on the arguments.
It is mostly intended for use inside a debugger to quickly dump a render
node to a file for later inspection.
%TRUE if saving was successful
a #GskRenderNode
the file to save it to.
Loads data previously created via gsk_render_node_serialize(). For a
discussion of the supported format, see that function.
a new #GskRenderNode or %NULL on
error.
the bytes containing the data
The type of a node determines what the node is rendering.
Error type. No node will ever have this type.
A node containing a stack of children
A node drawing a #cairo_surface_t
A node drawing a single color rectangle
A node drawing a linear gradient
A node drawing a repeating linear gradient
A node stroking a border around an area
A node drawing a #GdkTexture
A node drawing an inset shadow
A node drawing an outset shadow
A node that renders its child after applying a matrix transform
A node that changes the opacity of its child
A node that applies a color matrix to every pixel
A node that repeats the child's contents
A node that clips its child to a rectangular area
A node that clips its child to a rounded rectangle
A node that draws a shadow below its child
A node that blends two children together
A node that cross-fades between two children
A node containing a glyph string
A node that applies a blur
Creates an appropriate #GskRenderer instance for the given @surface.
The renderer will be realized when it is returned.
a #GskRenderer
a #GdkSurface
Retrieves the #GdkSurface set using gsk_renderer_realize(). If the renderer
has not been realized yet, %NULL will be returned.
a #GdkSurface
a #GskRenderer
Checks whether the @renderer is realized or not.
%TRUE if the #GskRenderer was realized, and %FALSE otherwise
a #GskRenderer
Creates the resources needed by the @renderer to render the scene
graph.
a #GskRenderer
the #GdkSurface renderer will be used on
Renders the scene graph, described by a tree of #GskRenderNode instances,
ensuring that the given @region gets redrawn.
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.
a #GskRenderer
a #GskRenderNode
the #cairo_region_t that must be redrawn or %NULL
for the whole window
Renders the scene graph, described by a tree of #GskRenderNode instances,
to a #GdkTexture.
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.
a #GdkTexture with the rendered contents of @root.
a realized #GdkRenderer
a #GskRenderNode
the section to draw or %NULL to use @root's bounds
Releases all the resources created by gsk_renderer_realize().
a #GskRenderer
A rectangular region with rounded corners.
Application code should normalize rectangles using gsk_rounded_rect_normalize();
this function will ensure that the bounds of the rectanlge are normalized
and ensure that the corner values are positive and the corners do not overlap.
All functions taking a #GskRoundedRect as an argument will internally operate on
a normalized copy; all functions returning a #GskRoundedRect will always return
a normalized one.
the bounds of the rectangle
the size of the 4 rounded corners
Checks if the given @point is inside the rounded rectangle. This function
returns %FALSE if the point is in the rounded corner areas.
%TRUE if the @point is inside the rounded rectangle
a #GskRoundedRect
the point to check
Checks if the given @rect is contained inside the rounded rectangle.
This function returns %FALSE if @rect extends into one of the rounded
corner areas.
%TRUE if the @rect is fully contained inside the rounded rectangle
a #GskRoundedRect
the rectangle to check
Initializes the given #GskRoundedRect with the given values.
This function will implicitly normalize the #GskRoundedRect
before returning.
the initialized rectangle
The #GskRoundedRect to initialize
a #graphene_rect_t describing the bounds
the rounding radius of the top left corner
the rounding radius of the top right corner
the rounding radius of the bottom right corner
the rounding radius of the bottom left corner
Initializes @self using the given @src rectangle.
This function will not normalize the #GskRoundedRect, so
make sure the source is normalized.
the initialized rectangle
a #GskRoundedRect
a #GskRoundedRect
Initializes @self to the given @bounds and sets the radius of all
four corners to @radius.
the initialized rectangle
a #GskRoundedRect
a #graphene_rect_t
the border radius
Checks if part of the given @rect is contained inside the rounded rectangle.
This function returns %FALSE if @rect only extends into one of the rounded
corner areas but not into the rounded rectangle itself.
%TRUE if the @rect intersects with the rounded rectangle
a #GskRoundedRect
the rectangle to check
Checks if all corners of @self are right angles and the
rectangle covers all of its bounds.
This information can be used to decide if gsk_clip_node_new()
or gsk_rounded_clip_node_new() should be called.
%TRUE if the rectangle is rectilinear
the #GskRoundedRect to check
Normalizes the passed rectangle.
this function will ensure that the bounds of the rectanlge are normalized
and ensure that the corner values are positive and the corners do not overlap.
the normalized rectangle
a #GskRoundedRect
Offsets the bound's origin by @dx and @dy.
The size and corners of the rectangle are unchanged.
the offset rectangle
a #GskRoundedRect
the horizontal offset
the vertical offset
Shrinks (or grows) the given rectangle by moving the 4 sides
according to the offsets given. The corner radii will be changed
in a way that tries to keep the center of the corner circle intact.
This emulates CSS behavior.
This function also works for growing rectangles if you pass
negative values for the @top, @right, @bottom or @left.
the resized #GskRoundedRect
The #GskRoundedRect to shrink or grow
How far to move the top side downwards
How far to move the right side to the left
How far to move the bottom side upwards
How far to move the left side to the right
The filters used when scaling texture data.
The actual implementation of each filter is deferred to the
rendering pipeline.
linear interpolation filter
nearest neighbor interpolation filter
linear interpolation along each axis,
plus mipmap generation, with linear interpolation along the mipmap
levels
Errors that can happen during (de)serialization.
The format can not be
identified
The version of the data
is not understood
The given data may not exist in
a proper serialization
Creates a #GskRenderNode that will draw a @child with the given
@shadows below it.
A new #GskRenderNode
The node to draw
The shadows to apply
number of entries in the @shadows array
The `GskTransform` structure contains only private data.
Checks two matrices for equality. Note that matrices need to be literally
identical in their operations, it is not enough that they return the
same result in gsk_transform_to_matrix().
%TRUE if the two matrices can be proven to be equal
the first matrix
the second matrix
Returns the category this transform belongs to.
The category of the transform
A #GskTransform
Inverts the given transform.
If @self is not invertible, %NULL is returned.
Note that inverting %NULL also returns %NULL, which is
the correct inverse of %NULL. If you need to differentiate
between those cases, you should check @self is not %NULL
before calling this function.
The inverted transform or %NULL if the transform
cannot be inverted.
Transform to invert
Multiplies @next with the given @matrix.
The new matrix
the next transform
the matrix to multiply @next with
Applies a perspective projection transform. This transform
scales points in X and Y based on their Z value, scaling
points with positive Z values away from the origin, and
those with negative Z values towards the origin. Points
on the z=0 plane are unchanged.
The new matrix
the next transform
distance of the z=0 plane. Lower values give a more
flattened pyramid and therefore a more pronounced
perspective effect.
Converts @self into a human-readable string representation suitable
for printing that can later be parsed with gsk_transform_parse().
a #GskTransform
The string to print into
Acquires a reference on the given #GskTransform.
the #GskTransform with an additional reference
a #GskTransform
Rotates @next @angle degrees in 2D - or in 3Dspeak, around the z axis.
The new matrix
the next transform
the rotation angle, in degrees (clockwise)
Rotates @next @angle degrees around @axis.
For a rotation in 2D space, use gsk_transform_rotate().
The new matrix
the next transform
the rotation angle, in degrees (clockwise)
The rotation axis
Scales @next in 2-dimensional space by the given factors.
Use gsk_transform_scale_3d() to scale in all 3 dimensions.
The new matrix
the next transform
scaling factor on the X axis
scaling factor on the Y axis
Scales @next by the given factors.
The new matrix
the next transform
scaling factor on the X axis
scaling factor on the Y axis
scaling factor on the Z axis
Converts a #GskTransform to a 2D transformation
matrix.
@self must be a 2D transformation. If you are not
sure, use gsk_transform_get_category() >=
%GSK_TRANSFORM_CATEGORY_2D to check.
The returned values have the following layout:
|[<!-- language="plain" -->
| xx yx | | a b 0 |
| xy yy | = | c d 0 |
| x0 y0 | | tx ty 1 |
]|
This function can be used to convert between a #GskTransform
and a matrix type from other 2D drawing libraries, in particular
Cairo.
a 2D #GskTransform
return location for the xx member
return location for the yx member
return location for the xy member
return location for the yy member
return location for the x0 member
return location for the y0 member
Converts a #GskTransform to 2D affine transformation
factors.
@self must be a 2D transformation. If you are not
sure, use gsk_transform_get_category() >=
%GSK_TRANSFORM_CATEGORY_2D_AFFINE to check.
a #GskTransform
return location for the scale
factor in the x direction
return location for the scale
factor in the y direction
return location for the translation
in the x direction
return location for the translation
in the y direction
Computes the actual value of @self and stores it in @out_matrix.
The previous value of @out_matrix will be ignored.
a #GskTransform
The matrix to set
Converts a matrix into a string that is suitable for
printing and can later be parsed with gsk_transform_parse().
This is a wrapper around gsk_transform_print(), see that function
for details.
A new string for @self
a #GskTransform
Converts a #GskTransform to a translation operation.
@self must be a 2D transformation. If you are not
sure, use gsk_transform_get_category() >=
%GSK_TRANSFORM_CATEGORY_2D_TRANSLATE to check.
a #GskTransform
return location for the translation
in the x direction
return location for the translation
in the y direction
Applies all the operations from @other to @next.
The new matrix
Transform to apply @other to
Transform to apply
Transforms a #graphene_rect_t using the given matrix @m. The
result is the bounding box containing the coplanar quad.
a #GskTransform
a #graphene_rect_t
return location for the bounds
of the transformed rectangle
Translates @next in 2dimensional space by @point.
The new matrix
the next transform
the point to translate the matrix by
Translates @next by @point.
The new matrix
the next transform
the point to translate the matrix by
Releases a reference on the given #GskTransform.
If the reference was the last, the resources associated to the @self are
freed.
a #GskTransform
Gets the child node that is getting transformed by the given @node.
The child that is getting transformed
a transform @GskRenderNode
Creates a #GskRenderNode that will transform the given @child
with the given @transform.
A new #GskRenderNode
The node to transform
The transform to apply
Parses the given @string into a transform and puts it in
@out_transform. Strings printed via gsk_transform_to_string()
can be read in again successfully using this function.
If @string does not describe a valid transform, %FALSE is
returned and %NULL is put in @out_transform.
%TRUE if @string described a valid transform.
the string to parse
The location to put the transform in
The categories of matrices relevant for GSK and GTK. Note that any
category includes matrices of all later categories. So if you want
to for example check if a matrix is a 2D matrix,
`category >= GSK_TRANSFORM_CATEGORY_2D` is the way to do this.
Also keep in mind that rounding errors may cause matrices to not
conform to their categories. Otherwise, matrix operations done via
mutliplication will not worsen categories. So for the matrix
multiplication `C = A * B`, `category(C) = MIN (category(A), category(B))`.
The category of the matrix has not been
determined.
Analyzing the matrix concluded that it does
not fit in any other category.
The matrix is a 3D matrix. This means that
the w column (the last column) has the values (0, 0, 0, 1).
The matrix is a 2D matrix. This is equivalent
to graphene_matrix_is_2d() returning %TRUE. In particular, this
means that Cairo can deal with the matrix.
The matrix is a combination of 2D scale
and 2D translation operations. In particular, this means that any
rectangle can be transformed exactly using this matrix.
The matrix is a 2D translation.
The matrix is the identity matrix.
Creates a #GskRenderNode that will use @blend_mode to blend the @top
node onto the @bottom node.
A new #GskRenderNode
The bottom node to be drawn
The node to be blended onto the @bottom node
The blend mode to use
Creates a render node that blurs the child.
the child node to blur
the blur radius
Creates a #GskRenderNode that will stroke a border rectangle inside the
given @outline. The 4 sides of the border can have different widths and
colors.
A new #GskRenderNode
a #GskRoundedRect describing the outline of the border
the stroke width of the border on
the top, right, bottom and left side respectively.
the color used on the top, right,
bottom and left side.
Creates a Cairo context for drawing using the surface associated
to the render node.
If no surface exists yet, a surface will be created optimized for
rendering to @renderer.
a Cairo context used for drawing; use
cairo_destroy() when done drawing
a cairo #GskRenderNode
Creates a #GskRenderNode that will render a cairo surface
into the area given by @bounds. You can draw to the cairo
surface using gsk_cairo_node_get_draw_context()
A new #GskRenderNode
the rectangle to render to
Gets the child node that is getting clipped by the given @node.
The child that is getting clipped
a clip @GskRenderNode
Creates a #GskRenderNode that will clip the @child to the area
given by @clip.
A new #GskRenderNode
The node to draw
The clip to apply
Gets the child node that is getting its colors modified by the given @node.
The child that is getting its colors modified
a color matrix @GskRenderNode
Creates a #GskRenderNode that will drawn the @child with reduced
@color_matrix.
In particular, the node will transform the operation
pixel = color_matrix * pixel + color_offset
for every pixel.
A new #GskRenderNode
The node to draw
The matrix to apply
Values to add to the color
Creates a #GskRenderNode that will render the color specified by @rgba into
the area given by @bounds.
A new #GskRenderNode
a #GdkRGBA specifying a color
the rectangle to render the color into
Gets one of the children of @container.
the @idx'th child of @container
a container #GskRenderNode
the position of the child to get
Retrieves the number of direct children of @node.
the number of children of the #GskRenderNode
a container #GskRenderNode
Creates a new #GskRenderNode instance for holding the given @children.
The new node will acquire a reference to each of the children.
the new #GskRenderNode
The children of the node
Number of children in the @children array
Creates a #GskRenderNode that will do a cross-fade between @start and @end.
A new #GskRenderNode
The start node to be drawn
The node to be cross_fadeed onto the @start node
How far the fade has progressed from start to end. The value will
be clamped to the range [0 ... 1]
Gets the child node that is getting debug by the given @node.
The child that is getting debug
a debug @GskRenderNode
Gets the debug message that was set on this node
The debug message
a debug #GskRenderNode
Creates a #GskRenderNode that will add debug information about
the given @child.
Adding this node has no visual effect.
A new #GskRenderNode
The child to add debug info for
The debug message
Creates a #GskRenderNode that will render an inset shadow
into the box given by @outline.
A new #GskRenderNode
outline of the region containing the shadow
color of the shadow
horizontal offset of shadow
vertical offset of shadow
how far the shadow spreads towards the inside
how much blur to apply to the shadow
Creates a #GskRenderNode that will create a linear gradient from the given
points and color stops, and render that into the area given by @bounds.
A new #GskRenderNode
the rectangle to render the linear gradient into
the point at which the linear gradient will begin
the point at which the linear gradient will finish
a pointer to an array of #GskColorStop defining the gradient
the number of elements in @color_stops
Gets the child node that is getting opacityed by the given @node.
The child that is getting opacityed
a opacity @GskRenderNode
Creates a #GskRenderNode that will drawn the @child with reduced
@opacity.
A new #GskRenderNode
The node to draw
The opacity to apply
Creates a #GskRenderNode that will render an outset shadow
around the box given by @outline.
A new #GskRenderNode
outline of the region surrounded by shadow
color of the shadow
horizontal offset of shadow
vertical offset of shadow
how far the shadow spreads towards the inside
how much blur to apply to the shadow
Creates a #GskRenderNode that will repeat the drawing of @child across
the given @bounds.
A new #GskRenderNode
The bounds of the area to be painted
The child to repeat
The area of the child to repeat or %NULL to
use the child's bounds
Creates a #GskRenderNode that will create a repeating linear gradient
from the given points and color stops, and render that into the area
given by @bounds.
A new #GskRenderNode
the rectangle to render the linear gradient into
the point at which the linear gradient will begin
the point at which the linear gradient will finish
a pointer to an array of #GskColorStop defining the gradient
the number of elements in @color_stops
Gets the child node that is getting clipped by the given @node.
The child that is getting clipped
a clip @GskRenderNode
Creates a #GskRenderNode that will clip the @child to the area
given by @clip.
A new #GskRenderNode
The node to draw
The clip to apply
Creates a #GskRenderNode that will draw a @child with the given
@shadows below it.
A new #GskRenderNode
The node to draw
The shadows to apply
number of entries in the @shadows array
Creates a render node that renders the given glyphs,
Note that @color may not be used if the font contains
color glyphs.
a new text node, or %NULL
the #PangoFont containing the glyphs
the #PangoGlyphString to render
the foreground color to render with
the x coordinate at which to put the baseline
the y coordinate at wihch to put the baseline
the #GdkTexture
a #GskRenderNode
Creates a #GskRenderNode that will render the given
@texture into the area given by @bounds.
A new #GskRenderNode
the #GdkTexture
the rectangle to render the texture into
Gets the child node that is getting transformed by the given @node.
The child that is getting transformed
a transform @GskRenderNode
Creates a #GskRenderNode that will transform the given @child
with the given @transform.
A new #GskRenderNode
The node to transform
The transform to apply
Parses the given @string into a transform and puts it in
@out_transform. Strings printed via gsk_transform_to_string()
can be read in again successfully using this function.
If @string does not describe a valid transform, %FALSE is
returned and %NULL is put in @out_transform.
%TRUE if @string described a valid transform.
the string to parse
The location to put the transform in