Commit Graph

79264 Commits

Author SHA1 Message Date
Matthias Clasen
e1722777e5 Merge branch 'drag-out-of-fullscreen' into 'main'
gtk: Make window handles work when attached to fullscreen windows

See merge request GNOME/gtk!6825
2024-01-29 13:15:46 +00:00
Matthias Clasen
24850dff0e Merge branch 'fix-gc-context' into 'main'
gpu: Call make current before gc

Closes #6366

See merge request GNOME/gtk!6826
2024-01-29 13:13:43 +00:00
Matthias Clasen
d790268031 gsk: Move gc calls
maybe_gc() may make a different context current, so do it before
the renderer has made its own context current.
2024-01-29 08:12:27 -05:00
Matthias Clasen
89712fc750 gpu: Fix syntax confusion. 2024-01-29 08:12:27 -05:00
Matthias Clasen
9b62a5c931 gpu: Drop an unused argument
The timestamp wasn't used in atlas creation.
2024-01-29 08:12:27 -05:00
Matthias Clasen
fbf3836502 gpu: Drop excessive logging
This was logging every frame, which is too much.
2024-01-29 08:12:27 -05:00
Matthias Clasen
8d80f97597 gpu: free non-atlased glyphs
"Only free glyphs when their atlas is freed" works great for
glyphs that are on an atlas. Don't forget the others.
2024-01-29 08:12:27 -05:00
Matthias Clasen
e6ec8133a5 gpu: Don't weak unref too much
We can reach the code that removes the item from the hash table
before or after the weak unref has triggered. Just leave the
weakref in place and let it do its thing, if it hasn't gone
off yet. That matches what we do in free.

Fixes: #6377
2024-01-29 08:11:25 -05:00
Matthias Clasen
6b436fdbbb gsk: Move gc calls
maybe_gc() may make a different context current, so do it before
the renderer has made its own context current.
2024-01-29 07:49:59 -05:00
Matthias Clasen
7b2b5469eb gpu: Call make current before gc
We do gc in a timeout, when an arbitrary GL context might be
current, so we need to make sure its ours and we don't free
random textures in another context.

Fixes: #6366
2024-01-29 07:39:57 -05:00
Benjamin Otte
3fc325d799 Merge branch 'dmabuf-texture-gst-v4l2' into 'main'
gstsink: Add support for DMABuf import and graphics offload

See merge request GNOME/gtk!6618
2024-01-29 11:06:11 +00:00
Ben Mather
dee6742931 gtk: Allow windows to be dragged out of fullscreen using a window handle
Window handles allow windows to be dragged from maximized to restored,
but when the window is fullscreen they do nothing.  With this change,
windows will be unfullscreened when dragged.
2024-01-29 09:51:16 +00:00
Robert Mader
d2097d0449 gstsink: Add support for DMABuf import and graphics offload
By implementing support for `GdkDmabufTextureBuilder` and
`GstVideoInfoDmaDrm`. This allows zero-copy video playback on Wayland
when paired with hardware video decoding.

Can be tested with `gtk4-demo --run=video_player`
2024-01-28 19:09:41 +01:00
Matthias Clasen
c7f00d51eb Merge branch 'wayland-empty-frame' into 'main'
wayland: Add a way to check if a surface is dirty

See merge request GNOME/gtk!6822
2024-01-28 17:02:29 +00:00
Matthias Clasen
f5308dfbec wayland: Commit empty frames if needed
If we have outstanding double-buffered state (other than the
buffer itself), commit a frame even if its 'empty'.
2024-01-28 11:44:16 -05:00
Matthias Clasen
1097e1349c wayland: Add a way to check if a surface is dirty
We keep various pieces of double-buffered state on our side,
and then explicitly sync it over to the Wayland side.

Add a function to find out if we have any.
2024-01-28 11:44:16 -05:00
Benjamin Otte
d577e4421e Merge branch 'gpu-cache-fixes' into 'main'
gpu: Caching fixes

See merge request GNOME/gtk!6817
2024-01-28 16:13:25 +00:00
Matthias Clasen
1bac8b439a gpu: Be more aggressive about cache gc
Count dead pixels in textures (ie the number of pixels in GPU
textures that are no longer backed by an alive GdkTexture object),
and when the there's too many, do a gc before rendering the next
frame.
2024-01-28 11:00:07 -05:00
Matthias Clasen
ee52e98b7d gpu: Redo texture caching
Count the uses of cached texture - from the device (via the linked
list) and from the texture (via render data / weak ref), and only
free the item once the use count reaches zero.
2024-01-28 10:50:46 -05:00
Matthias Clasen
5e4eda15c9 gpu: Trigger cache gc from the renderer
Instead of forever running a timeout to do gc, ensure the timeout
is scheduled whenever we render a frame (this is done by calling
gsk_gpu_device_maybe_gc () before gsk_gpu_frame_render (), and
gsk_gpu_device_queue_gc () after).
2024-01-28 10:50:19 -05:00
Matthias Clasen
e861ea4bd2 gpu: Add a knob for cache GC
Read the GSK_CACHE_TIMEOUT environment variable to override the
default 15s timeout for cache gc. This is mainly meant for debugging.

Since we don't really need two knobs, reuse the gc timeout value
for the max age of items too.
2024-01-28 10:49:57 -05:00
Matthias Clasen
8009ed3a3c gpu: Add more details to debug spew
Print the number of items in the cache hash tables.
2024-01-27 19:50:45 -05:00
Matthias Clasen
1d95a171f6 gpu: Don't forget to unage cached textures
Whenever we successfully looking up a cached item, we need to
call use() on it to mark it as fresh.
2024-01-27 19:50:41 -05:00
Matthias Clasen
e0136b283a Cosmetics 2024-01-27 19:49:58 -05:00
Matthias Clasen
42867c7a3c Cosmetics 2024-01-27 19:49:57 -05:00
Ekaterine Papava
40f20fee3d Update Georgian translation 2024-01-27 17:15:52 +00:00
Matthias Clasen
63e814a45f Merge branch 'matthiasc/for-main' into 'main'
node-editor: Make the crash warning work

Closes #6370

See merge request GNOME/gtk!6820
2024-01-27 16:43:08 +00:00
Matthias Clasen
c1270cf52b gpu: Fix a crash in vulkan
The node processing wasn't skipping 0-size nodes when using the
uber shader, leading to assertions down the road. Since the ngl
renderer doesn't use uber shaders, this only affects vulkan.

Test included.

Fixes: #6370
2024-01-27 10:30:38 -05:00
Matthias Clasen
f2ec2f2a58 node-editor: Make the crash warning work
In some cases, we leave behind both an autosave and an
autosave-unsafe file, so check for the unsafe one first.
2024-01-27 10:21:26 -05:00
Benjamin Otte
e67bb62b1f Merge branch 'wip/otte/6363' into 'main'
gpu: Add support for MacOS default framebuffer

See merge request GNOME/gtk!6815
2024-01-27 15:15:38 +00:00
Arjan Molenaar
c17ac8c599 Add empty callbacks for Gdk.DrawContext.empty_frame on macOS 2024-01-27 15:34:59 +01:00
Matthias Clasen
ee8a800763 Merge branch 'matthiasc/for-main' into 'main'
nodeparser: Fix a font handling mishap

See merge request GNOME/gtk!6818
2024-01-27 08:30:37 +00:00
Matthias Clasen
746cfe48b0 nodeparser: Fix a font handling mishap
When we don't have an embedded font file via a url, then we want
to parse fonts "as normal", i.e. allow fallback for aliases like
"Monospace 10". This was broken when the url support was added.
Make it work again.

Update affected tests. In particular, the output of the text-fail
test goes back to be the same it was before the url changes.
2024-01-26 23:54:58 -05:00
Benjamin Otte
3a93d52718 gpu: Add support for MacOS default framebuffer
This adds the same code as the GL renderer used to allow backends to
redirect rendering to a different framebuffer.

Related: #6363
2024-01-26 16:55:49 +01:00
Benjamin Otte
1994e1940c Merge branch 'wip/otte/6363' into 'main'
gpu: Don't use layout binding in old GL versions

Closes #6363

See merge request GNOME/gtk!6814
2024-01-26 15:46:08 +00:00
Benjamin Otte
d74855fe9f gpu: Don't use layout binding in old GL versions
GL needs version 4.2 before it supports explicit bindings. We use GLES
usually, and Mesa supports GL 4.6, so we didn't hit this case before.

However, MacOS does use GL and Mac OS is stuck on GL 4.1.

Fixes #6363
2024-01-26 14:17:16 +01:00
Emmanuele Bassi
979749a3bc Merge branch 'ewlsh/add-accessible-relation-list' into 'main'
gtk: Add AccessibleList to enable relations in bindings

Closes #6358

See merge request GNOME/gtk!6807
2024-01-26 10:52:26 +00:00
Fran Dieguez
29c7725416 Update Galician translation 2024-01-26 09:57:16 +00:00
Matthias Clasen
3abf6acb16 Post-release version bump 2024-01-25 16:25:26 -05:00
Matthias Clasen
df8cf0e030 Use software rendering for testsuite runs
We need to force software rendering, or test failures will cause
meson dist to fail.
2024-01-25 16:25:26 -05:00
Matthias Clasen
7952b2a0bc 4.13.6 2024-01-25 16:25:26 -05:00
Matthias Clasen
c98e568583 Merge branch 'ngl-by-default' into 'main'
gsk: Change the default renderer

See merge request GNOME/gtk!6809
2024-01-25 20:41:32 +00:00
Matthias Clasen
f90e77d173 gdk: Enable fractional scaling for GL by default
The ngl renderer has good support for fractional scaling, so we
can enable this by default now.

If you are using the gl renderer, you can disable fractional
scaling with the

GDK_DEBUG=gl-no-fractional

environment variable.
2024-01-25 14:41:04 -05:00
Matthias Clasen
98e3fca284 gsk: Change the default renderer
The intent of this change to get wider testing and verify that the
new renderers are production-ready. If significant problems show
up, we will revert this change for 4.14.

The new preference order is ngl > gl > vulkan > cairo.

The gl renderer is still there because we need it to support gles2
systems, and vulkan still has some rough edges in application support
(no gl area support, webkit only works with gl).

If you need to override the default renderer choice, you can
still use the GSK_RENDERER environment variable.
2024-01-25 14:41:04 -05:00
Benjamin Otte
a7c98227e6 Merge branch 'wip/antoniof/fix-section-tiles' into 'main'
gtklistitemmanager fixes

See merge request GNOME/gtk!6805
2024-01-25 19:31:35 +00:00
Benjamin Otte
f2856e494c Merge branch 'wip/otte/for-main' into 'main'
gpu: Fix variable

See merge request GNOME/gtk!6812
2024-01-25 19:26:44 +00:00
Benjamin Otte
dc1f12682c testsuite: Add a test for zero width borders
See previous commit for an explanation of the problem.

This test actually draws a rounded border, but the rounding is clipped
away. What is remaining is the 4 corners of the border, where the
top/bottom color is red and the left/right color is green. But because
the bottom/right side has a width of zero, the result should be all red.
2024-01-25 19:39:34 +01:00
Benjamin Otte
502fb250ab gpu: Fix zero-width border corner rendering
When a border side has a width of 0 but we're having rounded corners, we
draw content in the edges of that side, and naturally pick its color.
That is wrong though, when the width is zero, we're supposed to keep
using the color of the other side in that corner.

So do that.

Fixes the border-corner-zero-width-rendering.ui reftest.
2024-01-25 19:39:34 +01:00
Benjamin Otte
7d7d3ff35c gpu: Fix variable
I had a test that allocated over 4GB of ops and...
2024-01-25 19:08:32 +01:00
António Fernandes
9fb449793d listitemmanager: Fix section change handler mistake
The statement is not doing what it was meant to do.

gtk_list_item_manager_get_nth (self, position, &offset) returns the
tile for a given position, and if the tile maps to more than 1 item,
the offset indicates how far into that tile the given position is.

So position - offset would give us the position of this tile. It
doesn't make sense to subtract it from n_items.

Instead, we should be adding the offset to compensate for having
landed too early in the list, such that we successfully reach
position + n_items.
2024-01-25 17:35:56 +00:00