Commit Graph

3 Commits

Author SHA1 Message Date
Alexander Orzechowski
3187479c07 render/color: Invert ownership model of color_transform types.
Color transform can have multiple types and these different types
want to store different metadata. We previously stored this metadata
directly on wlr_color_transform even for transforms that don't use it.

Instead, let's take the prior art from wlr_scene where each scene node
is built on a base node. Notice how wlr_color_transform_lut3d now has
a `struct wlr_color_transform base`. This is advantageous in multiple
ways:

1. We don't allocate memory for metadata that will never be used.
2. This is more type safe: Compositors can pass around a
struct wlr_color_transform_lut3d if they know they only want to use a
3d_lut.
3. This is more scalable. As we add more transform types, we don't have
to keep growing a monolithic struct.
2024-08-24 14:33:22 -04:00
Simon Ser
a75c6cca54 render/color: fix return value type
../render/color_lcms2.c: In function ‘wlr_color_transform_init_linear_to_icc’:
    ../render/color_lcms2.c:26:24: error: incompatible types when returning type ‘_Bool’ but ‘struct wlr_color_transform *’ was expected
       26 |                 return false;
          |                        ^~~~~
2024-06-27 18:13:05 +00:00
Simon Ser
aa340ade65 render/color: split off lcms2 code
Fixes compilation with color management disabled.
2024-04-30 16:56:03 +02:00