1
0
Fork 0
Commit graph

8420 commits

Author SHA1 Message Date
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
Bilal Elmoussaoui
0c03a6b676 clutter/seat: Keep a pointer to the context
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3989>
2024-09-01 00:13:28 +02:00
Bilal Elmoussaoui
3c1d2d765b clutter/offscreen-effect: Pass a CoglContext to create_texture
As creating a texture requires one anyways

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3989>
2024-09-01 00:13:28 +02:00
Bilal Elmoussaoui
a80360ad38 clutter/stage: Remove unused title property
It was used for the titlebar title, which is no longer relavant
in current Clutter

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3989>
2024-09-01 00:13:28 +02:00
Bilal Elmoussaoui
2dc2ab94d3 clutter/backend: Remove unused vfuncs
The signals are still used by Actor/Text

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3989>
2024-09-01 00:13:28 +02:00
Sebastian Wick
86a0797819 clutter/color-state: Match reference luminance
This uses the luminance levels of the color states to anchor the white
of content instead of hard-coding the levels.

This also starts using uniforms for parts of the mapping which means we
don't have to generate and compile a shader when the luminance levels
change.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3953>
2024-08-30 20:03:43 +00:00
Sebastian Wick
03aad0d99e clutter/color-state: Add min/max/ref luminances
They represent the minimum and maximum luminance levels of the primary
color volume and the reference luminance level (reference white, SDR
white, ...) in the reference viewing environment.

They help anchoring the white level, optionally help with preserving the
dynamic range and help with adjusting from a "dark" to a "bright"
viewing environment.

The values have defaults which depend on the transfer characteristics.

This reflects the wayland color management protocol.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3953>
2024-08-30 20:03:43 +00:00
Carlos Garnacho
fe9fff2729 clutter: Make detached actions let events through
Actions might get detached sometime during event processing,
at a time that the stage did already prepare an emission chain
holding references to the actions and actors that need to handle
events. This means actions might become detached, but still handle
the incoming event, or possible crossing events generated in-place
when the actor becomes unparented.

Avoid this situation, by skipping event handling on actions that
went detached, we will just instruct to continue event processing.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3988>
2024-08-30 17:24:24 +00:00
Bilal Elmoussaoui
d584a512cb clutter/stage: Get Context from actor state
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3977>
2024-08-29 15:26:40 +02:00
Bilal Elmoussaoui
b3da64c20e clutter/pick-context: Get CoglContext from actor context
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3977>
2024-08-29 15:26:40 +02:00
Bilal Elmoussaoui
617a3aa58b clutter/actor: Get Backend from associated actor context
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3977>
2024-08-29 15:26:40 +02:00
Bilal Elmoussaoui
370e7d3157 clutter/text: Get Backend from associated actor context
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3977>
2024-08-29 15:26:40 +02:00
Bilal Elmoussaoui
3152b4a3f1 clutter/stage: Get Backend & Context from the associated actor
Had to move the state construction from init to constructed, to ensure
that the Actor's constructor has been executed and Actor.get_context
won't return NULL

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3977>
2024-08-29 15:26:40 +02:00
Bilal Elmoussaoui
62da8d7aac clutter: Get CoglContext from a CoglTexture where possible
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3977>
2024-08-29 15:26:40 +02:00
Bilal Elmoussaoui
75c7ced752 clutter/text: Get CoglContext from the actor's associated Backend
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3977>
2024-08-29 15:26:39 +02:00
Bilal Elmoussaoui
bc633280d9 clutter/stage: Get Backend from stage's associated context
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3977>
2024-08-29 15:26:39 +02:00
Bilal Elmoussaoui
1abbfb5ed2 clutter/context: Create a Settings when constructed
Instead of removing Settings.get_default, we mark it as deprecated
as a lot of extensions seems to use it

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3977>
2024-08-29 15:26:39 +02:00
Bilal Elmoussaoui
8013049130 clutter: Stop using Settings.get_default
Instead, get it from the context. See next commit
For ClutterText, we had to switch to using constructed
as the ClutterContext will be set for the ClutterActor in the
constructor phase

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3977>
2024-08-29 15:26:39 +02:00
Bilal Elmoussaoui
8a71c89442 clutter/backend: Keep a back pointer to the Context
Will be useful in the upcoming commits

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3977>
2024-08-29 15:26:39 +02:00
Bilal Elmoussaoui
b02a29fee7 clutter/context: Add API to get the corresponding Settings
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3977>
2024-08-29 15:26:39 +02:00
Michel Dänzer
c2621eca15 onscreen/native: Set latest cogl sync_fd on KMS update
See previous commit log on the effects of this.

This means the deadline evasion needs to be added in both cases in
clutter_frame_clock_notify_presented.

v2:
* Use meta_kms_update_set_sync_fd. (Jonas Ådahl)

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3958>
2024-08-28 14:42:38 +00:00
Bilal Elmoussaoui
70dc8cabac clutter/settings: Remove unused fontconfig-timestamp property
As a writable property, nothing sets it in both Mutter/GNOME Shell
making it a dead-code. As we will be moving pango related bits to
gnome-shell, remove this one already

Removes pango-ft2 dependency

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3969>
2024-08-22 19:09:51 +00:00
Bilal Elmoussaoui
60edafe3eb cogl/pango: Drop mipmapping API/env variables
As GNOME Shell always sets that to FALSE anyways
This does not drop the separate caching whether the mipmapping is
disabled or not, in case shell wants to make use of that in the future

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3962>
2024-08-22 16:45:01 +00:00
Bilal Elmoussaoui
4f606261d3 clutter: Remove unused get_font_map
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3962>
2024-08-22 16:45:01 +00:00
Bilal Elmoussaoui
39da6e10fa clutter/context: Move get_show_fps to it correct namespace
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3962>
2024-08-22 16:45:01 +00:00