| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
This commit adds gsk_transform_perspective(), gtk_snapshot_perspective()
and support for perspective() in the CSS syntax.
|
|
|
|
| |
The renaming of the prefix makes this a large patch.
|
|
|
|
| |
It's all using transforms now.
|
|
|
|
|
|
|
|
|
| |
Instead of gtk_snapshot_offset(), provide a full set of functions
kept in sync with GtkTransform APIs.
On top of that, add gtk_snapshot_save() and gtk_snapshot_restore()
mirroring cairo_save()/restore() that allow saving a snapshot's
transform state.
|
|
|
|
| |
We use append() functions for everything now, thank you very much.
|
| |
|
|
|
|
| |
This is adding functions for the remaining render nodes.
|
|
|
|
|
|
| |
We're already doing this in gtktypes.h
Fixes #214
|
|
|
|
|
| |
Instead of every snapshot function having debug messages, have an
explicit gtk_snapshot_push_debug() function that appends a debug node.
|
|
|
|
|
|
|
|
|
|
| |
If widgets want to clip things, they now need to do it themselves.
By not taking care of clip, we avoid the need to track clip. And by not
tracking clip, we can avoid all unnecessary cache invalidations that we
were doing for render nodes whenever the clip changed.
And when you are scrolling, the clip changes *a lot*.
|
|
|
|
|
|
|
|
|
|
|
| |
This allows being more specific about the size.
It's useful in particular when the resulting render nodes might be
too small for the size, not only when they are too large. For the
latter case, using a clip node would be enough.
It also requires adding a clip node when rendering the resulting
paintable, but that should be optimized out by GtkSnapshot when not
necessary.
|
| |
|
|
|
|
|
| |
It's not used anymore. And anybody who wants to have a clip on a
newly created snapshot can achieve that using gtk_snapshot_push_clip().
|
|
|
|
| |
This is intended for DND icons
|
|
|
|
|
|
|
| |
This is the equivalent snapshot function to pango_cairo_show_layout().
Not to be confused with gtk_snapshot_render_layout(), which is the
equivalent to gtk_render_layout().
|
|
|
|
|
| |
Now that there's no longer a need to keep the renderer around for Cairo
rendering, don't do that then.
|
|
|
|
|
|
|
| |
This makes GdkSnapshot the base class for GtkSnapshot and hopefully
stops confusing bindings.
C code should see no difference to before.
|
| |
|
|
|
|
|
| |
These getters can be useful when creating new snapshots
in a snapshot() vfunc.
|
|
|
|
|
|
| |
Make GtkSnapshot a refcounted boxed type, and add
public API that follows the builder pattern described
here: https://blogs.gnome.org/otte/2018/02/03/builders/
|
|
|
|
|
|
|
| |
Remove all the old 2.x and 3.x version annotations.
GTK+ 4 is a new start, and from the perspective of a
GTK+ 4 developer all these APIs have been around since
the beginning.
|
|
|
|
|
|
| |
This way, we can also clip the created node bounds to the current clip
of the GtkSnapshot. This works as long as we don't modify the start and
end points, and happens all the time while rendering.
|
|
|
|
|
| |
Its not used, and we are working towards removing
GdkPixbuf in the API.
|
|
|
|
| |
We want this thing to replace GdkPixbuf, so it has to live in GDK.
|
|
|
|
|
| |
This function is similar to the other push functions.
This one uses the newly created blur node.
|
|
|
|
| |
It's now called gtk_snapshot_offset().
|
|
|
|
|
|
| |
Instead of having gtk_snapshot_append_foo_node(), just have
gtk_snapshot_append_foo(). Nobody needs to know that this internally
uses nodes.
|
|
|
|
|
|
|
|
| |
gtk_snapshot_pop() => removed
gtk_snapshot_pop_and_append() => gtk_snapshot_pop()
So now there is no way to get a rendernode out of the snapshotting API
until you gtk_snapshot_finish().
|
|
|
|
| |
and use it for backgrounds.
|
|
|
|
|
|
|
|
| |
... and use it.
The function is a bit awkward because it requires 2 calls to
gtk_snapshot_pop(), but once you accept that, it's very convenient to
use, as can be seen by the 2 implementations.
|
|
|
|
|
|
|
|
|
|
|
|
| |
We already take ints when setting the translation, so it can't
currently take any other values. Additionally, I was seeing large
costs in int -> double -> int for the rects in
gtk_snapshot_clips_rect(), as all callers really are ints (widget
allocations) and the clip region is int-based.
This change completely cleared a 2% rectangle_init_from_graphene from
the profile and is likely to have nice performance effects elsewhere
too.
|
|
|
|
|
|
|
| |
Also add gtk_snapshot_push_repeat() and use that to draw backgrounds.
With that change, CSS background snapshots are created without Cairo
nodes.
|
|
|
|
| |
So far, this is unused.
|
|
|
|
|
|
|
| |
... and make the icon rendering code use it.
This requires moving even more shadow renering code into GSK, but so be
it. At least the "shadows not implemented" warning is now gone!
|
|
|
|
| |
Use it in GtkWidget's opacity handling.
|
|
|
|
| |
Also add support to GtkSnapshot, so people can push rounded clips.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
It is now possible to call push() subfunctions for simple container
nodes with just a single child. So you can for example
gtk_snapshot_push_clip() a clip region that all the nodes that get
appended later will then obey.
gtk_snapshot_pop() will then not return a container node, but a clip
node containing the container node (and similar for the transform
example).
This is implemented internally by providing a "collect function" when
pushing that is called when popping to collects all the accumulated
nodes and combine them into the single node that gets returned.
To simplify things even more, gtk_snapshot_pop_and_append() has been
added, which pops the currently pushed node and appends it to the
parent.
The icon rendering code has been converted to this approach.
|
|
|
|
|
| |
Public API doesn't need to be concerned with renderers. Worst case, they
can use NULL instead of the actual renderer.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Instead of appending a container node and adding the nodes to it as they
come in, we now collect the nodes until gtk_snapshot_pop() is called and
then hand them out in a container node.
The caller of gtk_snapshot_push() is then responsible for doing whatever
he wants with the created node.
Another addigion is the keep_coordinates flag to gtk_snapshot_push()
which allows callers to keep the current offset and clip region or
discard it. Discarding is useful when doing transforms, keeping it is
useful when inserting effect nodes (like the ones I'm about to add).
|
|
|
|
|
|
|
|
|
|
| |
Instead of having a setter for the transform, have a GskTransformNode.
Most of the oprations that GTK does do not require a transform, so it
doesn't make sense to have it as a primary attribute.
Also, changing the transform requires updating the uniforms of the GL
renderer, so we're happy if we can avoid that.
|
|
|
|
|
|
|
| |
gsk_render_node_get_bounds() still exists and is computed via vfunc
call:
- containers dynamically compute the bounds from their children
- surface and texture nodes get bounds passed on construction
|
|
|
|
|
| |
It does not make sense to append an empty container node. Those should
only be push()'d.
|
|
|
|
|
|
|
| |
We want to split nodes into containers and nodes that do actual drawing.
So pushing nodes that do drawing is exactly the wrong thing.
Also fix up GtkPopover. There's no need for it to push anything.
|
| |
|
|
|
|
|
| |
Remove various no-longer-existing functions from the sections
file, and exclude more private headers, etc.
|
|
|
|
| |
gtk-doc gets upset otherwise.
|
|
|
|
|
|
| |
Adds a bunch of new APIs to render textures with theming.
FIXME: Cannot draw shadows for textures.
|
|
|
|
| |
Also adds gtk_snapshot_render_insertion_cursor().
|
|
|
|
|
| |
Included is the addition of gtk_snapshot_render_layout(), which is meant
to replace gtk_render_layout().
|