8494 Commits

Author SHA1 Message Date
Sebastian Wick
4938987d97 clutter/paint-nodes: Avoid useless copying of the LayerNode pipeline
The constructor already copies the pipeline which means we can add a
snippet safely without affecting the parent pipeline, without creating
another copy.

Fixes: 6b07141f1a ("clutter/paint-nodes: Make paint nodes handle color transformations")
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4037>
2024-11-06 10:51:55 +00:00
Bilal Elmoussaoui
a5be92e03d Use _once variant of g_[timeout_idle]
Nice helpers that were added in GLib 2.72, so safe to make use of as we
depend on 2.81.1 already.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4115>
2024-11-04 21:18:37 +00:00
Bilal Elmoussaoui
dabc13f7b8 clutter: Stop using get_default_backend helper
As it ends up using the global default context. So just call that
directly to easily spot the remaining usages of get_default_context.

Note that the helper will probably be removed later this cycle once the
remaining usages in meta & libst have been replaced with passing around
the context

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4077>
2024-10-30 08:32:46 +01:00
Bilal Elmoussaoui
696dfaa124 clutter/threads: Remove helper functions
See previous commit

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4077>
2024-10-30 08:32:46 +01:00
Bilal Elmoussaoui
d92893b6f3 clutter/threads: Remove _full functions variant
As they are not used anywhere, in the next commit
we will just remove the whole thing and use glib helpers directly as
there is nothing specific about ClutterThread anymore

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4077>
2024-10-30 08:32:46 +01:00
Bilal Elmoussaoui
40e7998669 clutter/pango: Avoid going through global context
As we have access to the actor context in most of the cases except for
render nodes.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4077>
2024-10-30 08:32:46 +01:00
Bilal Elmoussaoui
93a05a0631 clutter/stage-window: Remove functions declarations
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4077>
2024-10-30 08:32:46 +01:00
Bilal Elmoussaoui
a0dc7d9f1c clutter/a11y: Remove unused AtkUtil implementation
Following what GTK 3 does in
https://gitlab.gnome.org/GNOME/gtk/-/blob/gtk-3-24/gtk/a11y/gtkaccessibilityutil.c. It only overrides AtkUtil's vfuncs

In the future, we would very likely switch away from using Atk and
follow the path of GTK 4, but it is still to be decided whether
we want to communicate with the accessibility bus manually or use
something like accesskit

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4077>
2024-10-30 08:32:46 +01:00
Joan Torres
56d5b36b86 clutter/color-state: Fix of indentation and duplicated endline
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4108>
2024-10-25 17:30:23 +02:00
Joan Torres
24712ba3a8 clutter/color-state: Fix threshold on bt709 eotf
It was used the same threshold used at the inv eotf.
Use the right one getting it from the function.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4108>
2024-10-25 17:30:23 +02:00
Daniel van Vugt
817a951b24 clutter/frame-clock: Move "last" frame fields into structs
While in double buffering we only care about one previous presentation,
triple buffering will sometimes need to refer to the presentation from
two dispatches prior. So it might help to separate those frame stats
more clearly. This way each frame's dispatch and presentation times are
stored more cohesively such as to not be overwritten during overlapping
frame lifetimes.

Having two types of frame reference (dispatch and presentation) moving
at difference speeds meant that they could not be stored in a ring. Not
all dispatches become presentations and so storing them in a ring would
necessitate very complex conflict avoidance. Instead, a simple reference
counting model was used.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3961>
2024-10-21 08:47:36 +00:00
Daniel van Vugt
85f0f4e227 clutter/frame-clock: Notify on all empty frames
So that we maintain a perfectly balanced number of callbacks:

  dispatch == notify_ready + notify_presented

Otherwise you can't put any useful logic inside notify_ready and be sure
you're handling all the empty frames.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3961>
2024-10-21 08:47:36 +00:00
Bilal Elmoussaoui
54a7ffea81 clutter/pango: Follow coding style for function declarations
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4004>
2024-10-08 16:00:57 +00:00
Bilal Elmoussaoui
463c36880e clutter/pango: Rename types post merge
The rename didnt happen as part of the merge as various bits were
removed the commits after, reducing the amount of required changes

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4004>
2024-10-08 16:00:57 +00:00
Bilal Elmoussaoui
f60e9e5e0d clutter/pango: Use memory management macros
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4004>
2024-10-08 16:00:57 +00:00
Bilal Elmoussaoui
e0291b4e8f clutter/pango: Don't take a callback for dirty glyphs
As the callback had nothing to do wth the renderer

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4004>
2024-10-08 16:00:57 +00:00
Bilal Elmoussaoui
269c3723be clutter/pango: Simplify show_layout
As it is a private function now, make it take the color & target color
states
De-duplicating the setup function between ClutterText & ClutterTextNode

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4004>
2024-10-08 16:00:57 +00:00
Bilal Elmoussaoui
de7eb11ed8 clutter/pango: Remove no mipmap cache
As it is always disabled, given that nothing can change that externally, remove all of that

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4004>
2024-10-08 16:00:57 +00:00
Bilal Elmoussaoui
d75503d5f6 clutter/context: Free font map
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4004>
2024-10-08 16:00:57 +00:00
Bilal Elmoussaoui
7cae64fccd clutter/pango: Mark helpers as private
As they were public only for clutter to be able to use them
from pango. So simplify that

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4004>
2024-10-08 16:00:57 +00:00
Bilal Elmoussaoui
40dc151e82 clutter/pango: Remove FontMap type
It was created just to keep an instance of the corresponding renderer /
context
Instead, move those fields into ClutterContext.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4004>
2024-10-08 16:00:57 +00:00
Bilal Elmoussaoui
fe3192169a Merge CoglPango inside of Clutter
As that is where the whole text rendering integration happens
And would allow us to get rid of some over-abstraction in cogl-pango,
simplify
ClutterSnapshot integration as well

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4004>
2024-10-08 16:00:57 +00:00
Bilal Elmoussaoui
b6b004b437 cogl/pango: Make FontMap type private
It is an implementation detail, nothing really makes use of any of it
specific APIs

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4004>
2024-10-08 16:00:57 +00:00
Bilal Elmoussaoui
cdc43065e0 cogl/pango: Remove font map helper
It only calls into pangocairo API and only used inside clutter
so just call pangocairo API directly

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4004>
2024-10-08 16:00:57 +00:00
Marco Trevisan (Treviño)
9872512c8a clutter/actor: Use g_set_str to duplicate owned strings
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4071>
2024-10-08 15:35:44 +00:00
Marco Trevisan (Treviño)
5ef581d8bd clutter/actor: Use g_clear_pointer when possible
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4071>
2024-10-08 15:35:44 +00:00
Marco Trevisan (Treviño)
57fb071499 clutter/actor: Avoid double-checking on NULL during free
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4071>
2024-10-08 15:35:44 +00:00
Marco Trevisan (Treviño)
009ca767aa clutter/actor: Use more auto pointers
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4071>
2024-10-08 15:35:44 +00:00
Marco Trevisan (Treviño)
2aac24deac clutter/actor: Steal instead of duplicating the last token value
Instead of duplicating a string we own already we can just steal it from
the array that we're using.

This is safe since we're sure about the tokens GStrv length and we are
always stealing the last element, so there is no risk that g_strfreev
would eventually leak something.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4071>
2024-10-08 15:35:44 +00:00
Marco Trevisan (Treviño)
101126176a clutter/actor: Use autopointer for GStrv everywhere
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4071>
2024-10-08 15:35:44 +00:00
Marco Trevisan (Treviño)
1985d9ccdd clutter/actor: Avoid computing GStrv length for simple checks
No need to do a full iteration of the tokens or doing null-checks here
since g_strsplit() is not nullable, while there's no need to do a full
length check either.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4071>
2024-10-08 15:35:44 +00:00
Christian Hergert
61c722881d clutter: Classify ClutterStageWindow
Previously ClutterStageWindow was an interface with only one base
implementation (MetaStageImpl) which others inherit from.

This just makes it a class so that we can use _GET_CLASS() API instead of
the costly (by comparison) _GET_IFACE() vtable lookups.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4048>
2024-10-07 13:06:26 +00:00
Joan Torres
0ed0367d74 wayland/color-management: Add support for bt.709 TF
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4062>
2024-10-03 11:41:25 +02:00
Joan Torres
f671fea7b9 wayland/color-management: Add support for NTSC primaries
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4062>
2024-10-03 11:41:24 +02:00
Joan Torres
1d4061f21e wayland/color-management: When sending colorspace info send primaries too
clutter_primaries_to_wayland made sense when there only existed
ClutterColorspace. Now that ClutterPrimaries also exist, it makes more
sense to change that func to clutter_colorspace_to_wayland.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4062>
2024-10-03 11:40:51 +02:00
Sebastian Wick
077eb80a8d gir: Correct usage of the closure annotation
Quoting Ebassi https://www.bassi.io/articles/2023/02/20/bindable-api-2023/:

    Whenever you’re describing a function that takes a callback, you
    should always annotate the callback argument with the argument that
    contains the user data using the (closure argument) annotation

    You should not annotate the data argument with a unary (closure).

    The unary (closure) is meant to be used when annotating the callback
    type

Recently gobject-introspection became a bit more strict with this and
that generated some warnings:

    Warning: Cogl: invalid "closure" annotation: only valid on callback
    parameters

This commit fix all the closure annotations.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4058>
2024-10-01 15:39:18 +02:00
Joan Torres
36f1a38c3b clutter/color-state: Compare chromaticity with 0.0001f epsilon
This follows the precision used by the color management protocol on
primaries.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4020>
2024-10-01 10:55:02 +00:00
Joan Torres
fcbd2e3840 clutter/color-state: Add support for gamma TF
This TF can't be defined as a TransferFunction enum because it needs a
gamma_exp value too.

Add to EOTFType enum a new type: EOTF_TYPE_GAMMA.

With this new type, now EOTFs are unions that can have either
a TransferFunction enum or a gamma_exp.

Set gamma_exp as uniform.

Add the support of it in the color management protocol.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4020>
2024-10-01 10:55:02 +00:00
Joan Torres
3b53f7cb6c clutter/color-state: Drop using default colorspace and default tf
Use the defaults explicitliy, which is SRGB for both.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4020>
2024-10-01 10:55:02 +00:00
Joan Torres
eff17bf1b5 clutter/color-state: Encapsulate primaries, tf and luminance
These properties now are tagged unions:
- ClutterColorimetry:
    Can be from colorspace or primaries;
- ClutterEOTF:
    Can be from known tf or custom gamma exp (next commit);
- ClutterLuminance:
    Can be defined explicitly or derived;

Make the color management protocol use them too.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4020>
2024-10-01 10:55:02 +00:00
Joan Torres
8d9c70acda clutter/color-state: Drop GObject properties
ColorState is inmutable so the GObject properties aren't necessary.

Also move ClutterColorstate and ClutterTransferFunction enums to
color-state.h now that they are not used as GObject properties.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4020>
2024-10-01 10:55:02 +00:00
Joan Torres
dbfacc06bc clutter/color-state: Add missing endline in get_inv_eotf
Keep consistency with get_eotf.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4020>
2024-10-01 10:55:02 +00:00
Joan Torres
2a3c5db4de clutter/color-state: Use to_string funcs and drop enum_to_string
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4020>
2024-10-01 10:55:02 +00:00
Robert Mader
8e912a09d1 build: Disable asserts and cast checks in Mutter
For non-debug and non-plain cases - i.e. mainly release builds.

This ensures we use the same options in all places and draws a cleaner
distinction between g_assert() and g_return_if_fail() - the later will
still be done in release build while the former are meant for debug
only.

One advantage of doing this is that it allows us to use non-trivial
asserts more generously, such as calling `g_list_length()`.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3424>
2024-09-24 14:07:23 +00:00
Joan Torres
cd65670f7a wayland/color-management: Support arbitrary primaries
The colorspace could be defined only with known colorspace names.
Now it can be defined with arbitrary primaries too.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3948>
2024-09-23 20:33:18 +00:00
Joan Torres
a27da4e88f clutter/color-state: Create colorspace transform from primaries
Colorspace transformation matrices were hardcoded considering only known
colorspaces like bt709 or bt2020.

Now that a colorspace can be defined from its primaries, allow getting the
colorspace transformation matrix from them and drop the hardcoding.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3948>
2024-09-23 20:33:18 +00:00
Joan Torres
95c9ba514d clutter/color-state: Add ClutterPrimaries
These primaries allow defining different colorspaces apart from the
known ones.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3948>
2024-09-23 20:33:18 +00:00
Joan Torres
49c01ca6a5 clutter/color-state: Set colorspace transform matrix as uniform
This is because next commits will generate the colorspace
mapping matrix from the colorspace primaries and won't be required
to define any color space mapping matrix.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3948>
2024-09-23 20:33:18 +00:00
Christian Hergert
1247452d19 gwakeup: Reduce wake-ups to only first item in queue
We only need to wake up the other side of the GAsyncQueue if we transition
from 0 to 1 item in the queue. Otherwise, we can be certain that the other
side has received a wakeup and will eventually flush the queue.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4007>
2024-09-17 10:07:07 +00:00
Bilal Elmoussaoui
736082f41a clutter/input-pointer: Get context from seat
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3989>
2024-09-01 00:13:28 +02:00