Commit Graph

77644 Commits

Author SHA1 Message Date
Matthias Clasen
4b00cfc1ce Merge branch 'macos_ci' into 'main'
Disable macOS CI for forks

See merge request GNOME/gtk!6337
2023-08-26 11:43:57 +00:00
Matthias Clasen
889688c978 Add more fill and stroke node tests 2023-08-26 07:39:23 -04:00
Matthias Clasen
0bf1ae033d Document node format for stroke and fill nodes 2023-08-26 07:39:23 -04:00
Jordi Mas
994afcaeed Update Catalan translation 2023-08-26 09:50:31 +02:00
Matthias Clasen
b69cc832ef Merge branch 'path-tool-restrict' into 'main'
path-tool: Add a restrict command

See merge request GNOME/gtk!6340
2023-08-26 04:24:06 +00:00
Matthias Clasen
ca188b41ae post-release version bump 2023-08-25 22:29:09 -04:00
Matthias Clasen
81c8d1dd28 path-tool: Add length to info output
This requires GskPathMeasure.
2023-08-25 22:26:54 -04:00
Matthias Clasen
32d00ca9ed path-tool: Add a restrict command
This lets you subset a path between two given lengths.
2023-08-25 22:26:54 -04:00
Matthias Clasen
01b9997590 4.13.0 2023-08-25 22:21:27 -04:00
Matthias Clasen
677e19042d Docs: Cosmetics 2023-08-25 22:21:27 -04:00
Matthias Clasen
bd79f61cc5 pathpoint: Update the docs
We have gained some more ways of getting points.
2023-08-25 22:03:42 -04:00
Matthias Clasen
361cdecfe4 Merge branch 'path-measure-reredone' into 'main'
Add GskPathMeasure

See merge request GNOME/gtk!6326
2023-08-26 01:05:19 +00:00
Matthias Clasen
581ad5fc04 Make curve tests more robust
Add a few fudge factors that let these
tests survive extended runs.
2023-08-25 20:23:08 -04:00
Matthias Clasen
ff40dcffec Make the measure tests waste less time
No need to produce multiple contours, when
the test is just about splitting a single
curve.
2023-08-25 20:23:08 -04:00
Matthias Clasen
eb2fa4195a Make the measure tests run in ci
Marking them as slow has the unintended
side-effect of keeping them from running.
2023-08-25 20:23:08 -04:00
Benjamin Otte
e2d2b57f0e demos: Add a text-on-path demo 2023-08-25 20:23:08 -04:00
Matthias Clasen
6c1a128ea3 Make the map demo more interesting
Add marching arrows to it.

With this, it can also serve as a performance
test for rendering medium complexity paths.
2023-08-25 20:23:08 -04:00
Matthias Clasen
cfaa31eeb8 Expand docs for GskPathMeasure 2023-08-25 20:23:08 -04:00
Matthias Clasen
2097b15f9c Add randomized measure tests
Test that lengths behave as expected when
we split paths, do roundtrips through points,
and subset paths.
2023-08-25 20:16:49 -04:00
Matthias Clasen
46a8f57735 Add tests for path length 2023-08-25 20:16:49 -04:00
Matthias Clasen
2e5639a077 Add a circle test 2023-08-25 20:16:49 -04:00
Matthias Clasen
007cfeac94 Add GskPathMeasure
GskPathMeasure is the public API for path lengths.
2023-08-25 20:16:49 -04:00
Matthias Clasen
553499522c contour: Add measure API
In order to compute path lengths efficiently, we need
to cache lookup tables. This commit adds API to let
contours allocate and free such measure data, as well
as API to use the data to go length -> point and
vice versa.
2023-08-25 20:16:49 -04:00
René de Hesselle
2782daadb4 ci: Do not create macOS jobs for forks
The runner is not available in forks (on purpose / for security
reasons), so jobs created there will be stuck indefinitely until they
timeout and fail the pipeline, which is undesireable.

That also means that the initial goal to enable macOS jobs for all MRs
is out of reach: if you are an external contributor (read: non-project
member), your MR pipelines run in your fork, therefore have no access
to the runner.
2023-08-26 01:56:59 +02:00
Benjamin Otte
81821978ae Merge branch 'wip/otte/for-main' into 'main'
gltexture: Restore previous GL context

See merge request GNOME/gtk!6335
2023-08-25 21:44:17 +00:00
Matthias Clasen
787b1a661e curve: Add tests for length
Add some tests for gsk_curve_get_length.
2023-08-25 16:13:36 -04:00
Matthias Clasen
04e6fc3f74 curve: Add length computation
Add api to go t<>length.

The code here is inspired by
https://pomax.github.io/bezierinfo/#arclength
2023-08-25 16:13:36 -04:00
Benjamin Otte
54d2f0063a Merge branch 'replay' into 'main'
Node replay tests

See merge request GNOME/gtk!6299
2023-08-25 19:45:34 +00:00
Benjamin Otte
ae7ec40cf2 rendernodeparser: Generate better default child
... for fill and stroke nodes.

It's most likely we want the path bounds (or path stroke bounds),
so make the parser use those by default.
2023-08-25 21:12:12 +02:00
Matthias Clasen
d586a5c67c Merge branch 'fix-gears-demo' into 'main'
demo: Fix a bug without GL

Closes #6059

See merge request GNOME/gtk!6333
2023-08-25 14:34:13 +00:00
Matthias Clasen
c97dc6e903 Merge branch 'conics-revisited' into 'main'
path: Switch back to conics

See merge request GNOME/gtk!6332
2023-08-25 14:26:33 +00:00
Matthias Clasen
eec90d1026 pathbuilder: Add rel-variants for arc-to
Add rel-variants for all our arc-to APIs. This is
a pretty harmless addition, and it is more consistent
to have these for all ..._to functions.
2023-08-25 09:45:45 -04:00
Matthias Clasen
f4fb4d04e5 Some pathbuilder doc clarifications
Mention the end point of the html arc-to call.
2023-08-25 09:37:07 -04:00
Matthias Clasen
3283157352 Bring arc_to back as convenience API
It is our main use of conics, so make it an API,
and use it internally.
2023-08-25 09:31:19 -04:00
Sergey Bugaev
d07a6b8566 snapshot, gsktransform: Mention that rotation happens around (0, 0)
...and not around the center of the render node, as one could expect
given that the render node syntax for rotation, transform: rotate(90);,
happens to match the CSS syntax for the same thing, and CSS does rotate
around the center by default.

Signed-off-by: Sergey Bugaev <bugaevc@gmail.com>
2023-08-25 15:54:05 +03:00
Sergey Bugaev
4e8e59cd58 snapshot: Fix push_repeat () with empty child bounds
The logic would confuse empty child bounds (in which case nothing should
get rendered) with NULL child bounds (in which case the child node's own
bounds should get used). In fact, if the child bounds are empty, we can
discard the descendant render nodes completely, getting a nice little
optimization.

Signed-off-by: Sergey Bugaev <bugaevc@gmail.com>
2023-08-25 15:54:05 +03:00
Sergey Bugaev
9f811ccee5 testsuite: Add color-matrix-merge testcase
This tests the merging of nested color matrix nodes feature of
GtkSnapshot, which was broken before commit 082fdfdb24.

Signed-off-by: Sergey Bugaev <bugaevc@gmail.com>
2023-08-25 15:54:05 +03:00
Sergey Bugaev
6cd6da050b testsuite: Add render node replay tests
This takes a render node tree and "replays" it by using the GtkSnapshot
machinery. We don't necesserily expect to get back an exactly equal
render node tree back, since GtkSnapshot applies various small
optimizations where possible, but the original and the replayed nodes
should render to identical textures.

Signed-off-by: Sergey Bugaev <bugaevc@gmail.com>
2023-08-25 15:54:05 +03:00
Matthias Clasen
a906dbea35 demo: Fix a bug without GL
The gears widget was just not unrealizing properly
when GL is not available. Fix that.

Fixes: #6059
2023-08-25 08:37:22 -04:00
Matthias Clasen
5bc82f4141 Change curve derivative api
We don't need to have the derivative as a curve,
it is enough for us to compute values of the
derivative at a given t, which we can also do
for conics.
2023-08-25 07:33:16 -04:00
Matthias Clasen
25e6231a88 path: Switch back to conics
Arcs were appealing, but they have a fatal flaw: we can't
split our arcs without changing the ellipse they trace.
That could be fixed by adding an extra parameter, but then
it is no longer any better than conics.

So switch back to conics, which have the advantage that they
are used elsewhere.
2023-08-25 07:33:16 -04:00
Matthias Clasen
650e4b1920 Merge branch 'matthiasc/for-main' into 'main'
path docs: Clarify curvature

See merge request GNOME/gtk!6331
2023-08-24 19:55:36 +00:00
Matthias Clasen
5dc0cbc20f Expand the path docs a bit 2023-08-24 15:00:14 -04:00
Matthias Clasen
e1faf28310 Make curvature api more flexible
Add an extra direction argument to get_curvature to
allow picking the limit on either side, for sharp turns.

Update all callers.
2023-08-24 14:32:33 -04:00
Matthias Clasen
854c695153 pathpoint docs: Fix a link
Links gsk->gtk must be done manually, since we
don't have a dependency.
2023-08-24 13:41:39 -04:00
Matthias Clasen
ebd4ceca15 path docs: Clarify curvature
The curvature of lines is zero, not infinite.
2023-08-24 11:15:51 -04:00
Matthias Clasen
d873643407 path docs: Add another illustration 2023-08-24 11:09:28 -04:00
Matthias Clasen
8a789d0234 path docs: Cosmetics 2023-08-24 10:54:23 -04:00
Emmanuele Bassi
286b4cbc72 Merge branch 'macos_ci' into 'main'
interim solution for macOS CI

See merge request GNOME/gtk!6274
2023-08-24 14:10:03 +00:00
René de Hesselle
b4428029af Change workflow to enable MR pipelines
This makes it possible to have macOS CI run for everything inside the
main repository and for merge requests.
2023-08-24 15:30:03 +02:00