Commit Graph

2874 Commits

Author SHA1 Message Date
Benjamin Otte
cc25fdf602 testsuite: Add test runner for opacity tests
Tests are node files dumped into testsuite/gsk/opaque
They are named "name-X-Y-W-H.node" with X Y W H being the expected
opaque rectangle or "name.node" if there is no opacity.

A simple example is included here.
2024-07-08 15:28:14 +02:00
Matthias Clasen
5a59548d72 Merge branch 'fix-offload-transforms' into 'main'
offload: Don't assert things that might fail

Closes #6824

See merge request GNOME/gtk!7407
2024-07-08 12:58:28 +00:00
Matthias Clasen
a858736516 Merge branch 'matthiasc/for-main' into 'main'
ci: Add another offload test

See merge request GNOME/gtk!7414
2024-07-08 12:16:49 +00:00
Matthias Clasen
880c33a777 offload: Don't assert things that might fail
We can in fact meet complex transforms here. Asserting that they
are simple doesn't make it so. Instead, simply bail out if a
transform is too complex; in this case we can't offload anyway,
so no need to walk the tree further.

Test included.

Fixes: #6824
2024-07-08 08:15:02 -04:00
Matthias Clasen
c32ab9440d Merge branch 'document-save-icon' into 'main'
Add missing icon

See merge request GNOME/gtk!7416
2024-07-08 11:01:00 +00:00
Benjamin Otte
31a907be35 gpu: Make sure textures used as image are mipmapped
When getting a texture as image, we were always returning the texture
unconditionally.

However, we want to mipmap textures when the scale factor is too large,
and this code path did not do that.

The same codepath on the GL renderer doesn't do that either, so the test
is disabled for it.
2024-07-07 12:54:05 +02:00
Benjamin Otte
10a7650411 testsuite: Generate mask correctly
There's a corner case with width/height being exactly 25 pixels.
And of course I was hitting it with one of my tests.
2024-07-07 12:54:05 +02:00
Balló György
017510ea5f Add missing icon
The fullcolor 'document-save' icon is used in the print dialog for the
'Print to File' element.
2024-07-05 13:22:54 +02:00
Benjamin Otte
c43c0275e3 testsuite: Improve memorytexture printing code
* The variables are const. Keep them const when casting

* Print float16 values

* Print integer values as hex. This is better for detecting
  byteswapping, off by one, and such. Besides, we tend to use values
  that have the same 2 hex digits, so detecting corruption is also easy.
2024-07-05 13:16:56 +02:00
Benjamin Otte
df5d233155 testsuite: Print the right pixel
Typo made us pass the wrong values
2024-07-05 13:16:56 +02:00
Benjamin Otte
a8238c2251 testsuite: Make png file argument optional
Just default to the node file but with a .png extension.
2024-07-05 10:43:28 +02:00
Benjamin Otte
32625381fa gsk: Deprecate GskGLShader and the rendernode
The new renderers don't support them due to the required complexity of
integrating them with Vulkan and the assumptions those nodes make about
the renderer (the GL renderer exports its internal APIs into the
GLShader).

There haven't been any complaints that I'm aware of since 4.14 was
released where the default renderer does not support the nodes, so usage
in public seems to be close to nonexistant.

The 2 uses I know of were workarounds about missing features in GTK that
have stopped since GTK now supports them:

1. GStreamer used in to do premultiplication when the old GL renderer
   did not do so in hardware but on the CPU.
2. Adwaita used it for masking before the mask node wa added in 4.10.
2024-07-04 21:28:06 +02:00
Matthias Clasen
7f7e4ab69e ci: Add another offload test
Sadly, it fails to demonstrate the crash I'm after.
But its still useful to have.
2024-07-04 06:41:09 -04:00
Matthias Clasen
db4f60cc9d Cosmetics 2024-07-04 06:40:52 -04:00
Matthias Clasen
6aba047ace expander: Don't leave dangling a11y relations
If we unparent the widget, we should sever a11y relations too.
Otherwise, an a11y implementation might follow them and be surprised
to find a parentless widget (and not in a good way).

Updated tests to not check the relation on an unexpanded expander.
2024-07-03 12:55:15 -04:00
Matthias Clasen
28c91bf767 Merge branch 'ci-catch-segfaults' into 'main'
testsuite: Use catch as testwrapper

See merge request GNOME/gtk!7406
2024-07-02 02:59:46 +00:00
Matthias Clasen
b6e79a7234 testsuite: Use catch as testwrapper
If we find a binary named catch, use it as test wrapper. This
will be used to capture stacktraces for crashes in ci.
2024-07-01 22:29:36 -04:00
Benjamin Otte
b80e33b209 testsuite: Add tests for empty mask children
The compare tests use an empty container node, but running them with
--replay ends up with empty nodes in snapshots due to how containers are
replayed.

Related: !7396
Related: #6761
2024-07-02 02:04:06 +02:00
Benjamin Otte
77434fc9f9 testsuite: Use a proper texture on defaultvalue test 2024-06-29 07:12:10 -04:00
Benjamin Otte
830846b39c testsuite: Use a proper texture on objects-finalize test 2024-06-29 07:12:10 -04:00
Benjamin Otte
3073704010 testsuite: Use a proper texture in notify test 2024-06-29 07:12:10 -04:00
Matthias Clasen
29559deeeb reftests: Avoid some deprecated css
alpha() is deprecated, replace it with a relative color.
2024-06-27 21:03:14 -04:00
Matthias Clasen
0cff62335b Fix style variables test
Make the results match what the comments actually say.
2024-06-27 21:03:14 -04:00
Matthias Clasen
e4325e5b2b css: Add more currentcolor style tests
These tests check various situations with inheritance and
currentColor. In particular the caret-color test was not
working correctly before we handled used values explicitly.
2024-06-27 21:03:14 -04:00
Matthias Clasen
cc463d52f6 css: Make palette value resolve used values
Separate out computed and used values for this type.
2024-06-27 20:21:43 -04:00
Matthias Clasen
85149445e0 testsuite: Fix up memorytexture printing
This was bungled in 96cb38dd05.
2024-06-21 19:14:31 -04:00
Matthias Clasen
5c97089e59 Update expected results
Since we've given up on embedding subsetted system fonts, we need
to regenerate our reference files once more.
2024-06-21 18:45:43 -04:00
Matthias Clasen
a05dd4d194 Isolate our nodeparser tests better
Add a custom fontconfig setup and ship Cantarell as part of it.
This should hopefully make it so that the tests always see the
same default font, as long as you have FONTCONFIG_FILE set up
correctly.

Update all affected tests.
2024-06-21 18:17:11 -04:00
Matthias Clasen
96cb38dd05 wip: print pixels when memorytexture tests fail
This helps with debugging.
2024-06-21 15:48:30 -04:00
Benjamin Otte
f22ae99b98 gdk: Improve memorytexture test output
On failures, don't immediately abort, just g_test_fail().
This allows running the test with -k to get full output.

Also print something useful as the error message, namely the bytes that
are different.
2024-06-21 19:53:46 +02:00
Matthias Clasen
6ec4a2a4a5 Exclude some more gradient compare tests
These are prone to rounding errors.
2024-06-17 22:28:33 -04:00
Matthias Clasen
a11abf57e1 testsuite: Regenerate a bunch of .ref.node files
We serialize fonts now, so these show up in the node references.
2024-06-17 22:14:34 -04:00
Matthias Clasen
da41271dd5 css: Parse interpolation for conic gradients
Parse things like "in hsl hue longer". For details, see the
CSS Images Module Level 4, https://www.w3.org/TR/css-images-4.

This commit fixes preexisting brokenness in conic-gradient parsing
and printing as well, and includes the relevant test changes.

Tests included.

Gradient interpolation color spaces aren't supported for
rendering yet.
2024-06-16 13:22:36 -04:00
Matthias Clasen
5610af1b77 css: Parse interpolation for radial gradients
Parse things like "in hsl hue longer". For details, see the
CSS Images Module Level 4, https://www.w3.org/TR/css-images-4.

Tests included.

Gradient interpolation color spaces aren't supported for
rendering yet.
2024-06-16 13:22:27 -04:00
Matthias Clasen
8da70fec91 css: Parse interpolation for linear gradients
Parse things like "in hsl hue longer". For details, see the
CSS Images Module Level 4, https://www.w3.org/TR/css-images-4.

Tests included.

Gradient interpolation color spaces aren't supported for
rendering yet.
2024-06-16 13:21:56 -04:00
Matthias Clasen
763d620a23 css: Parse all supported color spaces
The code parsing interpolation methods hadn't learned about
or latest color space additions. While we're at it, improve
the error reporting a bit.

Tests included.
2024-06-16 13:04:52 -04:00
Matthias Clasen
5a2982ac31 testsuite: Fix one nodeparser error 2024-06-14 14:11:54 -04:00
Matthias Clasen
441b704afd testsuite: Stop relying on xpms
gdk-pixbuf isn't loading those anymore, by default.
2024-06-14 14:11:22 -04:00
Matthias Clasen
f024ee1adf Add more tests for css colors 2024-06-11 16:41:22 -04:00
Matthias Clasen
7291a21a85 Merge branch 'wip/alice/css' into 'main'
CSS fixes and more tests

See merge request GNOME/gtk!7345
2024-06-05 20:54:12 +00:00
Alice Mikhaylenko
171bfde133 csscolorvalue: Fix percentage ranges for relative colors
Add tests as well, now that they can be computed at parse time.
2024-06-06 00:35:52 +04:00
Alice Mikhaylenko
82d1fdb714 csscolorvalue: Resolve relative colors at parse time when possible 2024-06-06 00:35:52 +04:00
Alice Mikhaylenko
82b19daa7e csscolorvalue: Don't serialize relative colors as rgb()
Spec says it should be color(srgb).
2024-06-06 00:35:52 +04:00
Alice Mikhaylenko
dc1ff3c2e3 csscolorvalue: Fix oklab() percentage range 2024-06-06 00:35:52 +04:00
Alice Mikhaylenko
6602ac5eae testsuite: Fix css tests
There are a bunch of new deprecations, and some tests weren't in
meson.build.
2024-06-06 00:35:52 +04:00
Alice Mikhaylenko
5dab5bf0e9 css: Allow percents in opacity
Add another missing feature from web css. It's nice to be able to use the
same variables in color-mix() and here.
2024-06-06 00:22:19 +04:00
Matthias Clasen
d5e5f47666 css: Add tests for relative colors 2024-06-04 10:47:54 -04:00
Alice Mikhaylenko
48b00f0ac1 testsuite: Add color-mix() tests 2024-06-03 23:59:44 +04:00
Alice Mikhaylenko
1765e1b7c2 testsuite: Add GTK_DEBUG=css
Make named color tests work, since they expect deprecation warnings atm.
2024-06-03 21:53:52 +04:00
Matthias Clasen
60c944bb94 Add tests for color conversion and interpolation
Add some tests for gtk_css_color_convert and
gtk_css_color_interpolate, mostly based on examples
in the spec.
2024-05-31 21:29:49 -04:00