Matthias Clasen
957d494090
contour: Make circles and rounded rects match
...
Make sure that we print the weights in the
same way (as floats).
Update affected tests.
2023-09-17 20:32:32 -04:00
Matthias Clasen
f67c57b1f8
path: Fix parsing rounded rects
...
We were messing up the bottom left corner.
Test included.
2023-09-17 17:01:44 -04:00
Matthias Clasen
8f1d8d7cb5
path: Split off gskpathparse.c
...
This is a standalone piece of code,
and nicely fits into its own source file.
2023-09-17 12:29:46 -04:00
Matthias Clasen
5777587e7a
docs: Add details for GskPathBuilder
...
Mention that GskPathBuilder will simplify
added Bézier curves.
2023-09-17 09:31:59 -04:00
Matthias Clasen
7e13cfea91
path builder: Handle degenerate cubics
...
Replace cubics by lines or quadratics
when possible, and split at cusps.
2023-09-17 00:23:53 -04:00
Matthias Clasen
68b4d9c35e
Add gsk_curve_get_cusps
2023-09-17 00:23:53 -04:00
Matthias Clasen
1f3b69e7db
path builder: Handle degenerate conics
...
Do the same we do for quads here. Also,
conics with weight 1 are just quads.
2023-09-17 00:23:53 -04:00
Matthias Clasen
ca63552cf8
path builder: Handle degenerate quads
...
Quads that have a cusp need to be replaced by
two lines.
2023-09-17 00:23:53 -04:00
Matthias Clasen
a6d2d983b8
Add gsk_bounding_box_get_corner
...
This will be used in the following commits.
2023-09-16 21:57:31 -04:00
Matthias Clasen
7cd97192e5
pathbuilder: Simplify degenerate curves
...
When a quadratic or conic has identical points,
replace it with a line.
2023-09-16 14:32:12 -04:00
Matthias Clasen
4d71ff6da1
contour: Fixes for circles
...
Make circle contours use 'foreach coordinates' for
its points. This works here, but not for general
conics. As with the other custom contours, avoid
emitting collapsed conics.
2023-09-16 08:27:18 -04:00
Matthias Clasen
6d001f79f9
contour: Fixes for rounded rects
...
Similar to the fixes for rect contours:
Handle all the special cases where empty curves
are omitted, and omit 'empty' curves in foreach.
2023-09-15 16:31:09 -04:00
Matthias Clasen
abebd92b19
contour: Fixes for rect contours
...
Handle all the special cases (zero width and/or height),
and omit 'empty' curves in foreach.
2023-09-15 16:31:09 -04:00
Matthias Clasen
014ca76334
docs: Add details
...
Spell out what gsk_path_point_get_tangent does
if there is no tangent: we return 0,0.
2023-09-15 16:31:09 -04:00
Matthias Clasen
a520f9fcf7
pathbuilder: Skip trivial curves
...
Don't add quads, cubics or conics that collapse
to a single point. This matches what we do for
lines.
2023-09-15 16:31:09 -04:00
Matthias Clasen
de724b2a57
contour: Fix some corner cases
...
Adding segments of rects or rounded rects was
not working right in cases where some of the
curves are trivial. Fix that.
2023-09-15 16:31:09 -04:00
Matthias Clasen
061637f4eb
contour: Small refactoring
...
Move some utilities out.
2023-09-15 16:31:09 -04:00
Matthias Clasen
dab1897d4e
contour: Circle cosmetics
2023-09-15 16:31:09 -04:00
Benjamin Otte
5152c13081
vulkan: Change rounded_rect_shrink()
...
Same fix as with the GL renderer
2023-09-15 16:34:00 +02:00
Benjamin Otte
e9089f65e3
gl: Change rounded_rect_shrink()
...
The code now follows gsk_rounded_rect_shrink() and with it the behavior
of the Cairo renderer and Webkit.
The old code did what the GL renderer and Cairo do, but I consider that
wrong.
I did not test Chrome.
Test attached
2023-09-15 16:34:00 +02:00
Benjamin Otte
1c971c595f
glrenderer: Shadows without offset do exist
...
Not for opaque contents, but stuff can be semi-transparent.
Testcase included.
2023-09-15 03:46:27 +02:00
Benjamin Otte
f8627755b5
rendernode: Shadow nodes need offscreen for opacity
...
Otherwise the shadow will not be properly computed as opaque regions
become translucent after applying opacity.
Testcase included.
2023-09-15 03:46:27 +02:00
Benjamin Otte
55ae8dc39e
gsk: Move GskRoundedRect typedef
...
typedef should go into *types.h headers so that other headers only need
to include those.
2023-09-15 03:46:27 +02:00
Matthias Clasen
ec1a1d0e34
gl renderer: Don't assume an atlas
...
The source uniform may or may not point
to a glyph atlas. The optimization we do
for color nodes is only possible if it does,
so check this.
Fixes : #6094
2023-09-13 16:56:47 -04:00
Matthias Clasen
8f4fb45715
gl renderer: Keep track of source
...
We have an optimization that depends on having
the source be a glyph atlas, so keep track of
that information in the render job.
2023-09-13 16:55:01 -04:00
Matthias Clasen
1502c21e97
rendernode: Fix handling of color glyphs
...
The rendernode parser was mixing up its flags.
Test included.
Related: #6075
2023-09-13 15:37:57 -04:00
Benjamin Otte
a05a021fd1
rendernode: Fix Cairo rendering of repeating gradients
...
Cairo and the GL renderer have a different idea of how to handle
transitioning of colors outside the defined range.
Consider these stops:
black 50%, white 50%
What color is at 0%?
Cairo would transition between the last and first stop, ie it'd do a
white-to-black transition and end up at rgb(0.5,0.5,0.5) at 0%.
GL would behave as it would for non-repeating gradients and use black
for the range [0%..50%] and white for [50%..100%].
The web would rescale the range so the first stop would be at 0% and
the last stop would be at 100%, so this gradient would be illegal.
Considering that it's possible for code to transition between the
different behaviors by adding explicit stops at 0%/100%, I could choose
any method.
So I chose the simplest one, which is what the GL renderer does and
which treats repeating and non-repeating gradients the same.
Tests attached.
2023-09-07 16:19:20 +02:00
Benjamin Otte
9ffd7840ba
pathpoint: Add G_GNUC_EXTENSION to struct definition
...
This allows compilation with gcc -pedantic.
GTKmm uses this as part of their recommended compiler flags.
Fixes #6083
2023-09-07 16:19:20 +02:00
Matthias Clasen
ea7fd1ff5a
contour: Fixup for 1-point contours
...
If we return a path point for a 1-point contour,
make it { n, 0, 1 }.
2023-09-04 00:55:21 +02:00
Matthias Clasen
9bd9b6f2ca
contour: Make sure stroke bounds are sufficient
2023-09-03 23:04:47 +02:00
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
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
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
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
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
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
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
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
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
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
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
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
Matthias Clasen
ba3a657c48
contour: Add some debug API
...
Add a private way to get the class of a contour,
so we can test that roundtrips through gsk_path_parse
work as expected.
2023-08-27 09:13:32 -04:00
Matthias Clasen
5f2f116c28
circle contour: Fix a typo
2023-08-27 07:43:55 -04:00
Matthias Clasen
2297a353b8
Merge branch 'circle-contour' into 'main'
...
path: Add a circle contour
See merge request GNOME/gtk!6345
2023-08-27 11:12:51 +00:00
Bilal Elmoussaoui
7342ce5bca
gi: Add missing since annotation
2023-08-27 08:17:00 +00:00
Matthias Clasen
167b38dfa1
contour: Some reactoring
...
Make a default print implementation, and use it.
2023-08-26 23:42:52 -04:00
Matthias Clasen
b8a3d7fa00
path: Recognize circles when parsing
...
We can look out for the tell-tale
M-O-O-O-O-Z and turn it into a circle
contour.
2023-08-26 23:42:52 -04:00
Matthias Clasen
0fce24674a
path: Add a circle contour
...
This special contour takes advantage of the
circle definition to speed up things like
hit testing and closest point determination.
2023-08-26 23:42:52 -04:00
Matthias Clasen
99ad585252
Merge branch 'measure-speedups' into 'main'
...
contour: Stop doing the roundtrip test
See merge request GNOME/gtk!6342
2023-08-27 01:13:41 +00:00
Matthias Clasen
6defdb4e8a
Drop unused code
...
we are not using any gsk_spline functions currently.
2023-08-26 11:29:09 -04:00
Matthias Clasen
c989a06718
pathmeasure: compute samples on demand
...
Only do the work for a curve the first time
we need it. This should greatly speed up
use cases where you only create a measure
to get the length of the path.
2023-08-26 10:23:02 -04:00
Matthias Clasen
1c8bd8658d
curve: Cosmetics
2023-08-26 10:23:02 -04:00
Matthias Clasen
ab50cba4e9
curve: Reduce the order of our approximation
...
Use 24 samples instead of 32.
2023-08-26 10:23:02 -04:00
Matthias Clasen
57918813e2
contour: Stop doing the roundtrip test
...
Doing inverse arclength computations is
a very high overhead operation. And the
tests still pass without it.
2023-08-26 09:39:49 -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
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
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
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
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
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
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
4229a37e90
arc: Fix the derivative
...
Scale the derivative such that computing the arc length
of a unit quarter circle wil produce the expected result
of PI/2.
2023-08-23 22:18:52 -04:00
Matthias Clasen
12297fd88a
arc curve: Simplify derivative
2023-08-23 22:11:22 -04:00
Matthias Clasen
7943610066
curve: Fix arc decomposition
2023-08-23 22:11:15 -04:00
Matthias Clasen
f6c2b6bb88
Make foreach work efficiently with arcs
2023-08-23 14:51:31 -04:00
Matthias Clasen
4ab03e79b7
Drop some unnecessary code
...
We tell path_foreach to split into lines or cubics,
so no point in having code to handle quads and arcs.
2023-08-23 14:33:25 -04:00
Matthias Clasen
7a12abdea3
Incorporate review feedback
2023-08-23 14:16:43 -04:00
Matthias Clasen
71584107b0
Add gsk_path_builder_html_arc_to
...
This one draws circular arcs with a given radius.
2023-08-23 12:43:52 -04:00
Matthias Clasen
88c0ace644
Make gsk_path_builder_svg_arc_to public
...
This is useful to port SVG paths using this syntax.
2023-08-23 12:43:52 -04:00
Matthias Clasen
d33ed4f9ab
path: Add elliptical arcs
...
Add a new curve type for elliptical arcs
and use it for rounded rectangles and circles.
We use the 'E' command to represent elliptical
arcs in serialized paths.
2023-08-23 12:43:52 -04:00
Benjamin Otte
de8fdd822c
Merge branch 'wip/otte/for-main' into 'main'
...
widget: Remove unused headers from gtkwidget.h
See merge request GNOME/gtk!6319
2023-08-22 07:38:57 +00:00
Matthias Clasen
486674927a
Make sure stroke bounds are big enough
...
Our standard 'empty path' in gtk4-node-editor
was getting its pointy corners cut off.
2023-08-21 23:59:08 -04:00
Matthias Clasen
b367bf83b4
docs: Tweaks
2023-08-21 22:40:22 -04:00
Matthias Clasen
b84f60877d
docs: Drop a nonexisting enum value
2023-08-21 21:52:53 -04:00
Matthias Clasen
fb0f5b5c14
curve: Add a get_crossing vfunc
2023-08-21 11:29:14 -04:00
Matthias Clasen
2b4e577b53
docs: Add more illustrations
...
Add illustrations to the various curve_to methods
of GskPathBuilder.
2023-08-20 22:28:06 -07:00
Benjamin Otte
29cdac18e8
rendernodeparser: Handle dashing in strokes
...
That part of the original MR got lost while refactoring.
Put it back.
2023-08-21 05:23:44 +02:00
Benjamin Otte
418f6b35af
gsk: Add gsk_rect_to_float()
...
... and use it.
2023-08-21 05:23:42 +02:00
Benjamin Otte
d665d2fb89
vulkan: Add nonuniformEXT() where needed
...
The magical term to know about (because the GLSL compiler or the
validation layers sure as hell don't) is:
"dynamically uniform expression"
because if you don't have that when indexing a texture or buffer array,
you need to add nonuniformEXT() around the index variable.
Fixes the close icon on AMD having glitches of the previous icon visible
in some pixels.
2023-08-21 05:19:44 +02:00
Benjamin Otte
8862666b5a
build: GSK doesn't depend on gdk-pixbuf
2023-08-21 05:19:37 +02:00
Benjamin Otte
3adf02445f
build: Don't use configure_file() when custom_target() works
...
These two files don't need to be built when configuring, they are only
needed during build.
2023-08-21 05:19:37 +02:00
Matthias Clasen
b12a27083d
path: Drop special contour parsing
...
This is not used currently, since we don't
have custom contours.
2023-08-18 18:06:44 -04:00
Matthias Clasen
07ec266a00
curve: Add a get_derivative vfunc
2023-08-18 13:46:42 -04:00
Matthias Clasen
88e74ca21e
path: Don't accept 'O' as path command
...
We don't have conics atm.
2023-08-18 13:19:48 -04:00
Matthias Clasen
148da12cfc
Cosmetics
2023-08-18 13:19:33 -04:00
Matthias Clasen
0c39890e0f
contour: Optimize bounds
...
Cache the bounds in the contour, and compute
the stroke bounds based on it as well.
2023-08-18 10:02:14 -04:00
Matthias Clasen
73853f1a6b
contour: Add an assertion
2023-08-16 16:18:38 -04:00
Matthias Clasen
8634d67cff
Some fixes for gsk_path_builder_add_segment
...
We must be careful with single-point contours
that contain just a move. These never occur in
practice, but our randomized tests produce them
regularly.
2023-08-16 16:15:26 -04:00
Matthias Clasen
125ea90894
Rename an internal function
...
We want the number of ops, not the number of points.
2023-08-16 15:54:46 -04:00
Benjamin Otte
7d5ef1117e
Merge branch 'color-matrix' into 'main'
...
Color matrix node fixes & clarifications
See merge request GNOME/gtk!6290
2023-08-16 17:07:35 +00:00
Sergey Bugaev
246a7cfeab
rendernode, snapshot: Slightly expand color matrix docs
...
Based on reverse engineering the color node and contrary to my
expectations, the matrix/offset is expressed in, and applied to,
unpremultiplied colors. The colors are being explicitly
unpremultiplied, transformed according to the matrix/offset, and
premultiplied back (see color_matrix.glsl). The matrix is getting
transposed.
Also, copy the same blurb to the corresponding GtkSnapshot function.
Signed-off-by: Sergey Bugaev <bugaevc@gmail.com>
2023-08-16 13:55:04 +03:00
Philip Chimento
823cb714ec
introspection: Remove 'caller-allocates' from POD types
...
The (out caller-allocates) and (out callee-allocates) annotations are
meant for structured or pointer types. Plain old data types are just
regular out parameters and don't need the annotation about who allocates
them.
See glib!2005, gjs#570
2023-08-15 22:30:27 -07:00
Matthias Clasen
5cf9a09c07
gsk: Add more details to the docs
2023-08-15 12:38:24 -04:00
Matthias Clasen
45aa8e4e00
Fix GskStandardContour to have a 'good' size
...
We need the size of GskStandardContour to be
at least as aligned as graphene_point_t, or
things break in hard to debug ways.
2023-08-14 15:59:45 -04:00
Matthias Clasen
a85ab3585e
Revise gsk_path_point_get_tangent
...
Update the directions enum to allow all four
tangents to be obtained. Add an illustration
to the docs for clarity.
Update all callers.
2023-08-14 14:58:22 -04:00
Matthias Clasen
a1d40c5236
Add gsk_path_point_get_rotation
...
This returns the tangent in the form of an angle.
2023-08-14 14:58:22 -04:00
Matthias Clasen
6ace4b60d8
pathpoint: Revise argument order
...
In order for introspection and documentation to
not be confused, we need to have the GskPathPoint
be the first argument.
Update all callers.
2023-08-14 13:20:34 -04:00
Bilal Elmoussaoui
f5d47a4658
gi: Add missing since annotation
2023-08-14 08:41:12 +00:00
Matthias Clasen
4b7e1b1233
Fix gsk_path_builder_add_segment
...
We were splitting the last segment, but did not
actually use the result of the split. Oops.
2023-08-13 09:40:19 -04:00
Benjamin Otte
73500f9ebb
Merge branch 'wip/otte/for-main' into 'main'
...
treeviewcolumn: Set ascending class for ascending order
Closes #6002
See merge request GNOME/gtk!6277
2023-08-13 03:54:19 +00:00
Benjamin Otte
67a4279d3f
rendernode: Put typedef into gsktypes.h
...
Makes includes simpler for headers that want to use GskRenderNode.
2023-08-12 23:13:47 +02:00
Benjamin Otte
dd4b8a4c89
gl: Pass swizzle array directly
...
There's no need to pass pointers to arrays, as arrays are already
pointers.
2023-08-12 23:13:23 +02:00
Benjamin Otte
d1c7376b05
gdkcontext: Make has_unpack_subimage() do the version check
...
Makes the code look simpler when we actually use that function.
2023-08-12 23:13:23 +02:00
Matthias Clasen
11f48f3c5b
Add gsk_path_builder_add_rounded_rect
...
For now, this is using gsk_path_builder_svg_arc_to
to approximate elliptical arcs.
2023-08-12 15:34:54 -04:00
Matthias Clasen
fa4ad1590d
Merge branch 'matthiasc/for-main' into 'main'
...
path: Some documentation improvements
See merge request GNOME/gtk!6273
2023-08-11 16:42:25 +00:00
Matthias Clasen
47ddc742fc
path: Some documentation improvements
...
Among other things, add a quick summary of
SVG path syntax, and add a few illustrations.
2023-08-11 12:09:12 -04:00
Matthias Clasen
f2835bb48b
pathbuilder: Treat current point consistently
...
Arrange that none of the 'add' methods change
the current point.
2023-08-10 22:56:47 -04:00
Matthias Clasen
fff1645060
path builder: Fix add_cairo_path
...
We were forgetting to end the current contour.
2023-08-10 16:08:32 -04:00
Matthias Clasen
4e91cd1155
Merge branch 'matthiasc/for-main' into 'main'
...
pathpoint: Use the right type
See merge request GNOME/gtk!6266
2023-08-09 20:37:14 +00:00
Matthias Clasen
2d923d362f
Merge branch 'bilelmoussaoui/gi-gsk' into 'main'
...
gsk/gi: new Path api fixes
See merge request GNOME/gtk!6265
2023-08-09 19:40:53 +00:00
Matthias Clasen
b7544636d4
contour: Skip the move
...
When jumping between segments, we always
need to skip index 0, since thats the move.
This fixes the tangent checks in the
rectangle tests.
2023-08-09 15:12:58 -04:00
Matthias Clasen
6220baf230
get_closest_point: Prefer earlier points
...
Only switch to a later point if it is strictly
closer than the existing match. This fixes
start- vs endpoint confusion in the rectangle
tests.
2023-08-09 15:12:52 -04:00
Matthias Clasen
917307a6a4
pathpoint: Use the right type
2023-08-09 14:37:14 -04:00
Bilal Elmoussaoui
b03abea402
gsk: Don't change the GskRenderNodeType order
...
As we use their values to check that a node can be downcasted to a node
type in the Rust bindings
such change would break existing code
2023-08-09 20:26:46 +02:00
Bilal Elmoussaoui
d4fcc883cb
gsk/gi: Add missing since annotations & docs
2023-08-09 20:26:46 +02:00
Matthias Clasen
68c6f63e90
pathpoint: Clarify docs
...
Add a paragraph explaining the situation
for comparing the start- and endpoint of
a closed path.
2023-08-09 11:30:26 -04:00
Matthias Clasen
f707185248
Add gsk_path_builder_add_segment
...
With GskPathPoint, we can subset paths without
a measure object.
2023-08-09 07:01:01 -04:00
Matthias Clasen
ded30049db
path: Add gsk_path_get_start/end_point
...
These are useful to have, now that we are
relying more on GskPathPoint in our api.
2023-08-08 22:05:34 -04:00
Matthias Clasen
5c55e9d11e
Add gsk_path_point_equal/compare
...
These just make sense to have.
2023-08-08 22:05:34 -04:00
Matthias Clasen
c35bb11c18
Simplify GskPathPoint
...
Use simple representation of just
{ contour index, segment index, t value }
2023-08-08 20:31:56 -04:00
Matthias Clasen
fe84ce8686
gsk: Try to fix flipped fallback rendering
...
This patch is pretty much a blind guess, but
it seems to fix flipped rendering of fill
and stroke nodes.
2023-08-07 17:53:49 -04:00
Matthias Clasen
fc3c2e0942
gsk: Implement parsing fill and stroke nodes
...
Make serialization and deserialization work for stroke and
fill nodes.
2023-08-07 13:02:57 -04:00
Benjamin Otte
3aa3816125
gsk: Add GskStrokeNode
...
Take a rendernode as source and a GskPath and GskStroke,
and fill the area that is covered when stroking the path
with the given stroke parameters, like cairo_stroke() would.
2023-08-07 13:02:57 -04:00
Matthias Clasen
c37c29422a
Add gsk_path_get_stroke_bounds
...
This is a helper to compute the bounds for
stroke nodes. We keep it private for now.
2023-08-07 13:02:57 -04:00