Commit Graph

78383 Commits

Author SHA1 Message Date
Benjamin Otte
c414889cfa testsuite: Make memorytexture test work with GLES < 3.1
Previously, the code was skipping various tests and not skipping others
that it should.

Fix both of these cases.
2023-12-12 01:49:41 +01:00
Benjamin Otte
4dfc07ef57 memoryformat: Fix variable types
Use the same types that GL uses.
2023-12-12 01:49:41 +01:00
Benjamin Otte
cf4b0a27f8 glcontext: Only swizzle when we can
Don't use the recently added swizzle optimization if we're using a GL
version that is too old to support swizzling (GLES 2).
2023-12-12 01:49:41 +01:00
Benjamin Otte
393ee574b6 gl: Print debug for CPU conversions of textures
When the GL renderer cannot upload a given format, print a FALLBACK
debug message with the failed format and the alternative that was
picked, for example:

Unsupported format b8g8r8a8, converting on CPU to b8g8r8a8-premultiplied

Makes it easier to figure out what's happening, especially when using
old GLES versions that don't support all formats.
2023-12-12 01:49:41 +01:00
Benjamin Otte
e3c85be53f memoryformat: Add gdk_memory_format_get_fallbacks()
Track fallback formats to use in the memoryformat directly instead of
using in the GL uploading code.

First of all, this allows sharing the code and ensuring all our
renderers use the same fallback mechanism.

But also, this allows tracking fallbacks per-format which is useful
because the fallback formats aren't really a tree. We want to make
FLOAT16 fall back to FLOAT32 when not available, but we also want
FLOAT32 fall back to FLOAT16.
By tracking the fallbacks per-format, we can achieve that.
2023-12-12 01:49:40 +01:00
Benjamin Otte
0f5fda2277 memoryformat: Introduce new (private) API
Add gdk_memory_format_get_premultiplied() and
gdk_memory_format_get_straight() which return the matching
premultiplied/straight format.

Use this to pick the premultiplied format when uploading GL textures.

And remove the duplication in the dmabuf code, where we can now use
these functions instead of tracking both the premultiplied and straight
alpha versions.
2023-12-12 01:49:40 +01:00
Benjamin Otte
0889037959 gltexture: Use the right format to download
When the format is set correctly, which it should be, we should just use
it.

So do that.
2023-12-12 01:49:40 +01:00
Benjamin Otte
ee56ad792c memoryformat: Fix 2 broken formats
They are straight alpha, and the GL renderer isn't using them yet, so
existing code is not affected.
2023-12-12 01:49:40 +01:00
Benjamin Otte
5688b7b4bb gl: Add a new alternative format
Add an "RGBA" format that just maps to the swizzled version of the
default format.

This way, BGR gets mapped to RGB + swizzling first before trying to map
it to the default format for the depth.

The benefit here is that this format has the same memory width, so
uploading/downloading code can treat it equivalent to the original
format and there's no conversion neccessary later.
2023-12-12 01:49:40 +01:00
Benjamin Otte
84de90756d memoryformat: Make the big array more readable
Prefix the struct members with their name, similar to how our Vulkan
code looks.
2023-12-11 22:11:28 +01:00
Benjamin Otte
2b6e7147d6 build: Sort alphabetically 2023-12-11 07:33:26 +01:00
Benjamin Otte
3a1349e8ef gl: Make gdk_memory_format_gl_format() no longer check support
Now that we have gdk_gl_context_get_memory_flags() and code can use that
function, make the code do that.

Remove support checks from gdk_memory_format_gl_format().

This is an initial naive port that doesn't try to make use of the finer-grained
flags yet.
2023-12-11 07:33:26 +01:00
Benjamin Otte
5485d806c5 glcontext: Add gdk_gl_context_get_memory_flags()
Checks which features of a given memory format are supported by
the current GL implementation.

We check:
 * usable: Can be used as a texture with NEAREST filter
 * renderable: Can be used as a render target
 * filterable: Can be used with GL_LINEAR

In normal GL, all formats are all of these things, but GLES is a lot
more picky.

So far nobody uses this.
2023-12-11 07:33:26 +01:00
Benjamin Otte
6e7c499408 testsuite: Don't create nodes with negative size
If width or height are too small, only create one mask node.

The previous math would create the 2nd node with negative width/height.
2023-12-11 07:33:26 +01:00
Benjamin Otte
c341da32aa gsk: Set correct blur radius for cairo shadows 2023-12-11 07:33:26 +01:00
Benjamin Otte
d39ec8c09e gsk: Quality of life improvements for Cairo rendering
1. Check for an empty clip region before push/pop_group() calls

2. Remove save/restore() pairs as the vfunc invocation does so already.
2023-12-11 07:33:26 +01:00
Benjamin Otte
e3299e38df cairo: Handle clipped blur content
This is the result of experimenting with corner cases when blurring.

The result is a test that tests when the child of a blur node is
clipped out but the blurred child is not, the blurred parts are still
visible.

This immediately broke the cairo renderer, so the fix is included.
2023-12-11 07:33:24 +01:00
Benjamin Otte
8fd02f6fa2 subsurface: Do not punch holes for subsurfaces that are above
If a subsurface is not below, it is visible no matter what the opaque
region is.

Also, we don't need to care about transparency in the subsurface if we
ignore it anyway. So this is a win-win.
2023-12-11 07:32:06 +01:00
Benjamin Otte
9bc0ad9a13 gdk: Handle subsurface opaque region with transparency
We accept transparent subsurfaces for passthrough now, when they are
above the surface.
But we did not unset the opaque region to empty when the texture is
transprent.
2023-12-11 07:32:06 +01:00
Benjamin Otte
19171c7a89 testsuite: Add a test for opacity + color-matrix nodes
These are 2x2 combinations that:
1. Use a texture child node vs a color child node
   This should force an offscreen vs straight up use a texture.
2. Switch opacity and color-matrix
   Either put the color matrix into the opacity node or put the opacity
   into the color matrix.

This is worth testing because renderers often combine opacity into the
color matrix to avoid offscreens.

And they do that because applications often create faded out symbolic
images, which end up as a combination of these nodes.
2023-12-09 19:32:39 +01:00
Benjamin Otte
abf942efe5 dmabuf: Don't leak the display 2023-12-09 19:32:39 +01:00
Matthias Clasen
0b0a5a52af Merge branch 'docs_clarify_gtk_drop_down_get_selected_item' into 'main'
docs: Clarify how to obtain strings from GtkDropDown

See merge request GNOME/gtk!6647
2023-12-08 10:20:12 +00:00
Matthias Clasen
75d259eedf Merge branch 'fix-label-docs' into 'main'
Docs: Fix unfenced HTML tag in GtkLabel docs

See merge request GNOME/gtk!6650
2023-12-08 10:17:59 +00:00
FeRD (Frank Dana)
6fec018cbd Docs: Fix unfenced HTML tag in GtkLabel docs 2023-12-08 02:29:10 -05:00
Matthias Clasen
6d9c950b82 Merge branch 'ebassi/inhibit-reason-fallback' into 'main'
Add fallback string for empty inhibit reason

See merge request GNOME/gtk!6648
2023-12-08 04:06:11 +00:00
Emmanuele Bassi
0933ea63c5 Add fallback string for empty inhibit reason
The public gtk_application_inhibit() API allows a NULL reason argument,
and we have a fallback in place when going through the session manager
proxy; when using the inhibit D-Bus API directly, though, we're just
passing a potentially NULL value to g_variant_new_string(), which will
rightfully complain.
2023-12-07 11:55:20 +00:00
Logan Rathbone
8cb594696e docs: Clarify how to obtain strings from GtkDropDown 2023-12-07 00:03:04 -05:00
Matthias Clasen
9d7389aea7 Merge branch 'emoji-15.1' into 'main'
emoji: Update data to CLDR v44

See merge request GNOME/gtk!6642
2023-12-06 11:26:05 +00:00
Jeremy Bícha
76a1f1714d emoji: Update data to CLDR v44
Based on emojibase v15.3.0

Contains the changes in Unicode 15.1

https://unicode.org/versions/Unicode15.1.0/
https://cldr.unicode.org/index/downloads/cldr-44
https://github.com/milesj/emojibase/blob/emojibase-data%4015.3.0/packages/data/CHANGELOG.md
2023-12-03 16:32:42 -05:00
Yaron Shahrabani
9af08e17e0 Update Hebrew translation 2023-12-03 13:32:37 +00:00
Boyuan Yang
276afbca92 Update Chinese (China) translation 2023-12-03 01:40:50 +00:00
Yaron Shahrabani
0342d23dbe Update Hebrew translation
(cherry picked from commit cde309d9fa)
2023-12-02 22:12:14 +00:00
Matthias Clasen
1c10837b21 Merge branch 'matthiasc/for-main' into 'main'
Revert "Merge branch 'rgba-new-from-string' into 'main'"

See merge request GNOME/gtk!6640
2023-12-02 05:43:12 +00:00
Matthias Clasen
7cc5d5c7a5 Revert "Merge branch 'rgba-new-from-string' into 'main'"
This reverts commit 77f40d7508, reversing
changes made to b969f4649d.

It turns out we did not have agreement on this after all.
2023-12-02 10:55:35 +05:45
Matthias Clasen
6a59326dbf Merge branch 'emoji-15' into 'main'
emoji: Update data to CLDR v43

See merge request GNOME/gtk!6639
2023-12-02 02:12:17 +00:00
Yaron Shahrabani
1968f331d9 Update Hebrew translation 2023-12-01 21:02:25 +00:00
Jeremy Bícha
bf35836350 emoji: Update data to CLDR v43
Based on emojibase v15.2.0

Contains the changes in Unicode 15.0

https://unicode.org/versions/Unicode15.0.0/
https://cldr.unicode.org/index/downloads/cldr-43
https://github.com/milesj/emojibase/blob/emojibase-data%4015.2.0/packages/data/CHANGELOG.md
2023-12-01 15:57:02 -05:00
Daniel Rusek
036629a491 Update Czech translation 2023-11-30 18:26:58 +00:00
Arjan Molenaar
8cabf59cf3 Merge branch 'macos-secure-restore' into 'main'
macos: Add method that denotes secure restorable state

See merge request GNOME/gtk!6632
2023-11-30 15:17:04 +00:00
Arjan Molenaar
6a4b238641 macos: Add method that denotes secure restorable state
Fix process injection vulnerability on macOS.
2023-11-29 12:30:30 +01:00
Matthias Clasen
d4d0239ae7 Merge branch 'macos-fix-function-signature' into 'main'
Fix function signature warning on macOS

See merge request GNOME/gtk!6628
2023-11-29 00:53:31 +00:00
Matthias Clasen
a30f32db8d Merge branch '6236_fix_modify_textbuffer_in_irreversible' into 'main'
gtktexthistory: allow setting the modified flag in irreversible action

Closes #6236

See merge request GNOME/gtk!6626
2023-11-28 23:51:51 +00:00
Arjan Molenaar
6948a74d72 Fix function signature warning
No arguments -> void
2023-11-28 21:24:10 +01:00
Matthias Clasen
14ec255812 Merge branch 'gles-texture-slice-fixes' into 'main'
gsk: Be more careful about texture slice formats

See merge request GNOME/gtk!6627
2023-11-28 20:07:44 +00:00
Matthias Clasen
00ebd51d06 gsk: Be more careful about texture slice formats
We need to make sure that all our textures have the same memory
format, or we'll run into trouble in the upload code, at least
on GLES, which isn't as forgiving about format mismatches.

Related: #6238
2023-11-28 14:16:21 -05:00
g.willems
7de528b487 gtktexthistory: allow set modified in irreversible action
Allow setting the modified flag, but skip propagating the history state update
as it will be done by gtk_text_history_end_irreversible_action().

Fixes #6236
Closes #6236
2023-11-28 19:57:11 +01:00
Matthias Clasen
77f40d7508 Merge branch 'rgba-new-from-string' into 'main'
Add convenience function gdk_rgba_new_from_string()

See merge request GNOME/gtk!6599
2023-11-28 17:56:21 +00:00
Danial Behzadi
b969f4649d Update Persian translation 2023-11-28 08:47:40 +00:00
FeRD (Frank Dana)
f4f25e584c Fix docs function reference 2023-11-27 21:16:44 -05:00
FeRD (Frank Dana)
b049a3501a Additional review fixes 2023-11-27 19:44:24 -05:00