Commit Graph

81822 Commits

Author SHA1 Message Date
Aurimas Černius
6c939819a3 Update Lithuanian translation 2024-09-08 19:12:24 +00:00
Matthias Clasen
6288be286f Merge branch 'matthiasc/for-main' into 'main'
gsk: Small optimization

See merge request GNOME/gtk!7698
2024-09-08 17:29:27 +00:00
Matthias Clasen
76a13596aa gpu: Reduce per-glyph overhead
Pull the shader clip computation out of the loop in the common
case that the entire node is contained in the clip.
2024-09-08 12:57:31 -04:00
Matthias Clasen
c18cd6050b gpu: Use gsk_gpu_colorize_op2
This reduces the cost of these calls significantly, and this is
the inner loop of the node processor.
2024-09-08 12:43:02 -04:00
Matthias Clasen
60f5d4c93e gpu: Add a variant of gsk_gpu_colorize_op
This variant takes the color_states, instead of computing it
anew from the ccs and the color state of the color. This will
be used to pull this work out of the loop in add_glyph_node.
2024-09-08 12:41:48 -04:00
Matthias Clasen
03840151ac gsk: Drop an unused variable
We're not using last_image for anything.
2024-09-08 11:48:43 -04:00
Matthias Clasen
2e44f3e2ff gsk: Get the text node color once
We don't need to do this in the loop.
2024-09-08 11:48:43 -04:00
Matthias Clasen
4f9fd5cf1d Add gsk_text_node_get_font_hint_style
Getting the hint style is one of the more expensive calls we do
when adding glyph nodes, so cache this information in the node.
2024-09-08 11:48:43 -04:00
Matthias Clasen
59f334622b rendernode: Inline gsk_render_node_get_node_type
This is the most-called function on render nodes.
2024-09-08 11:48:43 -04:00
Matthias Clasen
c505a08e46 gsk: Small optimization
Avoid calling gsk_container_node_get_child in a loop.
2024-09-08 11:48:43 -04: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
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