Commit Graph

81350 Commits

Author SHA1 Message Date
Simon McVittie
a8bb71383a tests: Fix signature of GtkTestATContext::update-selection-bound handlers
The signal is declared in GtkTestATContext with 0 parameters, but these
handlers were written as if the signal had one `guint` parameter.
On some architectures this accidentally works as intended, but on
others (reproduced on i386 and riscv64) the test tries to use arbitrary
stack contents as the `TestData *` and crashes when it tries to
dereference the resulting non-pointer.

Resolves: https://gitlab.gnome.org/GNOME/gtk/-/issues/6490
Signed-off-by: Simon McVittie <smcv@debian.org>
2024-07-27 00:59:03 +01:00
Matthias Clasen
3b08f8026e Merge branch 'matthiasc/for-main' into 'main'
jpeg: Port to GdkMemoryTextureBuilder

See merge request GNOME/gtk!7502
2024-07-26 23:09:27 +00:00
Matthias Clasen
2cdc2287a5 Merge branch 'amolenaar/macos-open-panel-create-folders' into 'main'
macos: Propagate the create-folders option also for Open panels

Closes #6872

See merge request GNOME/gtk!7492
2024-07-26 22:35:43 +00:00
Juan Pablo Ugarte
c80c4ee75c Tests: add GtkPicture builder test
Add test for GtkPicture::file GFile property.
2024-07-26 18:30:58 -04:00
Juan Pablo Ugarte
082691ba16 GtkBuilder: add support for paths and relative uris for GFile properties. 2024-07-26 18:30:58 -04:00
Matthias Clasen
d09a610433 Merge branch 'spinbutton-hint' into 'main'
gtkspinbutton: Set number input hint for text field

See merge request GNOME/gtk!7485
2024-07-26 22:05:34 +00:00
Matthias Clasen
ea9f8b2f77 downloader: Add some docs
Mention the default format and color state.
2024-07-26 17:38:27 -04:00
Matthias Clasen
e2d337740f gpu: Don't mess up color states
When uploading textures, we were unintentionally converting to
srgb. Avoid that, so that yuv data survives unmolested.
2024-07-26 17:34:48 -04:00
Matthias Clasen
45c5b250b9 texture: Don't mess up color states
gdk_texture_download_surface was converting twice from the texture
color state to the target color state, with predictably bad results.
2024-07-26 17:27:20 -04:00
Matthias Clasen
f4b35093bd jpeg: Port to GdkMemoryTextureBuilder
This is in preparation for some color state handling.
2024-07-26 16:43:54 -04:00
Matthias Clasen
5e52cefb28 Merge branch 'rtl-label-hickup' into 'main'
label: Clear layout when text direction changes

Closes #6836

See merge request GNOME/gtk!7497
2024-07-26 18:13:28 +00:00
Benjamin Otte
bf43aee690 Merge branch 'wip/otte/for-main' into 'main'
gstreamer: Specify values for unspecified values

See merge request GNOME/gtk!7500
2024-07-26 14:38:01 +00:00
Matthias Clasen
62f359a494 Merge branch 'css-relative-font' into 'main'
css: Fix relative font sizes

Closes #6868

See merge request GNOME/gtk!7498
2024-07-26 14:24:42 +00:00
Benjamin Otte
cbe09373a5 gstreamer: Specify values for unspecified values
When the cicp values coming out of GStreamer are unspecified, replace
them with the default cicp values for YUV video: 1/13/6.

We still may end up with unspecified values inside the params, because
GStreamer returns unspecified for primaries/tfs/matrices that aren't
supported by cicp.

See also https://github.com/AOMediaCodec/libavif/wiki/CICP#unspecified
fora similar discussion.
2024-07-26 15:16:05 +02:00
Matthias Clasen
b3451dda04 css: Fix relative font sizes
This regression was introduced in aeac2b54.

We need percentage values to stay non-computed, since we otherwise
fail to compute relative font sizes properly. But we want percentages
not to stick around in relative colors, so tweak things to be more
aggressive with simplication when creating relative color values.

Update affected tests.

Fixes: #6868
2024-07-26 08:45:58 -04:00
Matthias Clasen
d477bf3d93 Merge branch 'image-tool-side-by-side' into 'main'
image-tool: Allow showing images side-by-side

See merge request GNOME/gtk!7501
2024-07-26 12:08:12 +00:00
Matthias Clasen
12c7f2d4fd Merge branch 'matthiasc/for-main' into 'main'
gpu: More debug spew

See merge request GNOME/gtk!7499
2024-07-26 12:07:55 +00:00
Matthias Clasen
feca09b8a4 image-tool: Allow showing images side-by-side
This is useful for comparisons.
2024-07-26 07:44:31 -04:00
Matthias Clasen
150f57f706 gpu: Fix the cicp conversion
The fragment shader was mixing up pixel and color variables.
And the compilers don't have 'uninitialized variable' warnings :(
2024-07-26 07:24:48 -04:00
Matthias Clasen
33131ad24d gpu: Fix the cicp conversion shader for ngl
The compiler was unhappy with using signed labels with an unsigned
variable in a switch. Talk about being picky.
2024-07-26 07:23:18 -04:00
Matthias Clasen
d53b3f9941 gpu: More debug spew
Print out the direction of the cicp conversion.
2024-07-26 07:22:45 -04:00
Martin
da07f1221f Update Slovenian translation 2024-07-26 09:36:52 +00:00
Matthias Clasen
9aed7ab25f Merge branch 'matthiasc/for-main' into 'main'
Add an image tool

See merge request GNOME/gtk!7496
2024-07-26 03:36:57 +00:00
Matthias Clasen
5ae225fe52 Add an image tool
This is meant to provide a convenient way to produce images in
specific color states and memory formats.
2024-07-25 18:20:59 -06:00
Matthias Clasen
cc8fa39110 tools: Improve localization 2024-07-25 18:20:59 -06:00
Matthias Clasen
c673a0bcc3 label: Clear layout when text direction changes
Otherwise, wrong alignment settings may linger in the layout.

Fixes: #6836
2024-07-25 17:06:58 -06:00
Benjamin Otte
efc6d15dde Merge branch 'wip/otte/for-main' into 'main'
gpu: Don't run long loops in shaders

See merge request GNOME/gtk!7495
2024-07-25 20:42:55 +00:00
Benjamin Otte
50403fbca8 wayland: Actually compare the right values
Wayland primaries/transfer functions aren't cicp values, so we can't
compare them.
2024-07-25 22:06:56 +02:00
Benjamin Otte
7de91d1777 wayland: We use v4 of the protocol 2024-07-25 22:06:56 +02:00
Benjamin Otte
6f9a70bd4e gpu: Add a version of a function
With the changes in !7473 we now use sampler2D arguments in functions.
However, when there's a function we call with a samplerExternalOES -
which means we need to overload it with that shader variant.
2024-07-25 18:53:55 +02:00
Benjamin Otte
de1dfb99bc gpu: Add shader name to error message
When a shader cant be compiled, we produce a long error dump, but
nowhere did we mention the actual shader.

Fix that.
2024-07-25 18:53:55 +02:00
Benjamin Otte
103296d948 gstsink: Make it usable again
The later CICP changes made the cicp params we were setting unustable.

Set ones that work in the current state of git main. They are still
imperfect, but they reflect the current code.
2024-07-25 18:53:55 +02:00
Benjamin Otte
0001562850 dmabuf: Fix Vulkan formats for P010 and friends
The P01x and P21x formats were swapped.
2024-07-25 18:53:55 +02:00
Benjamin Otte
1f3c88b995 build: Skip vulkan parts in generated GLSL
Make the #include parsing script able to skip a predefined list of terms
with #ifdef

Put "VULKAN" in that list to skip the vulkan parts.
2024-07-25 17:32:19 +02:00
Benjamin Otte
5e7f227d92 gpu: Don't run long loops in shaders
If the border radius is too big, take bigger steps when computing the
shadow.

I randomly chose 8 because that looked good and was fast enough.
2024-07-25 17:32:19 +02:00
Arjan Molenaar
6bbda619f9 macos: Propagate the create-folders option also for Open panels
When opening a folder, it may come in handy to create a folder.

Fixes #6872.
2024-07-25 11:32:14 +02:00
Matthias Clasen
e216fa3b6d Merge branch 'cicp-color-states' into 'main'
Fix the hlg transfer function

See merge request GNOME/gtk!7493
2024-07-25 01:19:02 +00:00
Matthias Clasen
c9443dd04d Fix the hlg transfer function
Fix a bug in the formula, and enable hlg as a transfer function.

The tests are passing now.
2024-07-24 18:59:18 -06:00
Matthias Clasen
29cb5051d4 Merge branch 'cicp-color-states' into 'main'
colorstate: Add cicp support

See merge request GNOME/gtk!7453
2024-07-25 00:48:57 +00:00
Matthias Clasen
5f2e70df8e Drop hlg for now
For some reason, roundtrip tests  with the hlg tf are failing,
so we don't support it.
2024-07-24 17:53:12 -06:00
Matthias Clasen
d8775d0194 gsk: Make shader matrices match
We were using slightly different numbers here, which isn't good.

The matrices in gdkcolordefs.h are tested in the colorstate-internal
tests, so they are at least properly inverse, and the products match.

It would be better to generate the glsl definitions, somehow.
2024-07-24 16:45:21 -06:00
Matthias Clasen
8d87ed1a6a Add tests
Add some more texture conversion roundtrips. They are currently
ifdefed out, since they need cicp api.

Also add another test binary for internal tests.
2024-07-24 16:45:21 -06:00
Matthias Clasen
a46bcc2755 Move transfer functions and matrices to a header
This way, we can write tests against them without static linking.
2024-07-24 16:45:21 -06:00
Matthias Clasen
229edc5225 wayland: Normalize cicp values
We don't want to create multiple image descriptions for functionally
equivalent tuples.
2024-07-24 16:45:21 -06:00
Benjamin Otte
b1962de51a gtksink: Add colorstate handling
The part for matrix coefficients and range is commented out so far.

It requires fixes so the dmabuf handling code can properly deal with it.
2024-07-24 16:45:21 -06:00
Matthias Clasen
fb10b61528 gdk: Add public api for cicp
Add a GdkCicpParams object that acts a bit like a builder for
cicp color states.
2024-07-24 16:45:21 -06:00
Matthias Clasen
e415ec9ca5 gsk: Use the cicp convert shader
When we the image color state is not a default one, use the cicp
convert op to convert it to the ccs. And when the target color
state is a non-default one, use the shader in the reverse direction.
2024-07-24 08:16:08 -06:00
Matthias Clasen
226652edb0 gsk: Add a cicp convert shader
This shader receives cicp parameters via uniforms, and converts
the texture data from or to the output colorstate. It computes
the matrix in the vertex shader, and then picks the eotf/oetf
according to the cicp parameters in the fragment shader.
2024-07-24 08:16:08 -06:00
Matthias Clasen
64f4967867 png: Make loader use cicp api
This should make non-default color states work with our png
loading and saving machinery.
2024-07-24 08:16:08 -06:00
Matthias Clasen
c37fa3a895 wayland: Use cicp color states
This is entirely untested, and the Wayland protocol makes it very
annoying.
2024-07-24 08:16:08 -06:00