Commit Graph

81974 Commits

Author SHA1 Message Date
Benjamin Otte
ffae0010c4 vulkan: Set VK_SWAPCHAIN_CREATE_DEFERRED_MEMORY_ALLOCATION_BIT_EXT
It seems Mesa doesn't support that yet, but having it doesn't hurt.

And it allows drivers to allocate less memory for the swapchains,
because we don't need all the 4 images we request in minImageCount.
But drivers tend to take that minimum image count as gospel, so we need
to use a higher number to not cause lag in corner cases.
2024-09-08 16:22:49 +02:00
Benjamin Otte
6c72a223f5 vulkan: Enable VK_EXT_swapchain_maintenance1 if available
This just adds the plumbing, usage will happen later.

For testing, GDK_VULKAN_DISABLE=swapchain-maintenance will turn it off.
2024-09-08 16:22:49 +02:00
Benjamin Otte
5a027594c3 vulkan: Add gdk_vulkan_context_has_feature()
A siimplification that will come in handy in the future.
2024-09-08 16:22:49 +02:00
Ask Hjorth Larsen
ebc3600f78 Update Danish translation 2024-09-08 14:15:54 +00:00
Arjan Molenaar
ae0cf9ff54 Merge branch 'amolenaar/focus-im-popups' into 'main'
macos: Fix popup window and keyboard input

Closes #6950 and #5049

See merge request GNOME/gtk!7653
2024-09-08 12:54:24 +00:00
Andi Chandler
08bf8b7464 Update British English translation 2024-09-08 12:26:07 +00:00
Hugo Carvalho
0201abca5e Update Portuguese translation 2024-09-08 10:38:11 +00:00
Asier Sarasua Garmendia
d87b566c59 Update Basque translation 2024-09-08 08:03:53 +00:00
Ekaterine Papava
572b4140f9 Update Georgian translation 2024-09-08 03:58:29 +00:00
Matthias Clasen
6241471f3e Merge branch 'matthiasc/for-main' into 'main'
gpu: Print blur colors

See merge request GNOME/gtk!7695
2024-09-07 18:46:10 +00:00
Matthias Clasen
1ae9cdb4c9 gpu: Print blur colors
Relevant information when debugging shadows.
2024-09-07 12:34:04 -04:00
Daniel Rusek
c1e1b54034 Update Czech translation 2024-09-07 15:52:31 +00:00
Matthias Clasen
f654cb7d3b Merge branch 'docs-remove-gtk-attribute' into 'main'
docs: Remove custom org.gtk.Method and org.gtk.Property annotations

See merge request GNOME/gtk!7335
2024-09-07 14:39:19 +00:00
Alexander Shopov
85beb4fa20 Update Bulgarian translation 2024-09-07 12:50:50 +00:00
twlvnn kraftwerk
a0e81996eb Update Bulgarian translation
(cherry picked from commit 090fcfe503)
2024-09-07 12:13:48 +00:00
Maximiliano Sandoval
ec477ef71d
docs: Document property annotations in README.md 2024-09-07 09:51:33 +02:00
Maximiliano Sandoval
3afc760644
docs: Manually remove property annotations
We remove the annotations that did not match the regex of the previous commits.
2024-09-07 09:51:33 +02:00
Maximiliano Sandoval
ba32140671
docs: Remove all org.gtk.Method annotations
Removed via regex and grep.
2024-09-07 09:51:32 +02:00
Maximiliano Sandoval
91d36dd410
docs: Remove all org.gtk.Property annotations
Removed via regex and grep.

The following were intentionally not removed:

- GtkImage:file: (attributes org.gtk.Property.set=gtk_image_set_from_file)
- GtkImage:resource: (attributes org.gtk.Property.set=gtk_image_set_from_resource)

As they have no getter and (setter PROP) without a (getter PROP) crash
gobject-introspection. This is fixed by
ad3118eb51.
2024-09-07 09:51:32 +02:00
Maximiliano Sandoval
4fd1e32752
docs: Use correct property gir annotations
The annotations should only be set when the name of the setter or getter
for a property "GtkClassName:prop-name" is not gtk_class_name_g(s)et_property_name.
2024-09-07 09:51:26 +02:00
Matthias Clasen
b538adf2c0 Post-release version bump 2024-09-06 23:07:08 -04:00
Matthias Clasen
d16c9fbaca 4.16.0 2024-09-06 22:51:07 -04:00
Ahmed Baizid
9b6063c07c GtkCalendar: The focus cannot be moved to out of range dates
Out of range dates are in insensitive tabel cells.
2024-09-06 23:49:03 +01:00
Ahmed Baizid
d1a4740894 GtkCalendar: move_focus() invalidates days
calendar_invalidate_day() calls are no more disseminated.
2024-09-06 23:49:03 +01:00
Ahmed Baizid
5186c4dc45 GtkCalendar: Not allowed with the mouse, not allowed with the keyboard
Month/year navigation with the keyboard checks if the corresponding
widget is sensitive or not.
2024-09-06 23:49:03 +01:00
Ahmed Baizid
ca9664cdfd GtkCalendar: Disable navigation buttons for out of range months
`GtkCalendar`s span 0001-01/9999-12.
2024-09-06 23:49:03 +01:00
Ahmed Baizid
6c9edbf0da GtkCalendar: Out of range dates are neither displayed nor sensitive
`GDateTime`s span 0001-01-01/9999-12-31.
2024-09-06 23:49:03 +01:00
Ahmed Baizid
b8d2b1d3ce GtkCalendar: Extract calendar_update_day_labels()
calendar_select_day_internal() is too big, doing so many things.
2024-09-06 23:49:03 +01:00
Matthias Clasen
0274294a6f Merge branch 'wip/otte/cpu-mipmap' into 'main'
gpu: Allow uploading of mipmap levels when tiling

See merge request GNOME/gtk!7657
2024-09-06 22:14:37 +00:00
Matthias Clasen
03b19d8861 docs: Recommend glycin for image loading
Best to send people elsewhere to avoid misunderstandings of our api.
2024-09-06 16:52:47 -04:00
Matthias Clasen
171612671f demo: Beef up the image scaling demo
Add buttons for loading the Portland Rose, and a nameless large
png. Make them load the texture in a thread, to demonstrate better
handling of large images.
2024-09-06 16:14:24 -04:00
Matthias Clasen
d3db28b3f4 memory format: Add profiler marks
Add profiler marks to our long-running threaded operations.
To avoid spamming profiles too much, only report runs that take
at least 0.5 ms.
2024-09-06 16:14:24 -04:00
Benjamin Otte
896ea5b753 memoryformat: Add linear/nearest choice for mipmaping
linear will average all the pixels for the lod, nearest will just pick
one (using the same method as OpenGL/Vulkan, picking bottom right
center).

This doesn't really make linear/nearest filtering work as it should
(because it's still a form of mipmaps), but it has 2 advantages:

1. it gets closer to the desired effect

2. it is a lot faster

Because only 1 pixel is chosen from the original image, instead of
averaging all pixels, a lot less memory needs to be accessed, and
because memory access is the bottleneck for large images, the speedup is
almost linear with the number of pixels not accessed.
And that means that even for lot level 3, aka 1/8th scale, only 1/64 of
the pixels need to be accessed, and everything is 50x faster.

Switching gtk4-demo --run=image_scaling to linear/nearest makes all the
lag go away for me, even with a 64k x 64k image.
2024-09-06 15:47:35 -04:00
Benjamin Otte
5498b077fd memoryformat: Parallelize gdk_memory_mipmap() 2024-09-06 15:47:34 -04:00
Benjamin Otte
534a9b6ba0 memoryformat: Add fast path for mipmap
We have fast conversion functions, use those directly instead of calling
into gdk_memory_convert().

This is useful because as mentioned before, the main optimization here
is RGB8 => RGBA8 and we have a fastpath for that.
2024-09-06 15:47:34 -04:00
Benjamin Otte
cea961f4f4 memoryformat: Take src_format and dest_format
Why do we need this? Because RGB images are provided in RGB format but
GPUs can't handle RGB, only RGBA, so we need to convert.

And we need to do that without allocating too much memory, because
allocating memory is slow. Which means in aprticular we need to do the
conversion after mipmapping, not before (like we were doing).
2024-09-06 15:47:34 -04:00
Benjamin Otte
848c6815d3 gpu: Allow uploading of mipmap levels when tiling
This allows uploading less memory but requires computing lod levels on
the CPU which is slow because it reads through all of the memory and so
far entirely not optimized.

However, it uses significantly less VRAM.

This is done by adding a gdk_memory_mipmap() function that does this
task.
The texture upload op now accepts a lod level and if that is >0 it uses
gdk_memory_mipmap() on the source texture.
2024-09-06 15:47:34 -04:00
Benjamin Otte
46559039f3 memoryformat: Parallelize gdk_memory_convert_color_state() 2024-09-06 15:47:34 -04:00
Benjamin Otte
eb7a42bc13 memoryformat: Parallelize generic path of gdk_memory_convert() 2024-09-06 15:47:34 -04:00
Benjamin Otte
ffe56fe6b3 memoryformat: Parallelize
Refactor code so that it uses g_parallel_task_run().
2024-09-06 15:47:34 -04:00
Benjamin Otte
d4ba57fcc3 gdk: Add gdk_parallel_task_run()
This is just the API. Users will come later.

I considered putting it into gdkmemoryformat.c because it's likely gonna
be the only user and this one function is so little code, but it didn't
fit at all.
So now it's a new file.
2024-09-06 15:47:34 -04:00
Benjamin Otte
a95c9ebc51 memoryformat: Split out a function
Allow querying the fast conversion functions outside of
gdk_memory_convert().
2024-09-06 15:47:34 -04:00
Benjamin Otte
9195c39756 build: Alphabetic order is hard 2024-09-06 15:47:34 -04:00
Mat
e0ffeb8ded macos: simplify access to native widget. 2024-09-06 16:12:56 +00:00
Matthias Clasen
d9bb434c1f Merge branch 'bad-relative-color' into 'main'
css: Avoid a crash with relative colors

Closes #6985

See merge request GNOME/gtk!7693
2024-09-06 15:05:27 +00:00
Juliano de Souza Camargo
866c83909c Update Brazilian Portuguese translation 2024-09-06 13:00:13 +00:00
Luca Bacci
4965b7b6fa Merge branch 'wgl-updates' into 'main'
WGL Updates

Closes #6975

See merge request GNOME/gtk!7692
2024-09-06 12:47:41 +00:00
Matthias Clasen
45f3e86457 css: Allocate less when searching themes
We trawl through a whole bunch of directories, but we can do it
without allocation quite so much.
2024-09-06 07:54:59 -04:00
Matthias Clasen
c033de9b83 css: Simplify theme loading
There is no need to do a detour through a GFile here.
Just load the resource.
2024-09-06 07:54:37 -04:00
Matthias Clasen
3f7f9b705e css: Avoid a crash with relative colors
rgba(from @foo ...) would crash if @foo was not a named color.
Handle it as we do elsewhere, by returning NULL from resolve().

Test included.

Fixes: #6985
2024-09-06 07:54:37 -04:00