Commit Graph

78681 Commits

Author SHA1 Message Date
Benjamin Otte
a28915bffb testsuite: Disable all failing tests on GL renderer
Of all the recently added tests, disable the ones that fail on the GL
renderer, so that CI passes.
2023-12-26 05:03:25 +01:00
Benjamin Otte
2af5f7ffd1 testsuite: Limit compare --mask tests to 1000x1000
There are some tests that generate large images.

However, if we mask that image, we might have to generate offscreens
both for the source and for the mask.
And if we do that, it can take a long time. And especially on CI with
software rendering, that can quickly become noticable and result in
timeouts.
2023-12-26 05:03:25 +01:00
Benjamin Otte
e1bae384f0 testsuite: Add a shadow test
This test tests that shadows that are offset to outside the clip region
but where the blur goes back into the clip region get correctly drawn
and not optimized away.

To view what the test actually draws, remove at least the color-matrix
- it's only used so the blurring algorithm doesn't cause different
results - and maybe also the clip node.
2023-12-26 05:03:24 +01:00
Benjamin Otte
12a97ef422 testsuite: Add a forgotten test
The test existed in git but wasn't hooked up. So let's do that by:

1. Adding it to the build
2. Adapting it a bit so rounding errors really don't trigger (as the
   original commit claimed they shouldn't).
3. Re-renaming it because this was actually about 3d gradients
2023-12-26 05:03:24 +01:00
Benjamin Otte
9a6d6e80b5 testsuite: Add a nonorthogonal linear-gradient transform
The actual gradient line is covered by blocks, so there are no
artifacts. But if a renderer screws this up, the blue/red will seep
through these blocks.
2023-12-26 05:03:24 +01:00
Benjamin Otte
7ed6c39862 snapshot: linear-gradients cannot be affine-transformed
When different scale factors are used to transform a diagonal
linear gradient, the angle between the gradient line and its
perpendicular is no longer a right angle, which makes the
gradient come out different.

So it is necessary to use transform nodes in that case so that the
correct gradient gets rendered.

Technically, the code could check if the scales are equal or the
gradient line is horizontal/vertical, but I don't think that's worth it.
2023-12-26 05:03:24 +01:00
Benjamin Otte
57a4500bae rendernode: Don't mark impure functions as pure
Functions with out arguments can never be pure, because they write to a
pointer.

But pure functions must have no side effects.
2023-12-26 05:03:24 +01:00
Benjamin Otte
b01ed4ce39 rendernode: Set better size for mask nodes
Mask nodes are transparent outside of the intersection of source and
mask, unless the mask ode is inverted alpha.

Set the bounds accordingly.

Tests have been updated accordingly.
2023-12-26 05:03:24 +01:00
Benjamin Otte
2b142a59a1 testsuite: Add compare tests for mask modes inside an opacity node 2023-12-26 05:03:24 +01:00
Benjamin Otte
20c81d90c9 testsuite: Add yet another repeat node test
This one tests that when no offscreen is created for repeating but we
drw everything individually, we still respect the clip set via
child_bounds.
2023-12-26 05:03:24 +01:00
Benjamin Otte
3167a5b4d6 testsuite: Rewrite the --repeat option
* Don't grow the size too much - clip the size to 1000x1000
 * Add an offset, so the repeating doesn't always start top left
2023-12-26 05:03:24 +01:00
Benjamin Otte
f5584b178d testsuite: Add a test for repeat node offscreen scaling
Ensure that the offscreens for repeat nodes pick the right xscale and
yscale so that they render pixel-aligned.
2023-12-26 05:03:24 +01:00
Benjamin Otte
332fd1b840 testsuite: Add a repeat testcase
This test tests multiple things:

1. That huge contents are properly clipped by repeat nodes, even if the
   repeat happens in the visible part
2. That repeating only horizontally or only vertically is done quickly
   via offscreens when lots of repeating is done
2023-12-26 05:03:23 +01:00
Benjamin Otte
5e85b1aa02 testsuite: Add a repeat test
Ensures that repeating actually causes repeating in the renderer by
repeating a 1x1 image a lot.
2023-12-26 05:03:23 +01:00
Benjamin Otte
7f7254f10b testsuite: Add a repeat test for child bounds
Test that if the child is a texture that extends the child bounds, that
extension does not get repeated when rendering.

This can easily happen when the child is not drawn as an offscreen, but
instead the texture cache is consulted and no check for matching size is
done.
2023-12-26 05:03:23 +01:00
Benjamin Otte
72c58ccd7d testsuite: Add another test
This test ensures that offscreens for cross-fade children are properly
clipped and that the renderers can deal with the two not overlapping.
2023-12-26 05:03:23 +01:00
Benjamin Otte
f574cc2936 testsuite: Add test for gradients
Test that it can do 64 color stops.

Should ensure that renderers either can do unlimited amounts or have
fallbacks in place.
2023-12-26 05:03:23 +01:00
Benjamin Otte
2b59c4cf16 testsuite: Test we don't crash with overly large nodes
... when these nodes are used as children of a complex transform nodes
and we lose the clip.
2023-12-26 05:03:23 +01:00
Benjamin Otte
72b35a32fd testsuite: Fix corner case when testing repeats
When we test repeat nodes, make sure we round the size of the original
node up to an integer.
The reference image for the node is a rounded up, so when we generate a
new reference image we cannot deal with anything else.

Fixes huge-width test with --repeat.
2023-12-26 05:03:23 +01:00
Benjamin Otte
97b78cede0 testsuite: Unify renderer exclusion naming
Instead of using "-3d" to exclude Cairo rendering, use "-no$renderer" to
allow excluding any renderer.
And because we use contains() for the check, we can exclude multiple
renderers by naming the test sth like "test-nogl-nocairo.node"
2023-12-26 05:03:23 +01:00
Benjamin Otte
653d1eec55 testsuite: Add a variant of an existing test
This variant ccreates a huge node in the clipped region and tests that
renderers properly clip it away.
2023-12-26 04:25:11 +01:00
Benjamin Otte
4cc2a660e3 testsuite: Add a render test for a recent segfault
Renderer tend to ignore the clip when offscreening the child of a blur
node. So make a test that oversizes that child.
2023-12-26 04:25:11 +01:00
Benjamin Otte
6ab6109149 rendernode: Redo repeat handling
The previous approach could lead to offscreens that were too large and
cause errors.
2023-12-25 19:12:57 +01:00
Matthias Clasen
e93acc5762 Merge branch 'fix-focus-events' into 'main'
main: Fix a corner case in crossing events

See merge request GNOME/gtk!6690
2023-12-23 19:23:54 +00:00
Matthias Clasen
290c02b123 window: Fix focus event generation
Sync the code in gtkwindow.c that generates focus change events
with the similar code in gtkmain.c that generates crossing events.

This fixes assertion failures that would trigger in nautilus when
opening a folder.
2023-12-23 13:00:29 -05:00
Matthias Clasen
64db415e67 main: Fix a corner case in crossing events
We don't want to set a misleading descendent in the case that
we don't have a shared ancestor at all (because the old and the
new targets are on different toplevels).
2023-12-23 13:00:29 -05:00
Matthias Clasen
ed7ff78a0d Merge branch 'enums-docs' into 'main'
docs: Improve docs for enums

See merge request GNOME/gtk!6609
2023-12-22 15:50:10 +00:00
Maximiliano Sandoval R.
e857f0a3af Add Since annotations to enums
Doing this in a way that is picked up by gobject-introspection
requires splitting off new enum members into separate doc
comments, which is a bit unfortunate.
2023-12-22 08:47:47 -05:00
Matthias Clasen
9e8adb9792 Merge branch 'wip/snwh/symbolic-assets-sync' into 'main'
gtk: Update symbolic icons with newer assets from Adwaita

See merge request GNOME/gtk!6686
2023-12-21 19:31:09 +00:00
Benjamin Otte
4e84312a5a Merge branch 'wip/otte/for-main' into 'main'
dmabuf: Let the EGL code initialize GL

See merge request GNOME/gtk!6685
2023-12-21 18:03:36 +00:00
Sam Hewitt
5d84b757e2 gtk: Update symbolic icons with newer assets from Adwaita 2023-12-21 14:11:21 -03:30
Benjamin Otte
c21ca4811e vulkan: Require Vulkan 1.3
Some dmabuf formats were added in Vulkan 1.3.

Note that this does not require the Vulkan drivers to be version 1.3 -
it just means compilation against libvulkan 1.3
2023-12-21 17:21:54 +01:00
Benjamin Otte
96152303a6 dmabuf: Let the EGL code initialize GL
The EGL downloader initialization already calls prepare_gl(), so no need
to call it in init_dmabuf_formats(), too.
2023-12-21 17:21:52 +01:00
Matthias Clasen
fe07337e02 Merge branch 'ebassi/scrolled-window-doc-fix' into 'main'
docs: Clarify behaviour of GtkScrolledWindow child accessors

See merge request GNOME/gtk!6683
2023-12-21 12:30:14 +00:00
Matthias Clasen
312c0f0b3b Merge branch 'fix-crossing-events' into 'main'
main: Fix crossing event setup

Closes #6279

See merge request GNOME/gtk!6684
2023-12-20 21:50:33 +00:00
Matthias Clasen
adc9cc568e main: Check crossing invariants on both legs
We were calling check_crossing_invariants for the ascending
part, but not for the descending part. Fix that.
2023-12-20 15:26:05 -05:00
Matthias Clasen
3e59b0b582 Fix a typo
This unfortunate typo made it so we never actually checked
the crossing invariants.
2023-12-20 15:26:05 -05:00
Matthias Clasen
6a5ee99c23 main: Fix crossing event setup
We were not determining the new descendent correctly. And since
our invariants check was ineffective, nobody noticed until now.

Fixes: #6279
2023-12-20 15:25:50 -05:00
Matthias Clasen
8fda63c85e Merge branch 'pragma-once-header-cleanup' into 'main'
media: Convert headers to #pragma once

See merge request GNOME/gtk!6682
2023-12-20 18:38:42 +00:00
Emmanuele Bassi
eccf0a6905 docs: Clarify behaviour of GtkScrolledWindow child accessors
Right now, it's mentioned only in the class description of
GtkScrolledWindow that the accessors of the child property don't
necessarily roundtrip.

Let's make it more clear by expanding the documentation of the setter,
getter, and property.

See: #6275
2023-12-20 17:50:30 +00:00
Matthias Clasen
cfa9dc6162 testsuite: Use #pragma once consistently 2023-12-20 10:55:14 -05:00
Matthias Clasen
9f068866e2 examples: Use #pragma once consistently
It is our current coding style.
2023-12-20 10:29:45 -05:00
Matthias Clasen
0d03e570b0 tests: Use #pragma once consistently
Its the current coding style.
2023-12-20 10:25:41 -05:00
Matthias Clasen
0dcf31292d icon-browser: Use #pragma once consistently
That is the current coding style.
2023-12-20 10:24:05 -05:00
Matthias Clasen
4ab18b6657 gtk4-demo: Use #pragma once consistently
This is our current coding style.
2023-12-20 09:55:11 -05:00
Matthias Clasen
957d96102a gtk: Use #pragma once consistently
One header snuck in missing it.
2023-12-20 09:52:04 -05:00
Matthias Clasen
d21a691f44 node-editor: Convert headers to #pragma once
That is our current coding style.
2023-12-20 09:51:19 -05:00
Matthias Clasen
ae5ea8e495 printing: Convert headers to #pragma once
That is our current coding style.
2023-12-20 09:44:29 -05:00
Matthias Clasen
bbabb1973c media: Convert headers to #pragma once
This is our current coding style.
2023-12-20 09:43:54 -05:00
Benjamin Otte
d2a85abf79 Merge branch 'wip/otte/dmabuf-refactoring' into 'main'
dmabuf refactoring

See merge request GNOME/gtk!6678
2023-12-20 10:25:29 +00:00