Commit Graph

82004 Commits

Author SHA1 Message Date
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
Matthias Clasen
b6d19f4c8b Fix css tests
Disable css deprecation warnings for the style tests. We want to
be able to do tests with named colors here.
2024-09-06 07:54:37 -04:00
Andika Triwidada
3a2b8f94ec Update Indonesian translation 2024-09-06 04:13:55 +00:00
Matthias Clasen
3a5933a519 Merge branch 'mcatanzaro/#6983' into 'main'
popover: fix critical on pop down

Closes #6983

See merge request GNOME/gtk!7691
2024-09-06 00:14:09 +00:00
Matthias Clasen
4c295dc49c popover: Avoid unnecessary work
If the popover isn't visible, no need to do any extra
'cascade' work. This also helps to avoid running into
trouble during finalization when the parents are already
gone.
2024-09-05 15:27:55 -04:00
Emin Tufan Çetin
03ebb41262 Update Turkish translation 2024-09-05 18:02:12 +00:00
Yaron Shahrabani
b0c3265561 Update Hebrew translation 2024-09-05 12:43:43 +00:00
Danial Behzadi
98943b28aa Update Persian translation 2024-09-05 12:16:59 +00:00
Vasil Pupkin
c354c5a63d Update Belarusian translation 2024-09-05 10:03:35 +00:00
Tim Sabsch
2f8cb9b2d0 Update German translation 2024-09-04 18:21:04 +00:00
Luca Bacci
7559a87e8a WGL: Detect MESA D3D12 driver and request GDI compatibility
This way we get a non-opaque framebuffer / render target

Fixes #6975

References:
  [1] https://gitlab.gnome.org/GNOME/gtk/-/issues/6975
  [2] https://gitlab.freedesktop.org/mesa/mesa/-/issues/11828
2024-09-04 20:02:44 +02:00
Luca Bacci
b2394691cc Inspector: Fix append_wgl_extension_row()
wglGetExtensionsStringARB takes an HDC argument even though it
checks extensions for the current context. This was done for future
extensibility. From [1]:

>    Should this function take an hdc? It seems like a good idea. At
>    some point MS may want to incorporate this into OpenGL32. If they
>    do this and and they want to support more than one ICD, then an HDC
>    would be needed.

Currently the HDC argument is unused, but still wglGetExtensionsStringARB()
is required to check if HDC is valid:

>    If <hdc> does not indicate a valid device context then the function
>    fails and the error ERROR_DC_NOT_FOUND is generated. If the function
>    fails, the return value is NULL. To get extended error information,
>    call GetLastError.

So wglGetExtensionsStringARB fails if we pass NULL. Here we can pass any
valid HDC, like for example the screen DC returned by GetDC(NULL), but
probably using wglGetCurrentDC() makes most sense.

Reference:
  [1] - https://registry.khronos.org/OpenGL/extensions/ARB/WGL_ARB_extensions_string.txt
2024-09-04 20:02:29 +02:00
Yuri Chornoivan
5a94004b59 Update Ukrainian translation 2024-09-04 16:46:15 +00:00
Michael Catanzaro
3bd609d77c popover: fix critical on pop down
It's expected that there may be no parent widget to grab focus.

This fixes 2299c02639.

Fixes #6983
2024-09-04 11:25:50 -05:00
Luca Bacci
84d2961a91 Inspector: Sync WGL extensions with GdkWin32GLContextWGL
Replace WGL_EXT_pixel_format with WGL_ARB_pixel_format and drop
WGL_ARB_MULTISAMPLE (unused).
2024-09-04 17:10:39 +02:00
Luca Bacci
3a9f26113f WGL: Fix attribs_remove_last() 2024-09-04 17:07:01 +02:00
Luca Bacci
6a240c36ac WGL: Swap core / compat in debug output 2024-09-04 17:04:58 +02:00
Luca Bacci
aaf4261969 WGL: Include renderer string in debug output 2024-09-04 17:03:54 +02:00
Arjan Molenaar
0211299846 macos: Fix input source popup placement in popovers 2024-09-04 17:03:14 +02:00
Arjan Molenaar
aca11d6879 macos: Only allow keyboard focus on toplevel windows
This avoids the focus to move to a popup or popover window.
The red/yellow/green buttons remain colored.
2024-09-04 17:03:14 +02:00
Luca Bacci
5dceb7f7d2 WGL: Make context current to get debug info
Otherwise we get NULL from glGetString()
2024-09-04 17:02:20 +02:00