Commit Graph

176 Commits

Author SHA1 Message Date
Benjamin Otte
3e5af3afce testsuite: Update memorytexture text to use new renderers
1. Refactor checks for GL support

2. Add NGL and Vulkan
2024-01-07 07:22:51 +01:00
Benjamin Otte
1e54e838e0 vulkan: Remove GskVulkanRenderer
We want to introduce a new one next.

Technically, this breaks API, because gsk_vulkan_renderer_new() is going
away, but practically, we're gonna bring it back once we introduce that
renderer in a few commits.
2024-01-07 07:22:49 +01:00
Benjamin Otte
b16d01e018 testsuite: Replace g_random_*() with g_test_rand_*()
... in the whole testsuite
2024-01-03 16:05:25 +01:00
g.willems
e3f39bf0c3 testsuite: only run x11-specific tests if x11 enabled
Some testcases rely on X11 support, which is not always available,
typically on win32.
Skip them if the x11 backend is disabled.
2023-12-12 21:29:03 +01:00
Benjamin Otte
6ad9db0bf0 Merge branch 'texture-diff-against-distant-ancestors' into 'main'
texture: Enable texture diff against arbitrarily distant ancestors

See merge request GNOME/gtk!6644
2023-12-12 01:46:05 +00:00
Benjamin Otte
c414889cfa testsuite: Make memorytexture test work with GLES < 3.1
Previously, the code was skipping various tests and not skipping others
that it should.

Fix both of these cases.
2023-12-12 01:49:41 +01:00
Ben Mather
1629b072fe texture: Enable texture diff against arbitrarily distant ancestors 2023-12-08 11:29:56 +00:00
Matthias Clasen
7cc5d5c7a5 Revert "Merge branch 'rgba-new-from-string' into 'main'"
This reverts commit 77f40d7508, reversing
changes made to b969f4649d.

It turns out we did not have agreement on this after all.
2023-12-02 10:55:35 +05:45
Emmanuele Bassi
0114fad8a5 Style/doc fixes from review 2023-11-28 00:42:19 +00:00
FeRD (Frank Dana)
39db73dff1 Add gdk_rgba_new_from_string()
Signed-off-by: FeRD (Frank Dana) <ferdnyc@gmail.com>
2023-11-24 22:19:39 -05:00
Benjamin Otte
cd7e1c1387 dmabuf: Modify gdk_gl_context_import_dmabuf()
Move a bunch of code - namely the target selection - into the function.

I want to use the same code in the NGL renderer, so no need to duplicate
it.
2023-11-07 05:12:57 +01:00
Chun-wei Fan
864c5b4608 testsuite: Disable dmabuftexture test on Windows
It's not meaningful there.
2023-10-24 14:08:16 +08:00
Benjamin Otte
a579e3bc6d build: Fix up header includes
These weren't fixed in the merge request in
  https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/6489
to the change from
  https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/6514
2023-10-23 03:12:09 +02:00
Matthias Clasen
d17d8e04a6 Add a few dmabuf texture tests
Test some basic import and export of dmabufs.

For now, put the test into the 'failing' suite,
since it does not work in CI, and also fails
on AMD hw.
2023-10-22 16:39:24 -04:00
Matthias Clasen
10250a0a6a Add XRGB memory formats
These are not uncommon in dmabufs,
and supporting them is easy.

Fixes: #6172
2023-10-20 17:58:06 -04:00
Matthias Clasen
bd974b08b3 Add GDK_MEMORY_A8B8G8R8_PREMULTIPLIED
We did have 4 ordering variations of ARGB straight,
but only 3 premultiplied. Add the missing one.

Update all the places where we switch over memory formats.
2023-10-20 16:42:40 -04:00
Matthias Clasen
7a8a27bd60 ci: Mark the clipboard test as flaky
Lets give up on trying to run this successfully
in ci. More green in more places!
2023-07-28 09:06:14 +03:00
Benjamin Otte
4a8122f685 gdk: Make A8 and A16 formats premultiplied
The relevant question here is about details, because we have to choose
if we declare alpha-only formats as having their (nonexistant) color
channels premultiplied or not, so that the code paths using them can do
the right thing.

Because we are premultiplied by default, it makes sense to treat alpha
like that, because then the alpha-only code doesn't need to do
workarounds for straight alpha.

Where this is relevant of course is when expanding the alpha channel
into color channels, where we want to end up with white.
So make sure we do color = alpha there instead of color = 1 like we did
before.
2023-07-22 01:33:44 +02:00
Benjamin Otte
27fbdcbecb gdk: Add A16_FLOAT and A32_FLOAT formats
We need them for mask-only textures.

For tiffs, we convert the formats to RGBA (the idea that tiff can save
everything needs to be buried I guess) as tiffs can't do alpha-only.
2023-07-22 01:33:44 +02:00
Benjamin Otte
49c2366121 testsuite: Unify skipping memorytexture test
... and make it handle more cases of failure, in particular OpenGL and
Vulkan being unsupported by the system.
2023-06-19 15:08:00 +02:00
Benjamin Otte
ae89f6e6c0 testsuite: Add a vulkan method to memorytexure test
This uses the newly added NULL-surface renderer.
2023-06-19 14:13:03 +02:00
Matthias Clasen
b439398d09 testsuite: Plug some memory leaks 2023-06-09 22:40:38 -04: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
Matthias Clasen
d427933c61 testsuite: Improve test coverage 2023-06-04 09:04:25 -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
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
Matthias Clasen
013401b594 Fix texture tests with GLES
No sync for you if you're using GLES.
2023-05-15 19:11:35 -04:00
Matthias Clasen
0152286fa0 Improve test coverage for GdkGLContext 2023-05-15 16:49:12 -04:00
Matthias Clasen
41b606b16d Add tests for GdkTextureDownloader 2023-05-15 15:24:56 -04:00
Matthias Clasen
f83c00c928 Test gltexture update functionality 2023-05-15 12:50:28 -04:00
Matthias Clasen
f497cb2b6e Improve gdk test coverage 2023-05-15 11:56:31 -04:00
Matthias Clasen
e50209a535 Add more texture load tests
Add some tests for handling of failures.

The test data here is taking from gdk-pixbufs
tests/test-images/fail directory, excluding anything
but png, tiff and jpg images.
2023-05-14 07:50:11 -04:00
Matthias Clasen
d6430995ad Improve gdk test coverage
Test the loadable icon implementation of GdkTexture.
2023-05-14 07:50:11 -04:00
Matthias Clasen
cea15fc63e Improve gdk test coverage
Add tests for GdkToplevvelLayout and
GdkPopupLayout.
2023-05-13 21:56:29 -04:00
Matthias Clasen
57dd88ee53 testsuite: Cosmetics 2023-05-12 19:52:42 -04:00
Emmanuele Bassi
cdeeb3275a build: Internal tests must set GTK_COMPILATION
Otherwise they won't be able to use the appropriate function visibility
on Windows.
2023-05-09 19:01:21 +01:00
Matthias Clasen
b85a137a68 Fix scan-build warning 2023-05-03 15:32:19 -04:00
Benjamin Otte
778979cf0e testsuite: Use GLTextureBuilder 2023-04-27 06:40:47 +02:00
Matthias Clasen
dbefc330bd Add some more keysyms tests
Spot-check a few keypad symbols.
2023-03-29 07:35:24 -04:00