8507 Commits

Author SHA1 Message Date
Daniel van Vugt
2dbca5ff39 clutter/frame-clock: Record measurements of zero for cursor-only updates
But only if we've ever got actual swap measurements
(COGL_FEATURE_ID_TIMESTAMP_QUERY). If it's supported then we now drop to
double buffering and get optimal latency on a burst of cursor-only
updates.

Closes: https://launchpad.net/bugs/2023363
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1441>
2025-02-14 17:39:09 +00:00
Daniel van Vugt
463fc8b92c clutter: Enable triple buffering and adapt the KMS render tests
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1441>
2025-02-14 17:39:09 +00:00
Daniel van Vugt
394bf5ab24 clutter/frame-clock: Add triple buffering support
This replaces the DISPATCHED state with new sub-states that are possible
with triple buffering:

  DISPATCHED_ONE:                     Double buffering
  DISPATCHED_ONE_AND_SCHEDULED:       Scheduled switch to triple buffering
  DISPATCHED_ONE_AND_SCHEDULED_NOW:   Scheduled switch to triple buffering
  DISPATCHED_ONE_AND_SCHEDULED_LATER: Scheduled switch to triple buffering
  DISPATCHED_TWO:                     Triple buffering

Triple buffering is currently disabled until the test cases get updated to
handle it in the next commit.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1441>
2025-02-14 17:39:09 +00:00
Daniel van Vugt
9d2ab85f74 clutter/frame-clock: Merge states DISPATCHING and PENDING_PRESENTED
Chronologically they already overlap in time as presentation may
complete in the middle of the dispatch function, otherwise they are
contiguous in time. And most switch statements treated the two states
the same already so they're easy to merge into a single `DISPATCHED`
state.

Having fewer states now will make life easier when we add more states
later.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1441>
2025-02-14 17:39:09 +00:00
Daniel van Vugt
1c4ee8e062 clutter/frame-clock: Lower the threshold for disabling error diffusion
Error diffusion was introduced in 0555a5bbc15 for Nvidia where last
presentation time is always unknown (zero). Dispatch times would drift
apart always being a fraction of a frame late, and accumulated to cause
periodic frame skips. So error diffusion corrected that precisely and
avoided the skips.

That works great with double buffering but less great with triple
buffering. It's certainly still needed with triple buffering but
correcting for a lateness of many milliseconds isn't a good idea. That's
because a dispatch being that late is not due to main loop jitter but due
to Nvidia's swap buffers blocking when the queue is full. So scheduling
the next frame even earlier using last_dispatch_lateness_us would just
perpetuate the problem of swap buffers blocking for too long.

So now we lower the threshold of when error diffusion gets disabled. It's
still high enough to fix the original smoothness problem it was for, but
now low enough to detect Nvidia's occasionally blocking swaps and backs
off in that case.

Since the average duration of a blocking swap is half a frame interval
and we want to distinguish between that and sub-millisecond jitter, the
logical threshold is halfway again: refresh_interval_us/4.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1441>
2025-02-14 17:39:09 +00:00
Sebastian Wick
e5f6704a81 build: Convert string to int in gen-keyname-table.py
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4267>
2025-02-14 16:29:47 +00:00
Sebastian Wick
1fdebedd94 build: Fix argument type in clutter-keysyms-update.py
It's not a single-element-tuple but something we can iterate and
produces strings.

Also ignore typing for the requests module because we'd have to install
more things for it to be available.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4267>
2025-02-14 16:29:47 +00:00
Corentin Noël
2da7805f58 meson: Use library instead of shared_library
Allow to theoretically build mutter statically.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4244>
2025-02-11 09:55:07 +00:00
Bilal Elmoussaoui
581607f5f1 clutter: Update keyname table header
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4198>
2025-02-04 13:50:50 +01:00
Bilal Elmoussaoui
ce6a321da2 clutter: Ignore duplicated Break keysum
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4198>
2025-02-04 13:50:50 +01:00
Bilal Elmoussaoui
89d85a809b clutter: Update keysyms header
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4198>
2025-02-04 13:50:50 +01:00
Alberto Ruiz
c9612723f9 build: Remove all perl scripts from the build
replaced gen-keyname-table.pl and clutter-keysyms-update.pl with a
python implementation to remove the need for perl in the build stage

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4198>
2025-02-04 13:50:50 +01:00
Philip Withnall
c250f602bd clutter/actor: Remove transitions when removing an effect
If there are any in-progress transitions on any properties of the
effect, these will cause a crash next time they tick and update, as they
will try to access a `@effects.${effect_name}.${property_name}` property
on the `ClutterActor` which no longer resolves to an effect. In some
cases this will be because `priv->effects` itself is now `NULL` on the
`ClutterActor`.

This can be triggered by rapidly toggling screen time limits on and off
in gnome-shell with a low screen time limit which has already been
reached for the day. It will alternately add a desaturation effect and
fade-in transition, then remove the effect, then the transition will
update and crash.

Avoid this by removing relevant transitions when removing an effect.

Do the same for the other two groups of metas: constraints and actions,
as they will be subject to the same bug (under different reproducer
conditions). And the same for when any of these three meta groups are
cleared, as that could also trigger the same bug.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>

Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/8168
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4222>
2025-02-03 15:14:51 +00:00
Bilal Elmoussaoui
04218ac2b5 clutter: Handle accessible focus state change on Actor side
That is where it belongs anyways and would handle some missing branches
where we wouldn't update the focus state.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4089>
2025-01-20 14:23:44 +00:00
Bilal Elmoussaoui
9d72f658af clutter: Add accessible state tracking
Currently, this has been living in StWidget, moving that to Clutter
allows us to properly track the accessibility state changes in the
actors provided inside Clutter as well as simplifying things for a
future move from Atk.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4089>
2025-01-20 14:23:44 +00:00
Jonas Ådahl
3806c0bd44 clutter/stage: Add 'skipped-paint' signal/vfunc
This is intended to allow being notified about a stage update happening,
but painting didn't happen. This is possible today by using other
signals and keeping track of painting happened, but it saves us some
state tracking by just being told so.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4067>
2025-01-16 01:04:14 +00:00
Michel Dänzer
d908984d68 clutter/frame-clock: Use vblank_duration in calculate_next_update_time_us
In this scenario:

1. Only an "empty" content update (which results in no visible output
   change) from client A arrives before the frame deadline, so a frame
   event is sent for that at the deadline.
2. Another "empty" content update from client A results in a frame event
   being scheduled for the next frame deadline.
3. A non-"empty" content update from client B arrives before start of
   vblank, and the resulting output frame manages to hit the next
   display refresh cycle.

The result was that the frame events from steps 1+2 were sent during the
same display refresh cycle, so the frame rate reported by client A was
higher than the display refresh rate.

This change fixes that, at the cost of frame events being sent out
later in the display refresh cycle if there's no new frame for the
next cycle.

Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/3559
Fixes: 8f27ebf87eee ("clutter/frame-clock: Start next update ASAP after idle period")
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3878>
2025-01-10 14:59:10 +00:00
Derek Foreman
5b214dc2b7 clutter/frame-clock: Allow scheduling an update in the future
Allow creating a queue of future times to tick at. This adds a new clock
state where we let the clock go idle, but will wake at a time in the
future to tick.

We can still schedule ticks while in this new state, but we're assured a
tick at or shortly after the scheduled time.

This will be used later by wayland code that schedules future presentation.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3355>
2025-01-06 09:21:12 -06:00
Bilal Elmoussaoui
4ee657e31f cogl/texture: Drop set_auto_mipmap vfunc
As it is only relavant for 2D textures.
Allows getting rid of the is-primitive property which was enforcing only 2D textures
can use the set_auto_mipmap function.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4200>
2025-01-02 18:04:27 +00:00
Bilal Elmoussaoui
5621134399 clutter: Make cairo dependant on fonts build option
As it is only used there. Once we have removed cairo usage from meta, we
can make it tests specific.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4106>
2024-12-28 12:15:12 +00:00
Bilal Elmoussaoui
32c5faf010 build: Add a new fonts option
Allowing to disable font rendering integration, making it possible to
build Mutter without pango/harfbuzz/fribidi dependencies.

This commit also adds a new clutter-pango header that is used to include
pango specific bits.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4106>
2024-12-28 12:15:12 +00:00
Bilal Elmoussaoui
b0b1e0ef4e clutter: Inline character direction detection helper
By doing so, we can make the fribidi dependency specific to having x11
backend or fonts rendering support.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4106>
2024-12-28 12:15:11 +00:00
Bilal Elmoussaoui
fb48766710 clutter: Move pango helper to clutter/pango
As it is only used by the pango integration bits, so it can be disabled
along with the rest of it.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4106>
2024-12-28 12:15:11 +00:00
Bilal Elmoussaoui
4313c2bb58 clutter: Move Text actor to clutter/pango
Similar to ClutterText node in the previous commit.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4106>
2024-12-28 12:15:10 +00:00
Bilal Elmoussaoui
c15bb5d49c clutter: Move TextNode to a separate header
By moving it into clutter/pango, we can make it optional along with all
the pango usages. See the next commits.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4106>
2024-12-28 12:15:09 +00:00
Bilal Elmoussaoui
2c308caf72 clutter/context: Make get_font_map private
It is only used internally by ClutterActor.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4106>
2024-12-28 12:15:09 +00:00
Bilal Elmoussaoui
c5ea9562e1 clutter/backend: Stop re-allocating font_options
There is no real need to re-create a new cairo_font_options_t now that
the API is internal. Instead, create the font_options once and just
update it attributes.

Actors already register for the emitted font-changed signal to re-create
a new PangoContext.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4106>
2024-12-28 12:15:08 +00:00
Bilal Elmoussaoui
17e7f9be51 clutter/backend: Remove unused font_name field
We already store the exact same thing in ClutterSettings.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4106>
2024-12-28 12:15:08 +00:00
Bilal Elmoussaoui
3153708e85 clutter/backend: Initialize default font options if no schema found
When the `org.gnome.desktop.interface` schema is not found, currently
we were not initializing the font_options which means we needed to
handle that on the backend side. Instead, generate the font_options at
that moment.

As the settings are loaded the moment we assign a backend to the
settings `_clutter_settings_set_backend` which is called just after the
backend is constructed which is too early for any actor to use it for
creating a PangoContext, so the change is safe.

Also, as the font_options getter is only used in ClutterActor when
creating the PangoContext, drop the getter. As we might just store that
info somewhere else in the future.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4106>
2024-12-28 12:15:07 +00:00
Bilal Elmoussaoui
727d923f12 clutter/settings: Simplify cairo_font_options creation further
Currently, we were first reading the settings, creating a FontSettings
struct and then mapping the string associated on that struct back to
their corresponding cairo type. A lot of dancing for not much benefits.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4106>
2024-12-28 12:15:06 +00:00
Bilal Elmoussaoui
f4d97bb53f clutter/backend: Mark [get|set]_font_options as private
The cairo_font_options is only meant to be consumed by ClutterActor when
creating a PangoContext and as those APIs are never used externally,
mark them private to not expose more cairo APIs.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4106>
2024-12-28 12:15:06 +00:00
Bilal Elmoussaoui
86fff39aa4 clutter/settings: Remove unused field
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4106>
2024-12-28 12:15:05 +00:00
Bilal Elmoussaoui
222ac59dc7 clutter/settings: Remove unused unscaled-font-dpi property
Nothing ever sets or use it, so remove it.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4106>
2024-12-28 12:15:04 +00:00
Bilal Elmoussaoui
b559e5a14d clutter/settings: Drop xft font properties
As those properties are never set externally and just end up mapping the
gsettings values, in order to create a cairo_font_options_t.

Instead, simplify the whole thing and just create the
cairo_font_options_t from the resulting FontSettings.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4106>
2024-12-28 12:15:04 +00:00
Bilal Elmoussaoui
7d376dfddc clutter: Drop CLUTTER_DRIVER env variable
We already have a COGL_DRIVER that allows selecting a specific
CoglDriverId.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4194>
2024-12-27 13:25:40 +00:00
Bilal Elmoussaoui
623c6c6cd3 clutter: Make debug helpers functions introspected
Fixes: e06592d3d ("util: Drop duplicated Clutter debug flags helpers")
Closes https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/8118

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4197>
2024-12-23 14:16:42 +01:00
Bilal Elmoussaoui
1fce76a0fb cogl/graphene: Simplify matrix_project_points helper
As it is always used for 3 components, drop n=2 and n=4 support.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4180>
2024-12-12 15:13:04 +00:00
Bilal Elmoussaoui
0103288739 cogl: Rename Driver to DriverID
As we will be having a CoglDriver abstract class in the next commit.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4132>
2024-12-12 09:11:33 +01:00
Bilal Elmoussaoui
e06592d3df util: Drop duplicated Clutter debug flags helpers
Clutter exposes those functions already.
So there is literally 0 point in duplicating them.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4131>
2024-12-11 18:28:57 +01:00
Georges Basile Stavracas Neto
3c4ec122b5 clutter/paint-volume: Cleanup private API
Following previous commit, rename _clutter_paint_volume_init_static()
to clutter_paint_volume_init_from_actor(), and also
_clutter_paint_volume_copy_static() to
clutter_paint_volume_init_from_paint_volume().

Make clutter_paint_volume_init_from_paint_volume() follow the dst/src
semantic in its arguments, which also allows removing
_clutter_paint_volume_set_from_volume() which is exactly the same now.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4175>
2024-12-10 14:18:18 -03:00
Georges Basile Stavracas Neto
7e24b9696a clutter/paint-volume: Remove 'is_static'
And change clutter_paint_volume_free() to always free the paint volume.
Remove all calls to clutter_paint_volume_free() on static variables.

Having to call a free function on a static variable always seemed a bit
odd, and this genuinely confuses Coverity (and me).

Coverity CID: #1505838

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4175>
2024-12-10 14:18:17 -03:00
Georges Basile Stavracas Neto
38d4962c20 clutter/paint-nodes: Use g_autoptr
Tighten up the refcount of the CoglTexture created by the blur node.
This seems to make Coverity happier.

Coverity CID: #1575122

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4175>
2024-12-10 14:18:17 -03:00
Georges Basile Stavracas Neto
2e61e58b57 clutter/gesture-action: Call clutter_event_type once
It's not really necessary to call clutter_event_type (event) twice
for the same event. It also seems to confuse Coverity.

Coverity CID: #1508228

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4175>
2024-12-10 14:18:17 -03:00
Bilal Elmoussaoui
a2dd7d6d1d clutter: Move Image down to GNOME Shell
As is, ClutterImage is not really useful, it only serves for rendering a
CoglTexture as an actor. Shell, has a subclass that adds more features
that unfortunately cannot be upstreamed without bringing more gdk-pixbuf
usage inside libmutter, eg implementing GIcon/GLoadableIcon.

It also has requirements based on whether the image is symbolic or not.
Things that Clutter so far doesn't care about.

So just remove ClutterImage & let shells re-implement it themselves if
needed based on their needs.

Note, that once we have ClutterSnapshot, it should be straightforward to
write a custom actor that renders a CoglTexture or so.

This "un"fortunately means getting rid of various interactive tests that
either didn't compile at all or are not useful as is, like all the
remaining interactive tests.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4133>
2024-12-09 12:14:28 +00:00
Michel Dänzer
376c0585ef clutter/stage-view: Clear output_color_state in dispose
Fixes leaks:

==1060013== 96 (32 direct, 64 indirect) bytes in 1 blocks are definitely lost in loss record 10,897 of 13,064
==1060013==    at 0x4F81D57: g_type_create_instance (gtype.c:1929)
==1060013==    by 0x4F64ABF: g_object_new_internal.part.0 (gobject.c:2606)
==1060013==    by 0x4F66ADD: g_object_new_internal (gobject.c:2603)
==1060013==    by 0x4F66ADD: g_object_new_with_properties (gobject.c:2769)
==1060013==    by 0x4F67A30: g_object_new (gobject.c:2415)
==1060013==    by 0x52F7C7B: clutter_color_state_new_full (clutter-color-state.c:339)
==1060013==    by 0x4939CD0: update_color_state (meta-color-device.c:725)
==1060013==    by 0x4939DDE: meta_color_device_new (meta-color-device.c:759)
==1060013==    by 0x493CB7B: update_devices (meta-color-manager.c:205)
==1060013==    by 0x493CE65: meta_color_manager_monitors_changed (meta-color-manager.c:264)
==1060013==    by 0x49341CB: meta_backend_monitors_changed (meta-backend.c:371)
==1060013==    by 0x4969150: meta_monitor_manager_notify_monitors_changed (meta-monitor-manager.c:1235)
==1060013==    by 0x496928F: meta_monitor_manager_setup (meta-monitor-manager.c:1273)
==1060013==
==1060013== 96 (32 direct, 64 indirect) bytes in 1 blocks are definitely lost in loss record 10,898 of 13,064
==1060013==    at 0x4F81D57: g_type_create_instance (gtype.c:1929)
==1060013==    by 0x4F64ABF: g_object_new_internal.part.0 (gobject.c:2606)
==1060013==    by 0x4F66ADD: g_object_new_internal (gobject.c:2603)
==1060013==    by 0x4F66ADD: g_object_new_with_properties (gobject.c:2769)
==1060013==    by 0x4F67A30: g_object_new (gobject.c:2415)
==1060013==    by 0x52F7C7B: clutter_color_state_new_full (clutter-color-state.c:339)
==1060013==    by 0x4939CD0: update_color_state (meta-color-device.c:725)
==1060013==    by 0x4939DDE: meta_color_device_new (meta-color-device.c:759)
==1060013==    by 0x493CB7B: update_devices (meta-color-manager.c:205)
==1060013==    by 0x493CE65: meta_color_manager_monitors_changed (meta-color-manager.c:264)
==1060013==    by 0x49341CB: meta_backend_monitors_changed (meta-backend.c:371)
==1060013==    by 0x4969150: meta_monitor_manager_notify_monitors_changed (meta-monitor-manager.c:1235)
==1060013==    by 0x496EA7D: meta_monitor_manager_rebuild (meta-monitor-manager.c:3968)

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4149>
2024-12-06 16:49:34 +00:00
Michel Dänzer
57f3e172ca clutter/color-manager: Clear default_color_state in finalize
Fixes leak:

==5763== 96 (32 direct, 64 indirect) bytes in 1 blocks are definitely lost in loss record 10,901 of 13,065
==5763==    at 0x4F81D57: g_type_create_instance (gtype.c:1929)
==5763==    by 0x4F64ABF: g_object_new_internal.part.0 (gobject.c:2606)
==5763==    by 0x4F66ADD: g_object_new_internal (gobject.c:2603)
==5763==    by 0x4F66ADD: g_object_new_with_properties (gobject.c:2769)
==5763==    by 0x4F67A30: g_object_new (gobject.c:2415)
==5763==    by 0x52F7C46: clutter_color_state_new_full (clutter-color-state.c:339)
==5763==    by 0x52F7C03: clutter_color_state_new (clutter-color-state.c:312)
==5763==    by 0x52F7110: clutter_color_manager_get_default_color_state (clutter-color-manager.c:150)
==5763==    by 0x52E7543: get_default_color_state (clutter-actor.c:17836)
==5763==    by 0x52E765D: clutter_actor_unset_color_state (clutter-actor.c:17864)
==5763==    by 0x52CF056: clutter_actor_constructor (clutter-actor.c:5646)
==5763==    by 0x4F64DD3: g_object_new_with_custom_constructor (gobject.c:2524)
==5763==    by 0x4F67275: g_object_new_internal (gobject.c:2604)
==5763==    by 0x4F67275: g_object_new_valist (gobject.c:2945)

Fixes: 2693cac83a5c ("clutter/color-manager: Add a method to get the default color state")
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4149>
2024-12-06 16:49:34 +00:00
Corentin Noël
cd765c2da9 clutter: Add missing public headers to the main header
Also remove keyval source file from the installed headers. Move clutter-mutter to
the private headers.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4156>
2024-12-06 10:54:06 +00:00
Joan Torres
0095e7d50a clutter/color-state-params: Improve create transform snippet
Make create_transform_snippet method more consistent.

Abstract TransferFunction struct: convert it to ColorOpSnippet.

This transform snippet will be defined by these ColorOpSnippets.
These ColorOpSnippets are similar to the prescriptive DRM API for
color transformation.

A standard transform snippet would have as ColorOpSnippets:
  1. eotf
  2. luminance_mapping
  3. color_space_mapping
  4. inv_eotf

Update uniforms the same way the transform snippet is defined.

Update color transform key to consider how the transform snippet is
generated.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4144>
2024-12-05 22:24:05 +00:00
Joan Torres
7f8df9d9a1 clutter/color-state-params: Add new_from_primitives
When creating a new color state from the primitives Colorimetry, EOTF
and Luminance; it is needed to previously check their tags to properly get
their values and avoid UB.

This check is duplicated and is a bit unreadable.

Using this new function helps keeping readability.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4144>
2024-12-05 22:24:05 +00:00
Joan Torres
2e2a91a14b clutter/color-state-params: Make get white chromaticity func generic
Change the name of the func to xyY_to_XYZ which explains more and allows
reusing it in the following commits.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4144>
2024-12-05 22:24:05 +00:00