Commit Graph

77818 Commits

Author SHA1 Message Date
Matthias Clasen
360b77cc50 curve: Add a vfunc for get_at_length
We can do this precisely for lines, so lets do it.
2023-08-29 22:09:59 -04:00
Matthias Clasen
1186eff1b7 Merge branch 'gtk-compose-test-case-single-char' into 'main'
composetable: Accept short compose sequences

See merge request GNOME/gtk!6358
2023-08-29 19:46:00 +00:00
Matthias Clasen
0b8582ccba Merge branch 'gsk-header-cleanup' into 'main'
gsk: Clean up standalone headers

See merge request GNOME/gtk!6364
2023-08-29 19:11:36 +00:00
Matthias Clasen
dc2914e1f9 composetable: Warn for things we can't handle
The compose table stores the keyvals to match against
in a guint16 array, so it can't handle directly encoded
Unicode codepoints (which have a high bit set). Warn
if we encounter those.
2023-08-29 13:32:32 -04:00
Matthias Clasen
a0d8678a9c composetable: Accept short compose sequences
Followup to 8931169e00. That commit did
not do enough work to actually accept sequences
of lenth 1, as pointed by Mike Fabian.
2023-08-29 13:30:05 -04:00
Mike FABIAN
c8a43da526 Add test case for single char compose sequence 2023-08-29 13:30:05 -04:00
Matthias Clasen
90ee05ae64 gsk: Clean up standalone headers
We require folks to include gskglrenderer.h in order
to create a GL renderer. So we be careful to only
include header in gskglrenderer.h that won't trigger
ugly warnings.

See !6363
2023-08-29 12:58:30 -04:00
Matthias Clasen
67a7602080 Merge branch 'tests-svg-dimensions' into 'main'
testsuite/gsk: add explicit dimensions to <svg> elements

See merge request GNOME/gtk!6359
2023-08-29 04:43:22 +00:00
Matthias Clasen
37db270d19 Merge branch 'contour-foreach' into 'main'
Drop tolerance from gsk_contour_foreach

See merge request GNOME/gtk!6361
2023-08-29 01:58:39 +00:00
Matthias Clasen
f3312f677b measure: Cosmetics 2023-08-28 21:14:28 -04:00
Matthias Clasen
05547d98d6 path: Cosmetics
Reorganize this source file into sections.
2023-08-28 21:13:58 -04:00
Matthias Clasen
11b219bc61 Drop tolerance from gsk_contour_foreach
There is no decomposition going on for any contours,
and the tolerance argument is entirely unused.
Decomposition and tolerance is handled entirely
in gskpath.c by its trampoline.
2023-08-28 20:52:22 -04:00
Matthias Clasen
5721c3cb8f demos: Drop an unused variable 2023-08-28 20:50:38 -04:00
Fran Dieguez
f90ca697af Update Galician translation 2023-08-28 22:36:51 +00:00
Michael Orlitzky
7a0e27b6e8 testsuite/gsk: add explicit dimensions to <svg> elements
Without an explicit width, height, and viewBox, there is no single
correct way to render an SVG. In the absense of said information,
librsvg is capable of making a guess by rendering the SVG to a Cairo
surface and then analyzing that surface; however, this process is
merely heuristic.

There are three GTK tests for SVG images that are missing dimensions.
While this is not a violation of the SVG specification, it does
implicitly couple the test to the librsvg rendering heuristic. In this
commit we add that dimension information so that the expected result
is unambiguous.
2023-08-28 17:14:18 -04:00
Matthias Clasen
e81aa18c82 Merge branch 'closest-point-distance' into 'main'
Change gsk_path_get_closest_point to return distance

See merge request GNOME/gtk!6357
2023-08-28 15:53:51 +00:00
Matthias Clasen
827bbc0cc1 Change gsk_path_get_closest_point to return distance
We already compute it, so lets return it.
Bindings seems fine with this change - they
already return (success, point) as a tuple
anyway.
2023-08-28 11:22:30 -04:00
Matthias Clasen
7095a67910 Merge branch 'matthiasc/for-main' into 'main'
path-tool: Add a reverse command

See merge request GNOME/gtk!6356
2023-08-28 04:38:42 +00:00
Matthias Clasen
dcbca3f0d7 path-tool: Add a reverse command
It does what it says.
2023-08-28 00:27:29 -04:00
Matthias Clasen
702d7c238a Merge branch 'matthiasc/for-main' into 'main'
contour: Simplify gsk_circle_contour_foreach

See merge request GNOME/gtk!6355
2023-08-28 04:18:48 +00:00
Matthias Clasen
5a3ed65ad8 Improve precondition checks for path points
Add a helper function for checking that a
path point is valid for a path, and use it.
2023-08-28 00:07:50 -04:00
Matthias Clasen
2e24a9ece4 Make GskPathPoint public
The contents are still /*< private >*/, but we
let our tests and the debugger see them, which
helps.
2023-08-28 00:07:50 -04:00
Matthias Clasen
2a17320314 Limit rect variation in path builder
Make gsk_path_builder_add_rect always
produce a clockwise rectangle. This matches
what we do for circles and rounded rects,
which also go clockwise. Note that we
still need to allow negative widths in
the contour code, to implement reverse().
2023-08-28 00:07:50 -04:00
Matthias Clasen
0dbff14555 Allow circles with radius of zero
Not very useful, but we allow rects with
width and height of zero, so lets be consistent.
Curvature is infinite for such contours.

Tests included.
2023-08-28 00:07:50 -04:00
Matthias Clasen
c5d89d00f1 Merge branch 'zbrown/tooltips' into 'main'
tooltip: don't cross native boundaries

Closes #1234, #5998, gnome-calendar#1038, and nautilus#3063

See merge request GNOME/gtk!6346
2023-08-28 03:25:44 +00:00
Matthias Clasen
6f3be310f4 contour: Simplify gsk_circle_contour_foreach
Use the same approach as the rounded rect contour.
2023-08-27 21:31:40 -04:00
Matthias Clasen
0ea6b70d55 Merge branch 'matthiasc/for-main' into 'main'
gtk-demo: Add a few path benchmarks

See merge request GNOME/gtk!6353
2023-08-27 23:45:59 +00:00
Matthias Clasen
2ca9982b91 rect contour: Avoid nans in corner cases
The length of rect contours can be zero,
so we much check before we divide.
2023-08-27 19:17:02 -04:00
Matthias Clasen
a40282b2fb Add gsk_path_point_print
Another private debug API.
2023-08-27 19:06:39 -04:00
Matthias Clasen
ad9fb1e101 Improve quad and conic decomposition
If the control point is equal to either
start or end, just emit a line. This improves
the rendering of rounded rectangles with such
corners.
2023-08-27 16:57:03 -04:00
Matthias Clasen
02a9652af4 Use a more compact representation for circles
Print circles as M-o-o-o-o-z.
2023-08-27 14:32:21 -04:00
Matthias Clasen
6f823d2d0d gtk-demo: Add a few path benchmarks
The Tiger and Graph examples in the fishbowl test
path handling.
2023-08-27 12:59:10 -04:00
Matthias Clasen
a5c9cd5657 Merge branch 'rectangle-contour' into 'main'
Add a rectangle contour

See merge request GNOME/gtk!6351
2023-08-27 16:46:12 +00:00
Matthias Clasen
21ab5b6fa3 Merge branch 'matthiasc/for-main' into 'main'
Add a test for rectangle segments

See merge request GNOME/gtk!6352
2023-08-27 16:45:58 +00:00
Benjamin Otte
2582fd45e4 demos: Add cute maze demo 2023-08-27 12:45:25 -04:00
Matthias Clasen
0a28a5d53a Add a rectangle contour
Add a contour that optimizes some things for
rectangles. Also add rectangle detection to the
path parser, and add tests similar to what we
have for the other special contours.
2023-08-27 12:36:56 -04:00
Matthias Clasen
ddd4855bbc Add a test for rectangle segments 2023-08-27 12:36:30 -04:00
Matthias Clasen
204216e3d5 Merge branch 'matthiasc/for-main' into 'main'
Drop unused code

See merge request GNOME/gtk!6350
2023-08-27 16:19:16 +00:00
Matthias Clasen
1e6a124665 Correct the docs of gsk_path_builder_add_rect
The path does *not* always go clockwise!
2023-08-27 12:18:36 -04:00
Matthias Clasen
78c5aff956 Test special contours harder
Check that the start- and endpoint work
as expected and verify that their winding
numbers match the ones of the standard contour,
and are negated when the contour is reversed.
2023-08-27 11:47:40 -04:00
Matthias Clasen
8d1844135b path: Add a comment 2023-08-27 10:10:08 -04:00
Matthias Clasen
b5dd9dae0d rounded rect contour: Fix an oversight
The close operation takes 2 points, so our array
was one too short. Oops.
2023-08-27 10:09:32 -04:00
Matthias Clasen
ebcb518e4f Cosmetics 2023-08-27 09:50:16 -04:00
Matthias Clasen
b7ea22f168 Drop unused code
Nobody is calling gsk_contour_get_start_end, so drop
this internal API.
2023-08-27 09:39:59 -04:00
Matthias Clasen
f0b3381660 Merge branch 'rounded-rect-contour' into 'main'
path: Add a rounded rect contour

See merge request GNOME/gtk!6347
2023-08-27 13:36:53 +00:00
Matthias Clasen
0796c72049 Add roundtrip tests for rounded rect contours
These should survive roundtrips through the
path parser as well now.
2023-08-27 09:31:17 -04:00
Matthias Clasen
822e988efe path: Recognize rounded rects when parsing
We can look out for M-L-O-L-O-L-O-L-O-Z patterns
with matching numbers.
2023-08-27 09:31:17 -04:00
Matthias Clasen
cee043f977 Add a rounded rect contour
This special contour takes advantage of its
rounded-rect-ness for speeding up bounding
boxes and winding numbers. It falls back
to the standard contour code for everything
else.
2023-08-27 09:29:19 -04:00
Matthias Clasen
b420540b15 Merge branch 'matthiasc/for-main' into 'main'
Simplify the path spinner demo

See merge request GNOME/gtk!6349
2023-08-27 13:27:50 +00:00
Matthias Clasen
031c0ec3e5 pathpoint: Add some debug API
Add a private gsk_path_point_to_string that
can be called in the debugger if you want
to see the contents of a GskPathPoint and
are too lazy to cast it to GskRealPathPoint
yourself.
2023-08-27 09:14:47 -04:00