Matthias Clasen
3ab7b2d7ce
Merge branch 'va-fixes-reported-by-pvs' into 'main'
...
Fix issues spotted by PVS-Studio
See merge request GNOME/gtk!6558
2023-11-15 00:27:08 +00:00
Matthias Clasen
429056c214
Merge branch 'wip/otte/for-mclasen' into 'main'
...
gl: Don't punch hole if the subsurface is above
See merge request GNOME/gtk!6567
2023-11-15 00:26:45 +00:00
Benjamin Otte
acecf519bc
offload: Reject non-integer rectangles
...
We shouldn't just fudge with coordinates if we want accurate rendering.
2023-11-14 21:55:10 +01:00
Benjamin Otte
b2fbdcda41
subsurface: Report better error messages when rejecting textures
2023-11-14 21:54:38 +01:00
Benjamin Otte
1b08fda93e
renderer: Remove offload argument from render()
...
It turns out it's not needed, because all relevant information for
subsurfaces is already available by querying the subsurface itself.
2023-11-14 21:54:35 +01:00
Benjamin Otte
f6b6176ec0
gl: Handle subsurfaces without GskOffload
2023-11-14 21:51:07 +01:00
Luca Bacci
2803189afd
Merge branch 'gdkwin32_modernize_clipboard' into 'main'
...
GdkWin32: switch to new clipboard API
Closes #442
See merge request GNOME/gtk!6560
2023-11-14 20:09:55 +00:00
g.willems
ad08c1444a
win32: precalculate keymap at display opening
...
The default keymap and keymap layouts are calculated on request.
If done once a surface is setup and listening at win32 events,
we may then enter in a recursive loop.
To avoid this, precalculate the keymap as soon as displays are open.
Fixes #6203
Closes #6203
2023-11-14 20:26:05 +01:00
Benjamin Otte
ef77a6fa73
gl: Don't punch hole if the subsurface is above
...
Saves some work.
2023-11-14 20:22:24 +01:00
Matthias Clasen
667f02ecd8
Merge branch 'matthiasc/for-main' into 'main'
...
Updates
See merge request GNOME/gtk!6562
2023-11-14 17:49:04 +00:00
Benjamin Otte
160f632668
Merge branch 'wip/otte/for-main' into 'main'
...
renderer: Remove priv->root_node
See merge request GNOME/gtk!6565
2023-11-14 14:43:47 +00:00
Benjamin Otte
653bf46494
offload: Refactor texture finding
...
It's the same code, but with way more debose debug messages.
2023-11-14 15:04:38 +01:00
Benjamin Otte
46d4c70cd7
offload: Only print one debug message
...
... when failing to create the wl_buffer.
2023-11-14 15:04:38 +01:00
Benjamin Otte
4920ac4a57
offload: Move a debug message
...
If we fail to attach a buffer, we don't want to print this.
2023-11-14 15:04:38 +01:00
Benjamin Otte
5bdc9f71fd
renderer: Remove priv->root_node
...
It's not used anywhere.
2023-11-14 15:04:38 +01:00
Benjamin Otte
c92761b184
Merge branch 'wip/otte/for-main' into 'main'
...
Add a debug node for CSS outlines
See merge request GNOME/gtk!6564
2023-11-14 13:39:38 +00:00
Benjamin Otte
9185f15cd9
renderer: Add a supports_offload flag
...
This flag must be set when creating the class or offloading
will be disabled for this renderer.
Set that flag for the GL renderer.
Fixes the Cairo and Vulkan renderer not showing Video.
2023-11-14 13:06:05 +01:00
Benjamin Otte
efec30babb
renderer: Don't crash with offload disabled
2023-11-14 13:06:05 +01:00
Benjamin Otte
190e7da317
wayland: Don't g_warning() on expected error
...
Print a GDK_DEBUG() message instead.
2023-11-14 13:06:05 +01:00
Benjamin Otte
28d38cd730
Add a debug node for CSS outlines
...
All the other CSS render operations have one, so outlines should, too.
This was found by tracking down a random border node in a rendering.
2023-11-14 13:06:05 +01:00
Benjamin Otte
7299c9baa9
Merge branch 'andyholmes/get-default-size' into 'main'
...
gtk: fix NULL pointer dereference
See merge request GNOME/gtk!6559
2023-11-14 11:08:53 +00:00
Andrey Kutejko
540a83327f
Fix issues spotted by PVS-Studio
2023-11-14 08:56:40 +01:00
Matthias Clasen
04d41eaa66
Updates
2023-11-13 23:53:24 -05:00
Matthias Clasen
524d681496
Merge branch 'dmabuf-passthrough' into 'main'
...
dmabuf passthrough
Closes #6132
See merge request GNOME/gtk!6533
2023-11-14 03:20:12 +00:00
Matthias Clasen
44d977844b
testsuite: Add offload tests
...
These tests come in two variants.
The first takes .node and .offload file, parses the node file,
and compares the resulting subsurface attachments to expected results.
The second variant takes two .node/.offload file pairs and a .diff
file, parses the node files, compares the resulting subsurface
attachments, and then diffs the nodes, comparing the resulting
area to the region in the .diff file.
2023-11-13 18:41:53 -06:00
Matthias Clasen
6259800f5a
Merge branch 'matthiasc/for-main' into 'main'
...
gsk: Robustness fix
See merge request GNOME/gtk!6561
2023-11-13 23:36:58 +00:00
Matthias Clasen
d3a5aa5304
testdmabuf: Use GtkGraphicsOffload
2023-11-13 22:27:51 +01:00
Matthias Clasen
d32ab7544d
gtk-demo: Enable offload in the video player
2023-11-13 22:27:51 +01:00
Matthias Clasen
e2e7c931c5
gtk: Use GtkGraphicsOffload in GtkVideo
...
Video playback is one of the main use cases for graphics offload,
so it makes a lot of sense to do it in GtkVideo.
2023-11-13 22:27:51 +01:00
Matthias Clasen
e202348380
gtk: Add GtkGraphicsOffload
...
This is new widget that will attempt to pass through the content
of its child via a subsurface. This is mostly meant for internal
use, but the minimal api is available.
2023-11-13 22:27:51 +01:00
Matthias Clasen
ba5403da17
gtk: Add gtk_snapshot_push_subsurface
...
This is currently private api.
2023-11-13 22:17:36 +01:00
Matthias Clasen
904d44074f
gsk gl: Handle subsurfaces during rendering
...
During rendering, restack offloaded subsurfaces below the main
surface, and clear the area so they peek through. After rendering,
raise the last subsurface if we haven't drawn over it.
2023-11-13 22:17:36 +01:00
Matthias Clasen
c636baf6f5
gsk gl: Make it possible to clear a rectangle
...
Add a blend mode to the draw command, so it can draw transparent
black. This will be used to erase the area on top of a subsurface
when we do passthrough.
2023-11-13 22:17:36 +01:00
Matthias Clasen
b7c2528ad1
gsk: Prepare subsurface offload
...
Use a GskOffloadInfo to update subsurfaces (and collect info about
them). Pass that info to both the diff and the render vfuncs.
2023-11-13 22:17:36 +01:00
Matthias Clasen
48740de71a
gsk: Add a subsurface mode to node diffing
...
Add an extra argument to pass offload info to the diffing code.
This is then used for diffing subsurface nodes differently,
depending on their offloading status.
2023-11-13 22:17:35 +01:00
Matthias Clasen
34c16b0df2
gsk: Add code to offload to subsurfaces
...
This code walks the node tree, finds subsurface nodes, determines
if we can offload to the subsurface, and if yes, does so. This
isn't used yet.
2023-11-13 22:17:35 +01:00
Matthias Clasen
d0a675ab01
gsk: Add subsurface nodes
...
Also show them in the inspector recorder, with some information.
2023-11-13 22:17:35 +01:00
Matthias Clasen
0e0bf8ed47
gsk: Add a debug flag for graphics offload
...
Add GSK_DEBUG=offload-disable to disable graphics offload via
attaching of dmabufs to subsurfaces. This is not used anywhere yet.
2023-11-13 22:17:35 +01:00
Matthias Clasen
00d7d4b17b
wayland: Implement empty_frame in draw contexts
2023-11-13 22:17:35 +01:00
Matthias Clasen
9eef566b54
gdk: Introduce empty frames in GdkDrawContext
...
We need a way to commit pending subsurface changes, even when no
drawing happened for the frame. empty_frame() is that way.
2023-11-13 22:17:35 +01:00
Matthias Clasen
272168c94b
inspector: Add a subsurface overlay
...
We have to be careful to not draw over the subsurface area with
our highlighting, otherwise this would interfere with raising
unobstructed subsurfaces.
2023-11-13 22:17:35 +01:00
Matthias Clasen
ca054bfdc9
wayland: Request frame callbacks on subsurfaces
...
We need this for the case when the subsurface completely covers
up the main surface. Without it, we just stop updating.
2023-11-13 22:17:35 +01:00
Matthias Clasen
59dbfb0843
wayland: Implement subsurface api
...
This is not used anywhere yet.
2023-11-13 22:17:35 +01:00
Matthias Clasen
223e27e7dc
gdk: Add private subsurface api
...
Add api to allow creating subsurfaces, attaching textures to them,
and changing the stacking order.
This is just the api, there is no implementation yet.
2023-11-13 22:17:35 +01:00
Matthias Clasen
efe1415429
gdk: Add a debug flag for subsurfaces
...
You can now use GDK_DEBUG=offload to get debug spew about
subsurfaces and graphics offload.
2023-11-13 22:17:35 +01:00
Matthias Clasen
489723916d
wayland: Get format info for dmabufs
...
For now, all we do with it is dump the formats if you
set GDK_DEBUG=misc. In the future, this will be used
when attaching dmabufs to subsurfaces.
2023-11-13 22:17:35 +01:00
Matthias Clasen
e8894ad383
gsk: Robustness fix
...
I was seeing empty regions being passed as scissor.
2023-11-13 22:17:35 +01:00
Matthias Clasen
9423d6261a
gtk: Use some more inline helpers
2023-11-13 22:17:35 +01:00
Matthias Clasen
b766f92026
gsk: Use some more inline helpers
2023-11-13 22:17:35 +01:00
Matthias Clasen
a37aacf4e4
Add another inline rect helper
2023-11-13 22:17:35 +01:00