Commit Graph

77257 Commits

Author SHA1 Message Date
Benjamin Otte
7e66dfe902 pathbuilder: Rename "builder" variables to "self"
This is a pure find/replace that is now possible after
the split in the previous commit.
2023-07-31 16:51:04 +02:00
Benjamin Otte
7bc6fabbf7 path: Split GskPathBuilder into its own file
... and add missing API docs.
2023-07-31 16:51:04 +02:00
Benjamin Otte
26c8702400 testsuite: Add a test using get_point() and get_closest_point() 2023-07-31 16:51:04 +02:00
Benjamin Otte
1b7c4420dc testsuite: Add a test for get_point() 2023-07-31 16:51:04 +02:00
Benjamin Otte
ece3153b1f testsuite: Update create_random_path()
1. Allow specifying the max number of contours
2. Be smarter about creating the paths:
   With 10% chance, create a "weird" path like the empty one or only
   points or things like that.
   Otherwise create a bunch of contours, with 2/3 a standard contour,
   with 1/3 a predetermined one.
2023-07-31 16:51:04 +02:00
Benjamin Otte
74dc039c7a gtk-demo: Add cute maze demo 2023-07-31 16:51:04 +02:00
Benjamin Otte
3e1c3aca2a testsuite: Add tests for gsk_path_measure_get_closest_point() 2023-07-31 16:51:04 +02:00
Benjamin Otte
51bc26b314 path: Add gsk_path_measure_get_closest_point()
... and gsk_path_measure_get_closest_point_full().

Those 2 functions allow finding the closest point on a path to a given
point.
2023-07-31 16:51:04 +02:00
Benjamin Otte
51a1adf312 spline: Use Skia's tolerance checks
This avoids measuring being too far off (it's still off, but it's less
than a percent now.
2023-07-31 16:51:04 +02:00
Benjamin Otte
d84132824f testsuite: Add tests for gsk_path_measure_add_segment() 2023-07-31 16:51:03 +02:00
Benjamin Otte
ffecc89352 gtk-demo: Add a text-on-path demo 2023-07-31 16:51:03 +02:00
Benjamin Otte
77518895ea demos: Add a simple demo filling a path 2023-07-31 16:51:03 +02:00
Benjamin Otte
9685a47693 path: Add gsk_path_measure_get_point()
Allows querying the coordinates and direction of any specific point on a
path.
2023-07-31 16:51:03 +02:00
Matthias Clasen
7f9825919c path: Add gsk_path_add_circle()
Adds a circle contour, too.
2023-07-31 16:51:03 +02:00
Benjamin Otte
2795fc53c1 pathmeasure: Implement support for beziers
Instead of treating bezier curves as lines, we properly decompose them
into line segments now so that we can treat those as lines.
2023-07-31 16:51:03 +02:00
Benjamin Otte
20ba4a225c path: Implement gsk_path_to_cairo() using foreach() 2023-07-31 16:51:03 +02:00
Benjamin Otte
eadbfc3433 path: Add gsk_path_foreach() 2023-07-31 16:51:03 +02:00
Benjamin Otte
b8ee48de63 path: Collect flags
We don't need them yet, but maybe later.
2023-07-31 16:51:03 +02:00
Benjamin Otte
25a5a8a85d testsuite: Add path tests 2023-07-31 16:51:03 +02:00
Benjamin Otte
5e1170bdb2 pathmeasure: Add gsk_path_measure_add_segment()
This allows chunking paths, weeee.
2023-07-31 16:51:03 +02:00
Benjamin Otte
f6bf74e2c9 path: Add gsk_path_builder_add_path() 2023-07-31 16:51:03 +02:00
Benjamin Otte
fa51c2eb0e gsk: Add GskPathMeasure
An object to do measuring operations on paths - determining their
length, cutting off subpaths, things like that.
2023-07-31 16:51:03 +02:00
Benjamin Otte
d34f1bbd6c path: Change data structure for standard path
Instead of the Cairo method and imitating cairo_path_data_t, use the
Skia method and keep points and operations separate.

That way we get a points array that includes the starting point -
because it's always the end point of the previous operation.
2023-07-31 16:51:03 +02:00
Benjamin Otte
8fd55e9f89 snapshot: Add gtk_snapshot_push_stroke() 2023-07-31 16:51:03 +02:00
Benjamin Otte
be4beeb8f2 gsk: Add GskStrokeNode 2023-07-31 16:51:03 +02:00
Benjamin Otte
09288f621a gsk: Add GskStroke
It's unused in this commit. This just prepares the new object.
2023-07-31 16:51:03 +02:00
Benjamin Otte
3ec3727575 snapshot: Add gtk_snapshot_push_fill() 2023-07-31 16:51:03 +02:00
Benjamin Otte
77e58d4463 rendernode: Implement fast-path for solid fills
They happen so often that it's worth avoiding the clip + paint path
there.
2023-07-31 16:51:03 +02:00
Benjamin Otte
bb58b504a6 gsk: Add GskFillNode
Take a rendernode as source and a GskPath and fill the region in the
path just like cairo_fill() would.
2023-07-31 16:51:03 +02:00
Benjamin Otte
f6bb568e91 gsk: Add GskPath 2023-07-31 16:51:03 +02:00
Benjamin Otte
efbb3ab535 xxx: benchmarking 2023-07-31 16:51:03 +02:00
Benjamin Otte
e00e6f3d5d vulkan: Clear Cairo surfaces on upload
The memory isn't guaranteed to be all zeroes and we don't want glitches.
2023-07-31 16:51:03 +02:00
Benjamin Otte
e98ae233fc vulkan: Fix a memleak 2023-07-31 16:51:03 +02:00
Benjamin Otte
2ad11e12d4 vulkan: Plug a memleak
Yay, we no longer leak swapchain images
2023-07-31 16:51:03 +02:00
Benjamin Otte
3f16f7e0d4 rendernode-tool: Add another magic format
Make .svg use the Cairo renderer to save to an SVG file.

It's useful when comparing rendering behavior and times with
web browsers (as long as one is aware that browsers build a full
DOM tree out of those SVGs).
2023-07-31 16:51:03 +02:00
Benjamin Otte
166777dd55 rendernode-tool: Move code
No functional changes yet.
2023-07-31 16:51:03 +02:00
Benjamin Otte
c8f385e3bc vulkancontext: Do proper refcounting
- fix a memleak
- call unref() instead of new()
- remove idle handler on dispose

What was I doing when I wrote the pipeline cache code?
2023-07-31 16:51:03 +02:00
Benjamin Otte
89b4f12b38 vulkan: Plug a memleak 2023-07-31 16:51:03 +02:00
Benjamin Otte
ae509406f1 memorytexture: Add a check
Sophie Herold was running into this problem while coding, so let's help
people by catching it early.
2023-07-31 16:51:03 +02:00
Benjamin Otte
1aa7f18b23 vulkan: Remove unused variable
It's only used when printing debug stuff. Debug stuff is not that
important.
2023-07-31 16:51:03 +02:00
Benjamin Otte
cf39c80fe2 docs: Update for recent rendernode-tool changes 2023-07-31 16:51:03 +02:00
Matthias Clasen
9685030632 Merge branch 'gtk-wip/inactive-state' into 'main'
gtk: Add suspended window state

See merge request GNOME/gtk!6221
2023-07-30 11:39:49 +00:00
Matthias Clasen
327c93066d build: Don't require bleeding-edge wayland-protocols
The 1.32 wayland-protocols release is not in distribution
builds yet, so a hard dependency on it is not helpful.
2023-07-30 11:40:09 +03:00
Jonas Ådahl
7f946eff01 gtk: Add suspended window state
This is implemented using a new xdg_toplevel `suspended` state, and is
meant for allowing applications to know when they can stop doing
unnecessary work and thus save power.

In the other backends, the `suspended` state is set at the same time as
`minimized` as it's the closest there is to traditional windowing
systems.
2023-07-30 11:40:09 +03:00
Benjamin Otte
03a8b9cf17 Merge branch 'no-list-items' into 'main'
listitemmanager: Handle null roots in get_nearest_tile

Closes #5970

See merge request GNOME/gtk!6220
2023-07-29 23:15:13 +00:00
tszymanski
657c018242 listitemmanager: Handle null roots in get_nearest_tile
Rubberbanding still fails with "No item" warnings, but it no longer
crashes.

Closes #5970
2023-07-28 19:12:46 -07:00
Danial Behzadi
83db8e41a6 Update Persian translation 2023-07-29 01:58:52 +00:00
Yuri Chornoivan
57e7112781 Update Ukrainian translation 2023-07-28 17:32:38 +00:00
Yuri Chornoivan
96f92ee207 Update Ukrainian translation 2023-07-28 17:31:22 +00:00
Matthias Clasen
5c8bd49383 Merge branch 'matthiasc/for-main' into 'main'
glyph cache: Add debug output

See merge request GNOME/gtk!6163
2023-07-28 08:51:14 +00:00