Commit Graph

82087 Commits

Author SHA1 Message Date
Matthias Clasen
5935dc174f inspector: Avoid criticals in the clipboard code
We keep a pointer to the GdkDrop object without a reference, and
then it dies on us. Be more careful, and clean up the dnd section
when the we drop object goes away.

Fixes: #7026
2024-09-22 09:58:31 +02:00
Matthias Clasen
b623b2acef wayland: Be more careful with mimetypes
Sometimes, jokers send us 'mimetypes' like DELETE or
org.webkitgtk.WebKit.custom-pasteboard-data, and gdk_intern_mime_type
will return NULL for such things. Handle that by just closing the fd.

Better than running into an assertion further down.
2024-09-22 09:25:44 +02:00
Yaron Shahrabani
cc867eeccf Update Hebrew translation 2024-09-21 19:39:39 +00:00
Benjamin Otte
17bdb4c8fb Merge branch 'wip/otte/for-main' into 'main'
wayland: Don't call gdk_display_sync()

Closes #7022 and #7025

See merge request GNOME/gtk!7726
2024-09-21 17:01:19 +00:00
Benjamin Otte
236b6d1cd6 x11: Remove gdk_display_sync() call
This is unnecessary.
Worse, it is reentrant and can cause all sorts of avoc when processing
events halfway through initializing the Vulkan context.

It was introduced in commit e11a6a0e68 but back then GTK was barely
branched for GTK4 and Vulkan drivers were very new, and it looks like an
unnecessary workaround.

Testing did not seem to indicate any issues with just removing it, so
here it goes.

Related: #7022
2024-09-21 18:59:49 +02:00
Matthias Clasen
9ded3e64a2 Merge branch 'fix-rtl-centered-labels' into 'main'
Fix centered text in labels

Closes #6836

See merge request GNOME/gtk!7724
2024-09-21 16:39:42 +00:00
Benjamin Otte
6e714722c4 win32: Remove gdk_display_sync()
This is unnecessary.
Worse, it is reentrant and causes all sorts of avoc when processing
events halfway through initializing the context.

It only exists because in commit c4244ea1 the win32 Vulkan code was
copy/pasted from another backend.

Related: #7022
2024-09-21 18:19:26 +02:00
Benjamin Otte
60b1496091 wayland: Don't call gdk_display_sync()
It is not necessary.
Worse, it is reentrant and causes all sorts of avoc when processing
events halfway through initializing the context.

It only exists because in commit 3887548 the Wayland Vulkan code
was copy/pasted from X11.

Fixes #7022
Fixes #7025
2024-09-21 18:18:29 +02:00
Matthias Clasen
dc1b2d4117 gsk: Don't leak gl textures
We need to fix all the textures we own. This broke in 65c8320a.

Fixes: #7013
2024-09-21 10:51:26 +02:00
Matthias Clasen
e205f13495 Fix centered text in labels
When the text is rtl, pango will put the text at the right end of
its given width, causing the logical.x to be big, and in turn, our
computed position to be negative. If we don't allow that, centered
text will end up at the right side if it is rtl.

Fixes: #6836
2024-09-21 10:06:33 +02:00
Benjamin Otte
72718b7193 Merge branch 'wip/otte/critical-warning' into 'main'
vulkan: Demote g_critical() to g_warning()

See merge request GNOME/gtk!7723
2024-09-20 22:54:18 +00:00
Benjamin Otte
db95e37e15 vulkan: Demote g_critical() to g_warning()
For VK_DEBUG_REPORT_WARNING_BIT_EXT we should always have used
g_warning().

For VK_DEBUG_REPORT_ERROR_BIT_EXT g_critical() is technically the right
choice, but Mesa has been using this flag for normal warnings, so until
that gets fixed, we don't want to throw criticals.

Related: https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31292
Fixes: !7020
2024-09-20 23:02:15 +02:00
Juliano de Souza Camargo
f9714cc054 Update Brazilian Portuguese translation 2024-09-20 00:03:31 +00:00
Ekaterine Papava
58c49ce6b0 Update Georgian translation 2024-09-19 23:03:39 +00:00
Florian Heiser
13364cea74 Update German translation 2024-09-19 08:25:48 +00:00
Andika Triwidada
f6014bdc08 Update Indonesian translation 2024-09-19 01:05:51 +00:00
Hugo Carvalho
6070edfa61 Update Portuguese translation 2024-09-18 21:52:59 +00:00
Emin Tufan Çetin
0600357373 Update Turkish translation 2024-09-18 07:05:11 +00:00
Yuri Chornoivan
7873ebac2a Update Ukrainian translation 2024-09-18 06:39:12 +00:00
Luming Zh
8edd376ab8 Update Chinese (China) translation 2024-09-18 01:21:37 +00:00
Piotr Drąg
6f300557bf Update Polish translation 2024-09-17 18:44:48 +02:00
Martin
bcda071d7d Update Slovenian translation 2024-09-17 15:22:00 +00:00
Jordi Mas i Hernandez
9df3a50c87 Update Catalan translation 2024-09-17 10:45:22 +00:00
Danial Behzadi
70d41583b3 Update Persian translation 2024-09-17 10:32:44 +00:00
Matthias Clasen
a50df37d52 Merge branch 'iss-5072' into 'main'
gtk/print/gtkprintoperation{,-unix,-portal}.c: add CAIRO_HAS checks

Closes #5072

See merge request GNOME/gtk!7717
2024-09-17 10:05:18 +00:00
Matthias Clasen
b7d07ae190 Merge branch 'dmabuf-init-refactor' into 'main'
Refactor dmabuf initialization

See merge request GNOME/gtk!7714
2024-09-17 09:56:25 +00:00
Thomas Devoogdt
3610ac0fd1
gsk/gskrendernodeparser.c: add CAIRO_HAS check
resolves #5072

Signed-off-by: Thomas Devoogdt <thomas@devoogdt.com>
2024-09-17 10:55:41 +02:00
Thomas Devoogdt
9f855eecb1
modules/printbackends/gtkprintbackendfile.c: add CAIRO_HAS checks
This is similar to the checks in tools/gtk-rendernode-tool-render.c.

resolves #5072

Signed-off-by: Thomas Devoogdt <thomas@devoogdt.com>
2024-09-17 10:55:40 +02:00
Thomas Devoogdt
ffc8f34dfd
gtk/print/gtkprintoperation{,-unix,-portal}.c: add CAIRO_HAS checks
This is similar to the checks in tools/gtk-rendernode-tool-render.c.

resolves #5072

Signed-off-by: Thomas Devoogdt <thomas@devoogdt.com>
2024-09-17 10:55:39 +02:00
Matthias Clasen
7acc1c0125 Make dmabuf initialization lazier
Only initialize the Vulkan or EGL parts where possible.

When dmabufs or dmabuf formats are actually used, we still
initialize fully by creating both a Vulkan and EGL downloader.

This shortens the time to first commit from 149ms to 108ms.
2024-09-17 09:46:01 +02:00
Matthias Clasen
6059eaf355 gdk: Reorganize dmabuf initialization
Change the xxx_get_downloader() functions to init_dmabuf_xxx(),
and make them initialize both xxx_dmabuf_formats and xxx_downloader.
2024-09-17 09:46:01 +02:00
Alexander Shopov
26971c48d4 Update Bulgarian translation 2024-09-17 07:42:50 +00:00
Matthias Clasen
b42caef0ed Merge branch 'builder-tool-box-position' into 'main'
builder-tool: Handle pack-type, position, and center child in GtkBox

See merge request GNOME/gtk!7715
2024-09-17 05:42:46 +00:00
Elliott Sales de Andrade
b3706daf90 builder-tool: Handle pack-type, position, and center child in GtkBox
This takes the `position` property and ensures children are sorted by
it, splits children by `pack-type` (also reversing the order of `end`
children), and handles children with `type="center"`.

If either a center child or end children exist, then the `GtkBox` is
converted to a `GtkCenterBox`, with `start-widget`/`end-widget` being a
nested `GtkBox` with the relevant children.

The splitting does cause some non-`object` children to sort differently
(hence the change to `office-runner.expected`.)
2024-09-16 05:12:54 -04:00
Matthias Clasen
24dc9dc653 Drop the dmabuf_downloaders array
Just use two individual fields, so we can track if we've already
created each one. This also matches the individual fields we have
for the dmabuf formats.

And change preference order of downloaders

Previously, our order was mmap > vulkan > egl.

But depending on the hw (discrete vs integrated gpu), mmap
can be catastrophically slower (on the order of 20ms vs 1.5s).

So, change the order to egl > vulkan > mmap.

Note that this currently has less effect than we'd like to,
since we don't let the downloaders claim linear formats.
2024-09-16 09:55:31 +02:00
Elliott Sales de Andrade
172dfb14c4 builder-tool: Convert node children after the node itself
Some nodes like `GtkBox` need to process removed-in-GTK4 attributes to
correctly convert their contents. If the node children are processed
first, then those attributes are removed prematurely.
2024-09-16 02:39:47 -04:00
Jordi Mas i Hernandez
3b43078b08 Update Catalan translation 2024-09-15 12:15:18 +00:00
Benjamin Otte
f2e75529cb Merge branch 'wip/otte/for-main' into 'main'
vulkan: Actually return the preferred memory format

See merge request GNOME/gtk!7713
2024-09-15 08:19:53 +00:00
Benjamin Otte
eed58b4051 gpu: Split out rect grid snapping function
We might want to use it outside of the nodeprocessor.

The function is now called gsk_rect_snap_to_grid().
2024-09-15 02:31:02 +02:00
Benjamin Otte
28a01ca954 gpu: Print some tex rects in verbose output
In the colorize and texture ops, print the tex rect. This is useful
because when adding new features with textures (like atlas usage), these
are the ops that I use for testing.
2024-09-15 02:31:02 +02:00
Benjamin Otte
efd5395ecf rendernode-tool: Download in the texture's format
When downloading textures, download the in the actual format of the
texture. We don't want to benchmark conversion, we want to benchmark
renderers.
2024-09-15 02:31:02 +02:00
Benjamin Otte
376dbe9def memoryformat: Move fast path into the threaded path
We don't want to get slower in the fast path.
2024-09-15 02:31:02 +02:00
Benjamin Otte
bba7979670 memoryformat: Add a fastpath for RGBA8 <=> BGRA8
Cairo is using BGRA8 but we want to use RGBA8 because it's the canonical
GL format.

So getting this fast sounds useful.
2024-09-15 02:31:02 +02:00
Benjamin Otte
01aafc6e65 memoryformat: Don't always convert to rec2100-linear and back
It turns out we lost the check to see if color states are equal when we
multithreaded things in !7657

Whoops.
2024-09-15 02:31:01 +02:00
Benjamin Otte
fa86bfcb55 gpu: Use existing frame in render_texture()
Instead of recreating frames from scratch every time, use an existing one.

This ensures that renderers don't need to recreate GPU resources every
time (like buffers and everything else that frames manage). It also
speeds up occasional render_texture() calls in default renderers.

This speeds up in particular the Vulkan renderer.
2024-09-15 02:31:01 +02:00
Benjamin Otte
c3d9f4a9ac gpu: Move a function
No functional changes.
2024-09-15 02:31:01 +02:00
Benjamin Otte
d11ac3585d gpu: Clean up the frame after we're done waiting for it
This is useful because cleaning up will do the final copies of texture
data.

It also means we use less memory, as we're going to release images that
were used in ops.
2024-09-15 02:31:01 +02:00
Benjamin Otte
8f78a0f809 gpu: Add an internal is_clean() check
If no ops are recorded, then we don't need to wait for any ops to
finish.

Also fix the initial fence creation on Vulkan - we no longer need to
create it fixed because of the random cleanup() call at startup does no
longer happen.
2024-09-15 02:30:59 +02:00
Benjamin Otte
3286d9f1b5 vulkan: Actually return the preferred memory format
We were just exiting the loop, but not remembering the index.

Speeds up various memory operations, sometimes by quite a lot.
2024-09-15 00:07:47 +02:00
Matthias Clasen
ee38c96ee3 Merge branch 'matthiasc/for-main' into 'main'
gsk: Add another profiler mark

See merge request GNOME/gtk!7712
2024-09-13 16:14:17 +00:00