Commit Graph

79625 Commits

Author SHA1 Message Date
Matthias Clasen
24de5ffd4e gsk: Stop padding text node bounds
This should not be necessary, provided that the ink extents that
pango provides are accurate.

Update affected tests.
2024-02-16 14:45:20 -05:00
Benjamin Otte
4933bc505f gpu: External textures are never mipmap'able
We were just assuming they were if the format matches.

Fixes crashes in Webkit where the external texture is actually a dmabuf
imported as an EGL image.
2024-02-16 20:16:38 +01:00
Matthias Clasen
ecbee35f93 Merge branch 'matthiasc/for-main' into 'main'
gtk-demo: Add keywords to some demos

See merge request GNOME/gtk!6910
2024-02-16 16:37:07 +00:00
Matthias Clasen
5552b5c0ec ci: Add another xfail
This is reported in
https://gitlab.gnome.org/GNOME/gtk/-/issues/6450
2024-02-16 11:13:57 -05:00
Matthias Clasen
2baa899e32 NEWS: Add a new about mesa versions 2024-02-16 10:55:05 -05:00
Matthias Clasen
aaaddd1b47 testsuite: Mark the randomized path tests as flaky
They are, and having them run in ci is counterproductive for now.
2024-02-16 10:24:58 -05:00
Matthias Clasen
d4d4c7e119 gtk-demo: Add keywords to some demos
Folks had trouble finding the 'suggestion entry' demo.
2024-02-16 10:13:55 -05:00
Matthias Clasen
ea33264a87 Merge branch 'wip/abono/meson-dma-buf' into 'main'
meson: Don't make linux/dma-buf.h a requirement for Linux

See merge request GNOME/gtk!6904
2024-02-16 14:40:21 +00:00
Alessandro Bono
4054f33221 meson: Don't fail when linux/dma-buf.h is missing
We just don't define HAVE_DMABUF in this case.
2024-02-16 14:04:46 +01:00
Alessandro Bono
b6767d2eef meson: Decouple linux/dma-buf.h and libdrm checks
Currently dmabuf_dep is found when the following conditions are met:
 - linux/dma-buf.h is present;
 - libdrm is found.

This is because Linux dmabuf support requires drm_fourcc.h which is part
of libdrm.

However, dmabuf_dep is used for two purposes:
 - define HAVE_DMABUF to state dmabuf support;
 - ensure the presence of drm_fourcc.h for gdk and for the
   media-gstreamer module.

Decouple this, unconditionally check for libdrm and require it on
Linux. Then, use libdrm_dep only to state the drm_fourcc.h presence.

Given that now we unconditionally require libdrm on Linux, HAVE_DMABUF
depends only on the linux/dma-buf.h presence.
2024-02-16 14:01:44 +01:00
Matthias Clasen
90d84a2af8 Merge branch 'michaelweghorn/a11y_fix_accessible_at_point' into 'main'
a11y: Return the actual object at the point requested by AT-SPI "GetAccessibleAtPoint"

Closes #6448

See merge request GNOME/gtk!6909
2024-02-15 18:10:53 +00:00
Alessandro Bono
eb34311c2c meson: Sort alphabetically 2024-02-15 18:25:27 +01:00
Michael Weghorn
ea7ddc031c a11y: Fix bounds check for AT-SPI GetAccessibleAtPoint
In `accessible_at_point`, fix the check whether the
given point is inside of the accessible's bounds.

For that to be the case, the point's x coordinate
must be somewhere between the X position of the
accessible's bounds and that position + width.
(Likewise for the y coordinate and the height.)

the previous check would only work correctly
for children located at a relative location
of (0, 0) within the parent.

With this and the previous commit in place,
the (extended) example from issue #6448 now gives
the expected result:
an accessible object in whose bounds include
requested point (50, 50) lies:

    In [19]: acc.queryComponent().getExtents(pyatspi.WINDOW_COORDS)
    Out[19]: [0, 0, 800, 600]
    In [20]: acc.queryComponent().getAccessibleAtPoint(50, 50, pyatspi.WINDOW_COORDS)
    Out[20]: <Atspi.Accessible object at 0x7fae500e9180 (AtspiAccessible at 0x33455b0)>
    In [21]: acc.queryComponent().getAccessibleAtPoint(50, 50, pyatspi.WINDOW_COORDS).queryComponent().getExtents(pyatspi.WINDOW_COORDS)
    Out[21]: [6, 1, 68, 49]

Fixes: #6448
2024-02-15 18:11:55 +01:00
Michael Weghorn
1ff17f1a7e a11y: Ensure accessible queried by GetAccessibleAtPoint is realized
In the the handling of the "GetAccessibleAtPoint" AT-SPI Component
method, make sure that the context of the accessible at the
given point is realized so that a reference can be returned.

Otherwise, the called `gtk_at_spi_context_to_ref` will return
a null ref instead.

The same is already done in the handling for other AT-SPI methods,
(s. "GetRelationSet", "GetChildren", "GetChildAtIndex" in
gtk/a11y/gtkatspicontext.c).

With this in place, an accessible will be returned.
It's not necessarily the one that's really at the requested location,
but that's a different issue that will be addressed in a separate
commit.

With this in place, example from issue #6448 now gives this result
when using Accerciser's IPython console:

    In [16]: acc.queryComponent().getExtents(pyatspi.WINDOW_COORDS)
    Out[16]: [0, 0, 800, 600]
    In [17]: acc.queryComponent().getAccessibleAtPoint(50, 50, pyatspi.WINDOW_COORDS)
    Out[17]: <Atspi.Accessible object at 0x7fae500e8540 (AtspiAccessible at 0x308bf40)>
    In [18]: acc.queryComponent().getAccessibleAtPoint(50, 50, pyatspi.WINDOW_COORDS).queryComponent().getExtents(pyatspi.WINDOW_COORDS)
    Out[18]: [683, 1, 111, 49]

-> an accessible is returned now, but its rectangle starts at
X coordinate 683, so the requested point (50, 50) is not in its
bounding box.

Issue: #6448
2024-02-15 18:11:09 +01:00
Fran Dieguez
8232ab4440 Update Galician translation 2024-02-15 02:26:47 +00:00
Matthias Clasen
bb82e3e1fb Merge branch 'matthiasc/for-main' into 'main'
testsuite: Drop duplicated rounded-rect tests

See merge request GNOME/gtk!6907
2024-02-14 20:21:47 +00:00
Benjamin Otte
1702cdaff6 Merge branch 'wip/otte/for-main' into 'main'
gpu: Render enough of a scaled texture offscreen

Closes #6428 and #6439

See merge request GNOME/gtk!6902
2024-02-14 19:30:58 +00:00
Matthias Clasen
a4583b03a1 testsuite: Drop duplicated rounded-rect tests
No need to test this twice in a row.
2024-02-14 14:12:43 -05:00
Benjamin Otte
b12169776e testsuite: Print random clip rect
That makes it in test log output, which helps when figuring out why a
test failed if the node was not saved/is already deleted.
2024-02-14 20:12:05 +01:00
Benjamin Otte
85f85bbec8 build: Keep artifacts from asan build
We want to be able to investigate occasional failure results, in
particular those with randomness.
2024-02-14 20:12:05 +01:00
Benjamin Otte
afc7b46264 gpu: Add an epsilon before ceil()ing for offscreen size
Avoids getting the scale wrong when due to a rounding error our
pixel-aligned rectangle is 5.000000003px big and we ceil() to 6px
and produce blurry output.

Fixes #6439
2024-02-14 20:11:59 +01:00
Benjamin Otte
86db9e2ce0 gsk: Use gsk_rect_scale() in more places 2024-02-14 20:11:30 +01:00
Benjamin Otte
1afc7a9210 testsuite: Add a test for scaled texture clipping
This tests that the result is suitably clipped for doing linear
blending - the rightmost green pixel that is technically offscreen
is blending into the red pixel and turning the test yellow.

Cairo gets this wrong for some reason I didn't investigate.
2024-02-14 20:11:30 +01:00
Benjamin Otte
cb6c720d37 gpu: Render enough of a scaled texture offscreen
We were not thinking about pixel alignment and the potential later
linear blend for the final composite.

Fixes #6428
2024-02-14 20:11:29 +01:00
Matthias Clasen
35eae8751f Merge branch 'fix-rounded-rect-intersection' into 'main'
Add more rounded-rect intersection tests

Closes #6440

See merge request GNOME/gtk!6905
2024-02-14 18:59:32 +00:00
Matthias Clasen
a246d1a995 ci: Add an xfail
Add an xfail for the issue reported in #6444.
2024-02-14 13:32:37 -05:00
Jordi Mas
718d68eccd Update Catalan translation 2024-02-14 17:36:19 +01:00
Matthias Clasen
fb4023af22 Fix rounded rect intersection code
The code was written under the assumption that the corners of
the rounded rect are disjoint. If they aren't, there are a few
more cases to consider.

Fixes: #6440
2024-02-14 10:37:56 -05:00
Matthias Clasen
370ecd5d15 Add more rounded-rect intersection tests
Add rounded rect intersection tests with difficult rounded rects
where the corners are not disjoint (the 'evil eye').

The first half of these tests were provided by Benjamin Otte
in #6440, the other half was added by me to cover the flipped
version of the evil eye.
2024-02-14 10:37:56 -05:00
Matthias Clasen
fdff21ae13 testsuite: Don't use g_test_init
g_test_init has the ugly habit of aborting if G_DISABLE_ASSERT
is defined, and we want to run our tests in a release build too.

Use gtk_test_init instead, which works around this issue.
2024-02-14 10:37:56 -05:00
Matthias Clasen
69500f356e Merge branch 'normalize-node-bounds' into 'main'
Add gsk_rect_normalize

Closes #6435

See merge request GNOME/gtk!6901
2024-02-14 02:08:11 +00:00
Matthias Clasen
3b794c4951 Add a test for node bounds normalization
This tests the fixes in the previous commits for some node types.
2024-02-13 20:06:16 -05:00
Matthias Clasen
72614fdb67 gsk: Normalize node bounds upon creation
We lost this when a bunch of rect code was inlined in
commit 36314f28e2, and as it turns out, that broke some
applications. So, bring it back.

Fixes: #6435
2024-02-13 20:06:16 -05:00
Matthias Clasen
230ee92857 Add gsk_rect_normalize
This is an inline version of graphene_rect_normalize_in_place.
2024-02-13 20:06:16 -05:00
Daniel Rusek
c6c952477a Update Czech translation 2024-02-14 01:04:19 +00:00
Matthias Clasen
fd4f22bba5 Merge branch 'matthiasc/for-main' into 'main'
tests: Remove xfails for tests that work now

See merge request GNOME/gtk!6900
2024-02-13 23:54:23 +00:00
Matthias Clasen
1e8d7c7891 tests: Add a new xfail for a failing test
This is filed as #6439
2024-02-13 18:35:13 -05:00
Matthias Clasen
73316a83c4 tests: Remove xfails for tests that work now
We fixed some things, yay.
2024-02-13 17:31:18 -05:00
Matthias Clasen
b2d22d8125 Merge branch 'wip/abono/fallthrough' into 'main'
gsk: Remove unnecessary G_GNUC_FALLTHROUGH

See merge request GNOME/gtk!6898
2024-02-13 22:17:50 +00:00
Benjamin Otte
afb75bedfe Merge branch 'wip/otte/for-main' into 'main'
gpu: Don't oversize node image

Closes #6380 and #6425

See merge request GNOME/gtk!6899
2024-02-13 21:14:20 +00:00
Benjamin Otte
ee34781a13 gpu: Pixel-align the blur rectangle
Fixes blurriness in shadows.

Not sure to do a proper test for this feature. Usually proper pixel
alignment is tested by drawing a crips line and checking that it is
indeed crisp. But we are testing the blur operation here...

Fixes #6380
2024-02-13 21:56:01 +01:00
Benjamin Otte
9fc80a0bd5 gpu: Update blur code to newer internal API
The recommended way to draw offscreens has been init_draw() for a bit,
but apparently this code wasn't updated.
2024-02-13 21:56:01 +01:00
Benjamin Otte
d4203d147a testsuite: Add a test for shadow offset clipping 2024-02-13 21:56:01 +01:00
Benjamin Otte
a1dda0ec3c gpu: Adjust shadows clip by shadow offset
When computing the clip of the shadow rect, don't forget that it will
ultimately be offset by the shadow offset.

Fixes #6425
2024-02-13 21:56:01 +01:00
Benjamin Otte
f9b66dff8b testsuite: Add a test for shadows with large offset
This was causing crashes in the GPU renderer.

Related: #6425
2024-02-13 21:56:01 +01:00
Benjamin Otte
dbbc16947f gpu: Handle one layer of NULL return
This isn't really a useful thing in itself, because none of the callers
handle the NULL return.
But the resulting crash is easier to debug when it's a NULL image than
when add_node() is called on an uninitializes NodeProcessor.
2024-02-13 21:56:01 +01:00
Benjamin Otte
dc47abc60e gpu: Don't oversize node image
There's no need - even if given clip bounds - to render the parts
outside the node.

So clip to the node bounds.
2024-02-13 21:56:01 +01:00
Alessandro Bono
ca9ba3cc80 gsk: Remove unnecessary G_GNUC_FALLTHROUGH
In GSK the following pattern is used four times:
```
  switch (self->filter)
    {
      default:
        g_assert_not_reached ();
        G_GNUC_FALLTHROUGH;
      case GSK_GPU_BLIT_LINEAR:
        filter = GL_LINEAR;
        break;

      case GSK_GPU_BLIT_NEAREST:
        filter = GL_NEAREST;
        break;
    }
```
The G_GNUC_FALLTHROUGH macro is not required. When G_DISABLE_ASSERT
is defined the body of the `default` case is empty, thus there is
no need. When G_DISABLE_ASSERT is not defined the body of the `default`
case contains g_assert_not_reached() thus it won't fallthrough.

This resolves the following:
```
[221/1379] Compiling C object gsk/libgsk.a.p/gpu_gskgpublitop.c.o
[...]
error: fallthrough annotation in unreachable code [-Werror,-Wimplicit-fallthrough]
1 error generated.
```
2024-02-13 18:29:03 +01:00
Artur S0
59f6218426 Update Russian translation 2024-02-13 16:32:44 +00:00
Matthias Clasen
f533d08537 Merge branch 'matthiasc/for-main' into 'main'
gpu: Print globals when being verbose

See merge request GNOME/gtk!6897
2024-02-13 14:00:30 +00:00