Commit Graph

78568 Commits

Author SHA1 Message Date
Benjamin Otte
97c60b84c8 gl: Undeprecate the NGL renderer for now
It's used for the new GPU renderer.
2024-01-07 07:22:49 +01:00
Benjamin Otte
bf89431464 gpu: Use gdk_draw_context_empty_frame() when appropriate
It's a new function, so make use of it.
2024-01-07 07:22:49 +01:00
Benjamin Otte
9ddae8aebc gpu: Add outline of new GPU renderer
For now, it just renders using cairo, uploads the result to the GPU,
blits it onto the framebuffer and then is happy.

But it can do that using Vulkan and using GL (no idea which version).

The most important thing still missing is shaders.

It also has a bunch of copy/paste from the Vulkan renderer that isn't
used yet.
But I didn't want to rip it out and then try to copy it back later
2024-01-07 07:22:49 +01:00
Benjamin Otte
e3c70645f9 vulkan: Turn Vulkan instances into init/ref/unref
This is not yet used.
2024-01-07 07:22:49 +01:00
Benjamin Otte
1e54e838e0 vulkan: Remove GskVulkanRenderer
We want to introduce a new one next.

Technically, this breaks API, because gsk_vulkan_renderer_new() is going
away, but practically, we're gonna bring it back once we introduce that
renderer in a few commits.
2024-01-07 07:22:49 +01:00
Benjamin Otte
40854f2ae9 gsk: Add header guard to missing header 2024-01-07 07:22:49 +01:00
Matthias Clasen
6bc7ec3d4d Merge branch 'fix-docs-links' into 'main'
docs: Fix: gdk->gtk links

See merge request GNOME/gtk!6711
2024-01-05 20:10:33 +00:00
Matthias Clasen
bda6530fea docs: Fix: gsk->gtk links
gi-docgen can only generate links for dependencies, so we have
to manually expand to a relative url here.
2024-01-05 14:57:16 -05:00
Matthias Clasen
6227592dfa docs: Fix: gdk->gtk and gdk->gsk links
gi-docgen can only generate links for dependencies, so we have
to manually expand to a relative url here.

fixup
2024-01-05 14:57:07 -05:00
Matthias Clasen
bc066de998 Merge branch 'wip/chergert/fix-6308' into 'main'
texthistory: fix potential NULL dereference

Closes #6308

See merge request GNOME/gtk!6709
2024-01-05 16:43:19 +00:00
Benjamin Otte
68980a5e3b Merge branch 'wip/otte/for-main' into 'main'
testsuite: Add a test for a recent mipmap generation bug

See merge request GNOME/gtk!6710
2024-01-05 07:28:19 +00:00
Benjamin Otte
f200e8b132 reftests: Add a testcase for GtkGLArea::allowed-apis
See code comments for how it uses GL commands that should fail with GLES.

Related: !6520
2024-01-05 07:30:38 +01:00
Benjamin Otte
dde2d9b545 gl: Don't initialize texture storage in wrong format
We're calling glTexImage2D() right after with the correct format.

So add the special format "0" to avoid intializing the texture memory.
2024-01-05 07:20:32 +01:00
Benjamin Otte
ac64948efd testsuite: Add a test for a recent mipmap generation bug
Tests the fix in ab1fba6fdc.

Related: #6298
Related: !6704
2024-01-05 07:20:32 +01:00
Christian Hergert
dfe2141227 texthistory: fix potential NULL dereference
Fixes #6308
2024-01-04 09:40:04 -08:00
Emmanuele Bassi
1e1c973d71 Merge branch 'ebassi/doc-link-fixes' into 'main'
docs: Use second level headings for sections

See merge request GNOME/gtk!6708
2024-01-04 14:48:38 +00:00
Emmanuele Bassi
b69898228d docs: Use second level headings for sections
The first level heading should be reserved for the class description.
2024-01-04 13:48:29 +00:00
Emmanuele Bassi
9c71469c67 docs: Fix link to GtkLabel.set_mnemonic_widget() 2024-01-04 13:48:06 +00:00
Emmanuele Bassi
a8b1c90303 docs: Fix link to GtkSnapshot.restore() 2024-01-04 13:47:29 +00:00
Matthias Clasen
69ffaab09f Merge branch 'reduce-shortcuts-searchentry-width' into 'main'
shortcutswindow: Reduce default width of search entry

See merge request GNOME/gtk!6707
2024-01-04 13:42:18 +00:00
Mohammed Sadiq
9730d44252 shortcutswindow: Reduce default width of search entry
Reduce the default width of search entry so that it fits on smaller
screens (ie, screens having 360px or less width).  Also, set max width
to the old value of 40, so that the search entry will have the same
old size if window width permits.

This commit won't make any difference on larger screens.
2024-01-04 18:51:42 +05:30
Matthias Clasen
f99e725391 Merge branch 'fix-dropdown-checkmark' into 'main'
dropdown: Fix initial checkmark

Closes #6305

See merge request GNOME/gtk!6705
2024-01-04 03:22:25 +00:00
Matthias Clasen
8e4a42a214 dropdown: Fix initial checkmark
When the ::bind signal is emitted, the list item may not be added
to the list view yet, so we can't consult the widget hierarchy at
that point to decide whether to show or hide the icon. List for
notify::root instead.

Fixes: #6305
2024-01-03 14:58:49 -05:00
Matthias Clasen
603de8361c Merge branch 'mipmap-fixes' into 'main'
Mipmap handling fixes

Closes #6298

See merge request GNOME/gtk!6704
2024-01-03 18:06:23 +00:00
Matthias Clasen
51fd7cf35a Merge branch 'wip/otte/for-main' into 'main'
testsuite: Replace g_random_*() with g_test_rand_*()

See merge request GNOME/gtk!6703
2024-01-03 17:50:29 +00:00
Matthias Clasen
ab1fba6fdc gl: When loading a texture, really create a mipmap
If we need a mipmap, and we find an existing texture that can't
mipmap, we need to recreate it.
2024-01-03 12:26:13 -05:00
Matthias Clasen
cfa53de9af gl: Check if texture has a mipmap
When reusing an exiting texture, check if it has a mipmap, in case
we need one.
2024-01-03 12:22:28 -05:00
Matthias Clasen
3ebbcc981a Annotate gtk_ordering_from_cmpfunc as skip
We do extra work here to make the introspection scanner pick up
the docs for the static inline function, but that doesn't make the
function actually work in language bindings, so mark it as skip.

Fixes: #6298
2024-01-03 11:43:37 -05:00
Benjamin Otte
96a71d515b gl: Track if mipmap generation is allowed
... and if it isn't, switch to a format that does allow mipmaps.
2024-01-03 16:56:43 +01:00
Benjamin Otte
b830ca8fab gl: Pass correct format/type to function
Instead of querying the format again and potentially coming out with a
different format, use the one we queried in the calling function.
2024-01-03 16:56:31 +01:00
Benjamin Otte
825c97be6c glcontext: Mark RGB16F as not renderable
According to EXT_color_buffer_half_float it should be renderable, but it
fails to glGenerateMipmap() with Mesa 23.3 so just pretend it's not
renderable until that is fixed.

Fixes CI from failing.
2024-01-03 16:05:25 +01:00
Benjamin Otte
25f99f35f6 glcontext: RGB32F is not renderable
I naively assumed the EXT_color_buffer_float and
EXT_color_buffer_half_float extensions would mirror each other, but they
do not. The float extension explicitly excludes RGB32F from the
renderable formats.
2024-01-03 16:05:25 +01:00
Benjamin Otte
b719f3bd60 glcontext: Fix a mixup of flags
I swapped RENDERABLE and FILTERABLE when building this table.
2024-01-03 16:05:25 +01:00
Benjamin Otte
b16d01e018 testsuite: Replace g_random_*() with g_test_rand_*()
... in the whole testsuite
2024-01-03 16:05:25 +01:00
Matthias Clasen
c56360f20b Merge branch 'matthiasc/for-main' into 'main'
gsk: Mark some subsurface node apis as skip

See merge request GNOME/gtk!6702
2024-01-03 14:09:38 +00:00
Matthias Clasen
726d5b25e8 Merge branch 'bilelmoussaoui/add-missing-annotations' into 'main'
gi: Add missing Since annotations

See merge request GNOME/gtk!6701
2024-01-03 13:35:44 +00:00
Matthias Clasen
681aac7317 gsk: Mark some subsurface node apis as skip
These are not usable outside of GTK, so lets not burden bindings
with them.

I'll keep the get_child() function exposed, since it is needed to
iterate over node trees containing subsurface nodes.
2024-01-03 07:53:27 -05:00
Bilal Elmoussaoui
2cd550cdbc gi: Add missing Since annotations 2024-01-03 08:49:39 +01:00
Benjamin Otte
766048b8e4 Merge branch 'wip/otte/for-main' into 'main'
testsuite: Add a test for conic gradients

See merge request GNOME/gtk!6700
2024-01-03 04:37:00 +00:00
Benjamin Otte
63615c05bc rendernode: Allocate right amount of memory
asan randomly failed when this almost correct code wasn't quite correct.

Hopefully this is the correct incantation to compute the size.

Related: glib#205
2024-01-03 05:01:08 +01:00
Benjamin Otte
cdf5d08294 rendernode: Fix a memleak 2024-01-03 04:58:08 +01:00
Benjamin Otte
3e4d0b69d4 gdkpng: Make the png loader safer against overflows
Load images that result in a texture >4GB in size.

And now let me keep playing with my 60k x 60k image, thanks.
I'm trying to OOM my GPU.
2024-01-03 04:11:35 +01:00
Benjamin Otte
7742434dde rendernode: Allow drawing oversized textures
Create surfaces for tiles of the image and then combine those tiles.

Use an offscreen and OPERATOR_ADD to avoid seams.
2024-01-03 04:11:35 +01:00
Benjamin Otte
f0e6c03d94 testsuite: Add a test for pixel alignment of offscreens
The test ensures that offscreens render to the same pixel grid as the
actual image, and they are not offset by fractions of a pixel.

The Cairo renderer fails here because Cairo's clipping code rounds pixel
values wrong.
2024-01-03 04:11:35 +01:00
Benjamin Otte
09882701c2 rendernode: Fix various places where clip was double applied
This is mostly untested and a result of reading the code.

The main effect here happens when a node was drawn that didn't start on
an integer boundary, which is very rare.
However, with specially crafted tests and when using fractional scaling,
this can happen.

This happened most often when clipping by the node bounds to restrict a
push_group() call. Enlarge that rectangle to fall on a pixel boundary.
2024-01-03 04:11:35 +01:00
Benjamin Otte
a19bc6620a rendernode: Apply the same radius for begin and end
Somebody fixed the end() call but not the begin() call when the too
large blur radius was fixed.
2024-01-03 04:11:35 +01:00
Benjamin Otte
da5de1ba99 nodeparser: Fix SEGV in shadows parsing code
Testcase included

The code was writing invalid memory, so this might not have always
crashed, but I did my best to write the test so it causes a SEGV.

Also included is a fix for the testsuite where the expected result was
wrong.
2024-01-03 04:11:35 +01:00
Benjamin Otte
e9d2f832a1 testsuite: Add a test for a clipping cornercase
If the new clip cannot intersect with the old clip and there is a global
opacity setting, things can go wrong.

So test that they don't.
2024-01-03 04:11:35 +01:00
Benjamin Otte
4fac0f713a testsuite: Add clipped overly large paths
... to make sure that renderers clip any masks they generate for paths.
2024-01-03 04:11:35 +01:00
Benjamin Otte
fff8198393 testsuite: GTK_MODULES doesn't exist anymore 2024-01-03 04:11:34 +01:00