Commit Graph

2420 Commits

Author SHA1 Message Date
Benjamin Otte
ca9f0abdd8 Merge branch 'wip/otte/for-main' into 'main'
testsuite: Make memorytexture tests random

See merge request GNOME/gtk!6075
2023-06-08 23:54:07 +00:00
Benjamin Otte
f033b6c2c6 testsuite: Don't always loop in memorytexture tests
When running the tests, only run the random (and potentially large) size
download test once instead of 10 times.

There's no real benefit in doing that, both because it's unlikely to
fail only in the 2nd or 9th run and because the sizes are picked
randomly.

This also speeds up the test massively as the download test was
dominating the runtime.
2023-06-09 01:12:32 +02:00
Benjamin Otte
45656ba426 testsuite: Make memorytexture tests random
Instead of picking a few numbers in advance and running them through the
test gauntlet every time, pick the random numbers at runtime.

This both increases the test coverage in that it ultimately tests more
combinations across many runs and it reduces the runtime of individual
runs because every tun only runs the download tests twice (with 1px and
the random size) instead of 5 times.

And that speedup benefits the CI, where the asan runs would cause this
test to timeout sometimes.
2023-06-09 01:12:32 +02:00
Benjamin Otte
0a0f0d9e7e testsuite: Add a test for repeating gradients
Make sure scaling the image also scales the color stop lookup.
2023-06-08 22:16:18 +02:00
Matthias Clasen
baaa748248 ci: Disable headless tests under asan
Our use of LD_PRELOAD for these tests does not
sit right with asan, so just skip them in this
case.
2023-06-05 21:15:31 -04:00
Benjamin Otte
9070c457d6 testsuite: Make clipped-repeat test work universally
Cover the rounded corners so that they cause no visible difference in
the end result.
2023-06-05 05:33:07 +02:00
Benjamin Otte
8c5e046574 testsuite: Adapt color-matrix testcase
Make it use an alpha value that is well defined, ie 0.4 instead of 0.5.

0.4 * 255 = 102
0.5 * 255 = 127.5

This avoids rounding issues where some math may cause the resulting
alpha value to be 127, and some other math ends up with 128.
2023-06-05 05:33:07 +02:00
Benjamin Otte
8860a2a688 testsuite: fix memleak
Also use the actual diff command we found instead of searching for it
again.
2023-06-05 05:33:07 +02:00
Benjamin Otte
fd5d15004e Merge branch 'wip/otte/vulkan' into 'main'
Vulkan hacking going overboard

See merge request GNOME/gtk!5992
2023-06-04 18:21:21 +00:00
Benjamin Otte
968ceb71d5 gsk: Add (private) gsk_rounded_rect_intersection()
The idea is that for a rectangle intersection, each corner of the
result is either entirely part of one original rectangle or it is
an intersection point.

By detecting those 2 cases and treating them differently, we can
simplify the code to compare rounded rectangles.
2023-06-04 19:42:01 +02:00
Benjamin Otte
d8b9c3ae96 vulkan: Track offset in the renderpass
This avoids emitting lots of push constant updates as most of the
transforms we have are simple translations to adjust drawing for the
next widget.
2023-06-04 19:42:01 +02:00
Benjamin Otte
7f1bd1f047 vulkan: Handle empty child bounds in repeat node
Also add test to the testsuite for it.
2023-06-04 19:42:01 +02:00
Matthias Clasen
d427933c61 testsuite: Improve test coverage 2023-06-04 09:04:25 -04:00
Matthias Clasen
38bf843de8 Merge branch 'wip/alice/muxer-fix' into 'main'
actionmuxer: Correctly notify actions after reparenting

Closes #5861

See merge request GNOME/gtk!6043
2023-06-01 10:54:33 +00:00
Alice Mikhaylenko
1549ec5f9b actionmuxer: Correctly notify actions after reparenting
When registering an observer, we send a notification and for that we need
to query the action's state and param type. When setting up a muxer parent,
same thing happens, except the action is queried on the parent instead.

This means that the muxer will notify observers about the parent's actions,
but not about its own.

Add a test to verify it works.

Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/5861
2023-06-01 06:39:44 +04:00
Matthias Clasen
96f6787a3e testsuite: Add more download tests
Add some odd-sized texture sizes to the
download tests, to trigger alignment issues
in the various upload code paths. And add
a size that is bigger than the max-texture-size
we force in one of our test setups.

To compensate, reduce the number of
runs per size from 20 to 10.
2023-05-30 23:01:20 -04:00
Matthias Clasen
cc665f29ea testsuite: Plug a memory leak 2023-05-30 22:37:03 -04:00
Matthias Clasen
8d2047c824 testsuite: Use proper alignment when uploading to GL 2023-05-30 22:36:41 -04:00
Matthias Clasen
a79da8b655 Improve test coverage for GdkGLTexture 2023-05-30 22:36:10 -04:00
Matthias Clasen
876b439d4a Merge branch 'matthiasc/conversion-tests' into 'main'
Texture format work

See merge request GNOME/gtk!6035
2023-05-31 00:13:51 +00:00
Matthias Clasen
2bf2635635 testsuite: Exclude some formats on GLES
GLES < 3.2 has some problems with 16-bit formats,
so exclude these from our download tests.
2023-05-30 19:46:13 -04:00
Matthias Clasen
67ed09f5ae testsuite: Add tests for native GL textures
Create GL textures in gray and GA formats
and check that we can download from them
successfully.
2023-05-30 19:46:13 -04:00
Sophie Herold
d141ac5adf gdk: Add gray/alpha memory formats to testsuite 2023-05-30 14:41:01 -04:00
Sophie Herold
50115d70c6 gdk: Add grayscale and alpha memory formats 2023-05-30 14:41:01 -04:00
Benjamin Otte
3dc3d03a08 testsuite: Add conversion tests
Ensure we can convert from any format to any other format.
2023-05-30 00:42:10 +02:00
Benjamin Otte
788bd575d6 testsuite: Disable certain texture download tests
The GL renderers like to premultiply content that isn't, and due to the
data loss with alpha == 0 (transparent white, transparent black and
transparent anything are all represented by (0, 0, 0, 0) when
premultiplied) these values cannot be converted back.
2023-05-30 00:42:10 +02:00
Benjamin Otte
94a2dc4c47 testsuite: Update memorytexture test for TextureDownloader
There is no longer a need to use gdk_texture_download() and force
conversion to ARGB8 format. We can download the pixels in the original
format again.

That way we avoid testing the conversion code and avoid having to deal
with differences in representable colors.

However, some formats do do conversions, so we allow pixel comparisons
to be accurate (requires 16bit comparison accuracy) or inaccurate (we
only care about 8bit).
Note that for the default RGBA formats, this is identical and means they
need to be bit-exact the same, no matter what.
But the higher bit depth formats may be more different - floating point
can even have different values with high accuracy (the float mantissa is
23 bit, we only care about 16).
2023-05-30 00:42:10 +02:00
Benjamin Otte
169a7f83e6 testsuite: Imitate gdk_memory_convert() correctly
The formula use to compute pixel values from GdkRGBA floats was slightly
adapted some time ago, copy that adaptation
2023-05-30 00:39:46 +02:00
Luca Bacci
703494c7fa testsuite: rename 'wait' function to 'timed_loop'
When compiling for macOS, CLang errors out because a non-static
wait function is declared in sys/wait.h.
2023-05-29 16:43:28 +02:00
Matthias Clasen
f10c234361 css: Add a test for non-ASCII font family
This came up in #5852, so make sure that it works.
2023-05-28 07:57:40 -04:00
Matthias Clasen
5c1c22156c sortlistmodel: Optimize signals
When we emit items-changed due to a section
sorter change, don't also emit sections-changed.
Instead make the items-changed signal cover the
whole range.

Tests included.
2023-05-27 20:37:28 -04:00
Matthias Clasen
9c1049e710 multiselection: Pass through sections-changed
If our underlying model emits sections-changed,
we need to pass it on.

Add a test for this too.
2023-05-27 17:27:19 -04:00
Matthias Clasen
a1352a88ff singleselection: Pass through sections-changed
If our underlying model emits sections-changed,
we need to pass it on.

Add a test for this too.
2023-05-27 17:27:19 -04:00
Matthias Clasen
8825917140 noselection: Pass through sections-changed
If our underlying model emits sections-changed,
we need to pass it on.

Add a test for this too.
2023-05-27 17:27:19 -04:00
Matthias Clasen
ba8d4902b5 filterlistmodel: Pass through sections-changed
If our underlying model emits sections-changed,
we need to pass it on.

Add a test for this too.
2023-05-27 17:27:19 -04:00
Matthias Clasen
8f3d3ca587 slicelistmodel: Pass through sections
Implement GtkSectionModel in the obvious way.

Tests included.
2023-05-27 17:27:19 -04:00
Matthias Clasen
aeba1e08e8 sortlistmodel: Emit sections-changed
When a new section sorter is set, potentially
all sections have changed. So emit sections-changed
for all items.

Tests included.
2023-05-27 17:27:19 -04:00
Matthias Clasen
fc524ed346 Cosmetics
Fix copy-paste errors in line 1.
2023-05-27 13:51:39 -04:00
Matthias Clasen
56cfef3544 testsuite: Use gtk_list_item_manager_gc_tiles
Use this  new api instead of open-coding it.

Also, assert that it merges consecutive
multi-item tiles.
2023-05-20 19:50:11 -04:00
Matthias Clasen
1d4f383ba5 Drop the FILLER tile type
It is not used anymore.
2023-05-20 12:28:19 -04:00
Matthias Clasen
43a22bb350 Cosmetics
Use the proper g_assert variant.
2023-05-20 07:39:21 -04:00
Matthias Clasen
70ba00ae53 testsuite: Make this test compile
clang did not like this creative use of
strings at all. Rightfully so.
2023-05-18 08:40:50 -04:00
Matthias Clasen
188677724c Improve test coverage for property lookup models 2023-05-16 20:13:57 -04:00
Matthias Clasen
9d3046f187 Merge branch 'matthiasc/for-main' into 'main'
Matthiasc/for main

See merge request GNOME/gtk!5975
2023-05-16 20:42:27 +00:00
Benjamin Otte
2b0e3a5b1a nodeparser: Move an error check
By putting the check earlier, it will be emitted for the right token.
2023-05-16 18:53:53 +02:00
Benjamin Otte
f5955feea1 testsuite: Add crossfade-clip-both-children test
This one tests a crossfade between two non-overlapping nodes with a clip
region that covers neither of the two nodes.

This tests that renderers can deal with clip regions that doesn't
overlap nodes in a situation where they will most likely want to create
an offscreen.
As offscreens are typically clipped to the clip region, this would cause
an empty offscreen and that can cause failures.
2023-05-16 18:53:27 +02:00
Benjamin Otte
853e8719c6 testsuite: Add clip-translate-offscreen test
This was an experiment where an offscreen was translated inside an
existing clip.

Because renderers try to limit offscreens to the clip rect, this is
interesting, because they might get the translation wrong.
2023-05-16 18:53:27 +02:00
Benjamin Otte
ee6ef41e71 css: Remove crashy resource:// optimization
Using gdk_texture_new_from_resource() is not valid here because we are
not sure if the given resource is valid.

Plus, the previous optimization is no longer relevant, because we are
not using gdk_pixbuf_new_from_resource() anymore - which was what this
optimization was about before it was ported to GdkTexture.

Test attached.
2023-05-16 18:53:27 +02:00
Benjamin Otte
fde3d2cd50 testsuite: Add testcase for z clipping
the near and far clipping plane are at -10000 and 10000 respectively.
Test that the renderers respect that.
2023-05-16 18:53:27 +02:00
Matthias Clasen
3e27232028 Improve test coverage for sorters 2023-05-16 12:33:12 -04:00