Commit Graph

79272 Commits

Author SHA1 Message Date
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
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
Matthias Clasen
230aa7899e Merge branch 'wip/abono/dma-buf' into 'main'
dmabufformats: Include gdkdmabuffourccprivate.h

See merge request GNOME/gtk!6896
2024-02-13 13:59:26 +00:00
Alessandro Bono
cc51604267 dmabufformats: Include gdkdmabuffourccprivate.h
It includes a fallback list of fourccs. Otherwise we might miss some
DRM_FORMAT definition.

This happens in SLES12:
```
../testsuite/gdk/dmabufformats.c: In function ‘test_dmabuf_formats_basic’:
../testsuite/gdk/dmabufformats.c:29:56: error: ‘DRM_FORMAT_ABGR16161616F’ undeclared (first use in this function); did you mean ‘DRM_FORMAT_ABGR2101010’?
   29 |   g_assert_true (gdk_dmabuf_formats_contains (formats, DRM_FORMAT_ABGR16161616F, DRM_FORMAT_MOD_LINEAR));
```
2024-02-13 14:15:32 +01:00
Alessandro Bono
3b2622267d testdmabuf: Include gdkdmabuffourccprivate.h
It includes a fallback list of fourccs. Otherwise we might miss some
DRM_FORMAT definition.
2024-02-13 14:15:32 +01:00
Alessandro Bono
4fc05e7c64 dmabuftexture: Include gdkdmabuffourccprivate.h
It includes a fallback list of fourccs. Otherwise we might miss some
DRM_FORMAT definition.
2024-02-13 14:15:32 +01:00
Alessandro Bono
4e680cae48 gtkgstsink: Include gdkdmabuffourccprivate.h
It includes a fallback list of fourccs. Otherwise we might miss some
DRM_FORMAT definition.
2024-02-13 14:15:32 +01:00
Alessandro Bono
d957e40a63 gdkglcontext: Include gdkdmabuffourccprivate.h
It includes a fallback list of fourccs. Otherwise we might miss some
DRM_FORMAT definition.
2024-02-13 14:15:32 +01:00
Alessandro Bono
d1bc8e580d gdkdmabuffourccprivate: Include config.h
Do so before checking HAVE_DMABUF presence.
2024-02-13 14:15:32 +01:00
Sabri Ünal
5dadee1591 Update Turkish translation 2024-02-13 12:10:05 +00:00
Matthias Clasen
ea7a61a763 gpu: Print globals when being verbose
This can be helpful to see that there is an enormous scale blowing
things up. We omit the matrix, since it is 16 floats that are hard
to interpret at a glance.
2024-02-13 06:59:58 -05:00
Matthias Clasen
8bd6927daf Merge branch 'dboles/CSSProvider-to_string-load_from_string' into 'main'
CSSProvider: Mention non-deprecated fn @ to_string

See merge request GNOME/gtk!6894
2024-02-12 23:32:23 +00:00
Matthias Clasen
67912c1051 Merge branch 'inspector-gl-extensions' into 'main'
gl: Check for the right extension name

See merge request GNOME/gtk!6893
2024-02-12 22:55:05 +00:00
Matthias Clasen
6314a5240d inspector: Show more gl extensions 2024-02-12 16:57:46 -05:00
Daniel Boles
e7f55d8706 CSSProvider: Mention non-deprecated fn @ to_string
load_from_data() is deprecated, so don't cite it in to_string(); rather,
mention load_from_string() instead.
2024-02-12 21:28:24 +00:00
Matthias Clasen
671756cb13 Merge branch 'llvmpipe-be-gone' into 'main'
gsk: Don't use gpu renderers with llvmpipe

See merge request GNOME/gtk!6890
2024-02-12 21:16:48 +00:00
Matthias Clasen
7cf567b4f9 gl: Check for the right extension name
The extension is called GL_OES_vertex_half_float.
2024-02-12 16:13:54 -05:00
Yuri Chornoivan
82e695d94a Update Ukrainian translation 2024-02-12 20:09:57 +00:00
Matthias Clasen
2104d7b062 fixup! gsk: Don't use gpu renderers with llvmpipe 2024-02-12 14:41:14 -05:00
Matthias Clasen
6c4739a2f1 gsk: Don't use gpu renderers with llvmpipe
Unless the renderer has been explicitly selected via the
GSK_RENDERER environment variable, don't use it with llvmpipe.

It is important that we allow explicit setting to override
this, so we can continue to use ngl in ci, where we don't
have hw and want to test with llvmpipe.

This should address many of the "performance is terrible in
GNOME OS" complaints that are coming from people running in
VMs, etc.
2024-02-12 14:19:57 -05:00
Matthias Clasen
f858daeca4 node-editor: Don't help too much
This was somehow duplicated when the reload action was added.
2024-02-12 14:19:21 -05:00
Matthias Clasen
efa0033fb4 inspector: Spell out Vulkan device types
We know what these are, no need to be mysterious about it.
2024-02-12 14:19:21 -05:00
Matthias Clasen
546378e65c Merge branch 'no_duplicate_descriptions' into 'main'
a11y: When using the tooltip for accessible name, don't use it for description

See merge request GNOME/gtk!6829
2024-02-12 17:04:43 +00:00
Matthias Clasen
a997dea414 Merge branch 'link-to-code-formatting-changed' into 'main'
clang-format: The link to code formatting has changed

See merge request GNOME/gtk!6891
2024-02-12 17:03:37 +00:00
Danial Behzadi
e75af999dc Update Persian translation 2024-02-12 15:56:40 +00:00
Ahmed Baizid
e8dcbbe86f clang-format: The link to code formatting has changed 2024-02-12 15:51:41 +01:00
Matthias Clasen
3c048caa30 Merge branch 'wip/nacho/scale-button-has-frame' into 'main'
scalebutton: add api to get/set whether it has a frame

See merge request GNOME/gtk!6779
2024-02-12 14:19:45 +00:00
Matthias Clasen
925d2ba9ae Merge branch 'wip/otte/for-main' into 'main'
gpu: Avoid offscreens for disjoint containers

See merge request GNOME/gtk!6889
2024-02-12 12:58:14 +00:00
Ekaterine Papava
645070ef7f Update Georgian translation 2024-02-12 11:41:10 +00:00
Benjamin Otte
2fe1f47e6d gpu: Avoid offscreens for disjoint containers
When opacity is set but the container is disjoint - ie no children
overlap - don't redirect into an offscreen, because it's not necessary.
2024-02-12 08:34:18 +01:00
Matthias Clasen
db8f87d539 Post-release version bump 2024-02-11 22:45:59 -05:00
Matthias Clasen
a75d97c788 4.13.7 2024-02-11 22:38:52 -05:00
Matthias Clasen
ea9e414ad6 Skip one more failing clipped render test 2024-02-11 22:38:52 -05:00
Matthias Clasen
c1bcbcdee5 Merge branch 'offload-padding' into 'main'
offload: handle dmabufs with viewports

See merge request GNOME/gtk!6833
2024-02-12 03:12:46 +00:00
Robert Mader
8f293f3153 gstreamer: Bump required version for offloading
This version is guaranteed to have all features in place.
2024-02-11 21:50:50 -05:00
Matthias Clasen
70380661fe testdmabuf: Test dmabuf viewports
Allow specifying padding via --padding. The argument to --padding
is a string of up to 4 comma-separated numbers, for the left, right,
top, bottom padding. If less numbers are given, the remaining ones
are set to zero.

This commit also includes an image that can be used for testing with

testdmabuf --padding 20,20,20,20 NV12 padded.png
2024-02-11 21:49:34 -05:00
Matthias Clasen
d91d0f1c0a gstreamer: Pass viewport along
Obtain the viewport from gstreamer, and pass it to the paintable
implemenation, which adds a clip node around the texture to enforce
the viewport.
2024-02-11 21:44:47 -05:00
Matthias Clasen
1db696be79 offload: Find and use source rectangle
Look for nodes like subsurface { clip { texture {} } }, and use
the clip to provide a source rectangle for subsetting the texture.

Update affected tests, and add a new one.
2024-02-11 21:44:47 -05:00
Matthias Clasen
9a30ea1f69 subsurface: Have a source rectangle
This will let us use a subset of the full texture, which can
be necessary in the case that converters put padding around
content in dmabufs. The naming follows the Wayland viewporter
spec.

For now, make all callers pass the full texture rect.
2024-02-11 21:44:27 -05:00
Matthias Clasen
0495359eca subsurface: Rename rect to dest
We are going to introduce another rect, so better to be clear in
naming. We are following the naming of the Wayland viewporter spec
and call the rectangle that we drawing into the dest(ination).
2024-02-11 21:43:51 -05:00
Matthias Clasen
1995b9d92c Merge branch 'wip/otte/offload' into 'main'
Rework offload diff handling

See merge request GNOME/gtk!6879
2024-02-12 02:33:14 +00:00
Matthias Clasen
29c0babdda Merge branch 'matthiasc/for-main' into 'main'
testdmabuf: Add another shortcut

See merge request GNOME/gtk!6888
2024-02-12 02:15:22 +00:00
Matthias Clasen
5b55456b75 Rework diffing one more time
Pass the surface along. We need it to identify the inspector case
in gsk_subsurface_node_diff.
2024-02-11 20:48:59 -05:00
Matthias Clasen
70205f59a4 Merge branch 'render-clip-tests' into 'main'
gsk: Add a clip variant to compare tests

See merge request GNOME/gtk!6880
2024-02-12 01:45:55 +00:00
Matthias Clasen
df7889d7f3 testdmabuf: Add another shortcut
Make the picture not expand, and add Ctrl-S to toggle the
horizontal alignment between start and center. This makes the
offloaded picture move under the overlaid controls, or out
from under them, triggering some offloading transitions.
2024-02-11 20:43:56 -05:00
Matthias Clasen
26c25cc6b7 Simplify gsk_subsurface_node_diff
Most of the time, the subsurfaces will be the same. And if they
aren't, can_diff() will return FALSE anyway.
2024-02-11 20:24:28 -05:00
Matthias Clasen
2cf90b6158 tests: Add a note
Point out a little gotcha.
2024-02-11 20:24:28 -05:00
Matthias Clasen
f8e89f2224 offload: Do diff collection later
We were collecting diffs based on the can_offload/can_raise
information, but attaching the texture to the subsurface can
fail (e.g. if its not a dmabuf texture), in which case can_offload
turned out to be wrong. So move the diff collection to the end
and do it based on the whether we actually succeeded in attaching
the texture.
2024-02-11 20:24:28 -05:00
Benjamin Otte
30afac9a6b offload: No need to pass the offload to the diff
We can just check if the subsurfaces contain content - and if they do,
they will be offloading and we can ignore the diff.

This essentially reverts 48740de71a
2024-02-11 20:24:28 -05:00
Benjamin Otte
dac56dd757 offload: Change the way we compute damage regions
Instead of relying on diffing subsurface nodes, we track damage
generated by offloaded contents inside GskOffload.

There are 3 stages a subsurface node can be in:

1. not offloaded
   Drawing is done by the renderer
2. offloaded above
   The renderer draws nothing
3. offloaded below
   The renderer needs to punch a hole.

Whenever the stage changes, we need to repaint.
And that can happen without the subsurface's contents changing, like
when a widget is put above the subsurface and it needs to to go from
offloaded above to below.

So we now recruit GskOffload for tracking these changes, instead of
relying on the subsurface diffing.

But we still need the subsurface diffing code to work for the
non-offloaded case, because then the offloading code is not used.
So we keep using it whenever that happens.

Not that when a subsurface transitions between being offloaded and not
being offloaded, we may diff it twice - once in the offload code and
once in the node diffing - but that shouldn't matter.
2024-02-11 20:24:28 -05:00