Matthias Clasen
6b76c13bcc
gpu: Pass compositing color states around
...
Make the node processor and the pattern writer track the current
compositing color state. Color state nodes change it. We pass
the surface color state down via the frame apis.
2024-06-16 15:57:25 -04:00
Matthias Clasen
5ab831215e
testsuite: Replay color state nodes
2024-06-16 15:57:25 -04:00
Matthias Clasen
1e404f6625
Add gtk_snapshot_push_color_state
2024-06-16 15:57:25 -04:00
Matthias Clasen
2dc85d7e5f
Add a color state node
2024-06-16 15:57:25 -04:00
Matthias Clasen
5f706c73fd
testsuite: Compare textures properly
...
When compoaring textures, we now need to look
at the colorspace as well.
2024-06-16 15:57:25 -04:00
Matthias Clasen
208e5a9931
gtk-demo: Add a color space demo
...
This is using test images from http://displaycal.net/ .
2024-06-16 15:57:25 -04:00
Benjamin Otte
421e8dcbc8
widget-factory: Add gradient rendering test
...
Test how GTK draws gradients, by adding an sRGB and a linear colorspace
gradient and draw one with CSS.
Have a look which one (if any) matches.
2024-06-16 15:57:25 -04:00
Matthias Clasen
2bc12a8b27
cairo: Use stem darkening for glyphs
...
This involves tweaking a freetype driver property
directly, since cairo font options don't cover this.
So the code is a bit ugly, but it does make text
appear darker.
2024-06-16 15:57:25 -04:00
Matthias Clasen
bfca93eafc
Port gsk_render_node_draw to GdkColor
...
Use GdkColor when using cairo for rendering. This makes it so that
the rendering happens in a color-managed way when a color state has
been attached to the target.
2024-06-16 15:57:25 -04:00
Matthias Clasen
bd2ac3e897
cairo: Use GdkColor
2024-06-16 15:57:25 -04:00
Matthias Clasen
1e1c8d1a6d
Add crude color management impl for cairo
...
Use linear compositing with cairo if LINEAR_COMPOSITING=1 is
set in the environment.
2024-06-16 15:57:25 -04:00
Matthias Clasen
7b4f08eea6
Add gdk_cairo_set_source_color
2024-06-16 15:57:25 -04:00
Benjamin Otte
baefbc5259
Add color space get/set for cairo
...
Add a centralized place to attach color space to.
Nothing uses that information yet, but all the
backends do set it.
2024-06-16 15:57:25 -04:00
Matthias Clasen
81da727a9c
gdk: Introduce GdkColor
...
GdkColor represents a color in the real world, by combining a color
profile, an alpha value and N component values.
2024-06-16 15:57:25 -04:00
Benjamin Otte
13e3242e7d
gdk: Add GDK_DEBUG=srgb
...
Disables gdk_surface_set_color_profile() for backends and forces
sRGB.
This does not change any GSK renderers, it just turns off any backends
trying to hand us color profiles.
2024-06-16 15:57:25 -04:00
Benjamin Otte
afb02f2d54
x11: Implement support for color states
...
Stole the implementation from eog.
This doesn't yet update the color state when it changes though.
2024-06-16 15:57:25 -04:00
Matthias Clasen
c53772908c
Give surfaces a color state
...
Add api to get the color state of a surface.
2024-06-16 15:57:25 -04:00
Matthias Clasen
83523d88f6
Add color state to texture download methods
2024-06-16 15:57:25 -04:00
Matthias Clasen
b5e4bf7a70
Add color states to gdk_memory_convert
...
This lets us perform color space conversions at the same time
as memory format changes.
2024-06-16 15:57:25 -04:00
Matthias Clasen
1c1d52cc59
pixbuf: Add color state support
...
When creating a GdkTexture from a GdkPixbuf, see if it has an
icc profile attached, and if so, use it.
2024-06-16 15:57:25 -04:00
Matthias Clasen
6b600a2bd8
tiff: Add color state support
...
When loading or saving tiff files, translate between embedded
icc profiles and color state objects.
2024-06-16 15:57:25 -04:00
Benjamin Otte
e3100bde3b
png: Add color state support
...
When loading or saving png files, translate between embedded
icc profiles or cicp data and color state objects.
2024-06-16 15:57:25 -04:00
Benjamin Otte
5395e839a3
jpeg: Add color state support
...
When loading or saving jpeg files, translate between embedded
icc profiles and color state objects.
2024-06-16 15:57:25 -04:00
Matthias Clasen
9cbe82d7fe
dmabuf texture: color state support
2024-06-16 15:57:25 -04:00
Matthias Clasen
8ed427dab9
gl texture: color state support
2024-06-16 15:57:25 -04:00
Matthias Clasen
47fe542e62
memory texture: color state support
2024-06-16 15:57:25 -04:00
Matthias Clasen
67e3afe42e
Give textures a color state
2024-06-16 15:57:25 -04:00
Matthias Clasen
b2e72700e8
Add some colorstate tests
...
This is very minimal, but it is enough to do
a very basic check of the gdk_color_space_equal
implementation.
2024-06-16 15:57:25 -04:00
Matthias Clasen
ae1e2a13d1
Add GdkColorState
...
This is just an empty shell for now.
2024-06-16 15:57:25 -04:00
Matthias Clasen
76a80d8f45
Merge branch 'docs-drawing-overview' into 'main'
...
docs: gtk_widget_queue_draw() is a single function, not a set anymore
See merge request GNOME/gtk!7362
2024-06-16 18:16:42 +00:00
Matthias Clasen
153b8399f7
Merge branch 'matthiasc/for-main' into 'main'
...
css: Move the color space enums to a better place
See merge request GNOME/gtk!7363
2024-06-16 18:14:01 +00:00
Matthias Clasen
da41271dd5
css: Parse interpolation for conic gradients
...
Parse things like "in hsl hue longer". For details, see the
CSS Images Module Level 4, https://www.w3.org/TR/css-images-4 .
This commit fixes preexisting brokenness in conic-gradient parsing
and printing as well, and includes the relevant test changes.
Tests included.
Gradient interpolation color spaces aren't supported for
rendering yet.
2024-06-16 13:22:36 -04:00
Matthias Clasen
5610af1b77
css: Parse interpolation for radial gradients
...
Parse things like "in hsl hue longer". For details, see the
CSS Images Module Level 4, https://www.w3.org/TR/css-images-4 .
Tests included.
Gradient interpolation color spaces aren't supported for
rendering yet.
2024-06-16 13:22:27 -04:00
Matthias Clasen
8da70fec91
css: Parse interpolation for linear gradients
...
Parse things like "in hsl hue longer". For details, see the
CSS Images Module Level 4, https://www.w3.org/TR/css-images-4 .
Tests included.
Gradient interpolation color spaces aren't supported for
rendering yet.
2024-06-16 13:21:56 -04:00
Matthias Clasen
f9cd30a859
css: Better error reporting
...
I seem to mix up the order of 'longer hue' occasionally, so lets
throw a helpful error message if we see 'hue' first.
2024-06-16 13:04:58 -04:00
Matthias Clasen
763d620a23
css: Parse all supported color spaces
...
The code parsing interpolation methods hadn't learned about
or latest color space additions. While we're at it, improve
the error reporting a bit.
Tests included.
2024-06-16 13:04:52 -04:00
Matthias Clasen
500a3a6dee
css: Add a helper function for parsing
...
This will be helpful in gradient parsing code, where the color
interpolation is optional.
2024-06-16 13:04:44 -04:00
Matthias Clasen
57073e1057
css: Move the color space enums to a better place
...
These will be used in the gradient code too, so put them into
a more better place.
2024-06-16 13:04:13 -04:00
Daniel Rusek
6bbfd2f62a
Update Czech translation
2024-06-16 13:32:33 +00:00
Gabor Karsay
6c69a96cd7
docs: link some methods in drawing model overview
2024-06-16 10:30:44 +00:00
Gabor Karsay
fa247d5a84
docs: gtk_widget_queue_draw() is a single function, not a set anymore
2024-06-16 10:02:32 +00:00
Matthias Clasen
0320c4ac14
Merge branch 'matthiasc/for-main' into 'main'
...
gpu: Print some more details
See merge request GNOME/gtk!7360
2024-06-15 21:59:14 +00:00
Matthias Clasen
36993ac707
gpu: Print some more details
...
Print the variations of mask and blendmode operations.
Just because we can.
2024-06-15 14:00:46 -04:00
Matthias Clasen
2f93eb4a28
Merge branch 'matthiasc/for-main' into 'main'
...
Fix a copy-paste error
See merge request GNOME/gtk!7358
2024-06-14 23:18:55 +00:00
Matthias Clasen
5a2982ac31
testsuite: Fix one nodeparser error
2024-06-14 14:11:54 -04:00
Matthias Clasen
441b704afd
testsuite: Stop relying on xpms
...
gdk-pixbuf isn't loading those anymore, by default.
2024-06-14 14:11:22 -04:00
Matthias Clasen
abf6ebd7fe
label: Only put alpha in attributes when needed
...
It does not do much harm, but it broke some of our tests.
2024-06-14 14:04:23 -04:00
Matthias Clasen
34fb08af6e
Fix a copy-paste error
...
This was obviously meant to compare two different colors.
2024-06-14 12:30:06 -04:00
Matthias Clasen
0b9dfdd41f
Merge branch 'wip/alice/color-fix' into 'main'
...
More color clamping and redraw fixes
See merge request GNOME/gtk!7357
2024-06-14 11:07:49 +00:00
Alice Mikhaylenko
701e0812e4
treeview: Clamp tree line and grid line colors
2024-06-14 03:04:54 +04:00