1
0
Fork 0
Commit graph

8338 commits

Author SHA1 Message Date
Bilal Elmoussaoui
02c6473175 clutter: Rename CallyClone to CloneAccessible
Moving it to the correct namespace and marking as final

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3917>
2024-08-07 22:46:16 +00:00
Bilal Elmoussaoui
7c5223dfc7 clutter: Rename CallyUtil to ClutterAccessibility
As nothing is supposed to use it oustide of Clutter, make
it private and final

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3917>
2024-08-07 22:46:16 +00:00
Bilal Elmoussaoui
e2e93353d9 clutter: Rename CallyActor to ActorAccessible
Moving it to the correct namespace

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3917>
2024-08-07 22:46:16 +00:00
Bilal Elmoussaoui
43f24b03e5 cally: Merge inside Clutter
Only do the build system bits, we would have to rename
the types and expose at least CallyActor as ClutterActorAccessible

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3917>
2024-08-07 22:46:16 +00:00
Bilal Elmoussaoui
1393140d41 cally: Move init utils to Clutter
The clutter API was calling the cally one anyways

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3917>
2024-08-07 22:46:16 +00:00
Bilal Elmoussaoui
8301272b8e clutter/actor: Add a get_accessible_type vfunc
Allows to avoid using the factories which simplifies the whole thing
and allows external type to create their own accessible types.

Copied from StWidget

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3917>
2024-08-07 22:46:16 +00:00
Bilal Elmoussaoui
1e387e9117 clutter/actor: Cache the accessible object
Helpful for merging Cally inside Clutter, see next commits

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3917>
2024-08-07 22:46:16 +00:00
Bilal Elmoussaoui
d4c73c8341 clutter/stage-manager: Emit accessibility events
Instead of making CallyRoot do that and have to duplicate the list
of stages internally...

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3917>
2024-08-07 22:46:16 +00:00
Bilal Elmoussaoui
135cd40928 clutter/stage: Emit accessibility focus state change
Allows us to get rid of CallyStage trying to track what is already
tracked in ClutterStage and simplify the whole thing

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3917>
2024-08-07 22:46:16 +00:00
Bilal Elmoussaoui
7571ae6f05 clutter/stage: Track is_active
Instead of doing that in both MetaStage & CallyStage.
This allows ClutterStage to also emits the relavant acessibility
bits directly without having a roundtrip through Cally

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3917>
2024-08-07 22:46:16 +00:00
Bilal Elmoussaoui
fb02197b4f cally/actor: Remove no longer useful notify_clutter vfunc
As ClutterText is the only one using that, so move the notify call there

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3917>
2024-08-07 22:46:16 +00:00
Bilal Elmoussaoui
d8fbaf4533 clutter/text: Emit accessibility state changes
Not everything can be easily moved, so only parts of it is done for now

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3917>
2024-08-07 22:46:16 +00:00
Bilal Elmoussaoui
e6a394ca10 clutter/actor: Emit accessibility states changes directly
Instead of making CallyActor listen to notify, adding an extra overhead
Helps with merging Cally inside of Clutter

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3917>
2024-08-07 22:46:16 +00:00
Bilal Elmoussaoui
288ad7206b clutter/actor: Make ActorFlags internal
And only expose a getter/setter for NO_LAYOUT flag
This reduces the possible ways users of the Actor API
can affect the internals and would make next commit
simpler

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3917>
2024-08-07 22:46:16 +00:00
Bilal Elmoussaoui
da2e931355 clutter/backend: Remove get_display vfunc
As there is no separate implementations anymore

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3915>
2024-08-05 15:47:29 +00:00
Bilal Elmoussaoui
b684dc0382 clutter/backend: Provide a default get_display implementation
As there is no on screen template checks done on the x11 backend implementation
so simplify that.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3915>
2024-08-05 15:47:29 +00:00
Bilal Elmoussaoui
5277e33d37 cogl: Remove no longer used OnscreenTemplate
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3915>
2024-08-05 15:47:29 +00:00
Bilal Elmoussaoui
b07c772fc8 cogl: Rename Shader/Program constructors
Otherwise they end up as global functions instead of constructors
of their corresponding types. Helps with better docs

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3910>
2024-08-01 11:06:33 +00:00
Bilal Elmoussaoui
e90d2e845e cogl/glib-source: Remove no longer useful API
It was only useful when Cogl was a separate library

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3910>
2024-08-01 11:06:33 +00:00
Bilal Elmoussaoui
0f405e9270 Rename remaining usages of material to pipeline
material is almost no longer used in the code base and the
few remaining references makes it confusing when looking at parts
of the codebase. So rename the rest as well.

Note that this renames a DeformEffect property and the only extension
making use of it doesn't use the property so i think it is okay to do
so without deprecating the old property for a few releases

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3910>
2024-08-01 11:06:33 +00:00
Bilal Elmoussaoui
5f1ffb5304 cogl: Remove unused Primitive APIs
This also removes a clutter interactive test, but as those
tests don't serve that much any more for being no longer executed..

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3910>
2024-08-01 11:06:33 +00:00
Sebastian Wick
a71166618d clutter/color-state: Create blending ColorState from ColorState
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3905>
2024-07-31 23:36:13 +00:00
Sebastian Wick
6a8701c4db clutter/color-state: Optimize equality by checking pointer equality
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3905>
2024-07-31 23:36:13 +00:00
Sebastian Wick
2693cac83a clutter/color-manager: Add a method to get the default color state
This avoids re-creating new color states objects to the default state.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3897>
2024-07-24 21:33:30 +00:00
Sebastian Wick
b1370a483e clutter/color-state: Add a way to query if fp16 is needed for storage
Some color states, currently only the ones with linear transfer
characteristics, need at least half float formats for storing components
of that color state.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3897>
2024-07-24 21:33:30 +00:00
Sebastian Wick
6a2ce066b0 clutter/color-state: Add a helper to print the color state
And use it in MetaRendererNative.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3897>
2024-07-24 21:33:30 +00:00
Sebastian Wick
58cb44186d clutter/color-state: Adds an ID to ColorStates
The ID is required for the wayland protocol. In the future we might want
to spend a bit more effort to re-use existing color states when a new
one is requested and also try to re-use IDs instead of just counting up.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3897>
2024-07-24 21:33:30 +00:00
Sebastian Wick
75baecb3d9 clutter/pipeline-cache: Unify color state transform key hashing
This us re-using the hashing of color state transforms which is used for
the snippet cache.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3897>
2024-07-24 21:33:30 +00:00
Jonas Ådahl
1223f8df68 clutter/pipeline-cache: Return a copy of the pipeline
This means the pipeline can be manipulated after retrieving. This also
fixes a leak when adding pipelines to the cache, as we the pipeline
would take a ref, but when adding, we wouldn't clean up our own ref.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3897>
2024-07-24 21:33:30 +00:00
Jonas Ådahl
3359b67686 clutter/color-state: Handle adding snippet to pipeline
While no functional changes right now, this allows us to add extra hooks
like adding uniforms.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3897>
2024-07-24 21:33:30 +00:00
Jonas Ådahl
045f114fbe clutter/color-state: Move snippet cache to color manager
This gets rid of the GQuark and g_object_get_qdata() lookups.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3897>
2024-07-24 21:33:30 +00:00
Jonas Ådahl
cd2bf776b1 clutter: Add color manager type
This type is intended to carry color related state that is "global",
without having to add more and more things to ClutterContext.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3897>
2024-07-24 21:33:30 +00:00
Daniel van Vugt
55209cfb13 clutter/deform-effect: Hide G_STATIC_ASSERT from the g-ir-scanner
According to gmacros.h, G_STATIC_ASSERT is undefined for __GI_SCANNER__
because it causes confusion. Which is understandable, and so is the
complaint about the lingering G_STATIC_ASSERT after preprocessing.

This problem seems to be unique to just clutter-deform-effect.h because
it's the only header file containing a top-level G_STATIC_ASSERT. The
rest are all in C files.

Fixes: 138e5d4f54
Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/3591
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3898>
2024-07-23 14:08:52 +08:00
Bilal Elmoussaoui
138e5d4f54 cogl: Move TextureVertex to Clutter
The type is only used in ClutterDeformEffect, so move it there

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3895>
2024-07-22 17:36:10 +02:00
Bilal Elmoussaoui
f5c376e860 cogl: Move PrimitiveTexture functions to Texture
Since the move to GObject for CoglTexture, CoglPrimitiveTexture was
removed. So drop remaining of that.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3885>
2024-07-15 21:42:38 +02:00
Sebastian Keller
2ae3012fd5 clutter/paint-nodes: Don't leak CoglColor on paint node creation
The pointer returned by cogl_color_copy() was not stored anywhere and
the allocation it was pointing to got leaked. However we also don't need
to use that function here and can just copy the struct values directly.

Fixes: dc52ccc75 ("cleanup: Port from ClutterColor to CoglColor")
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3884>
2024-07-15 18:50:02 +02:00
Bilal Elmoussaoui
54748b7f1f cogl: Call init when creating a context from Clutter
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3857>
2024-07-15 14:39:23 +00:00
Bilal Elmoussaoui
24f46448ce cogl/pango: Take a context as a param when constructing a font map
Avoids using the get_context macro

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3857>
2024-07-15 14:39:23 +00:00
Jonas Ådahl
2a6e8f7188 clutter/stage-view: Add API to get output color state
Will be used for direct transforms from source to output color state.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3433>
2024-07-09 18:56:07 +02:00
Jonas Ådahl
20c7653d49 compositor-view/native: Don't scan out surface with color state mismatch
If the color state of a surface doesn't match the output, don't try to
scan it out, as it needs to pass through color state transformations to
look correct.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3433>
2024-07-09 18:56:07 +02:00
Jonas Ådahl
6b07141f1a clutter/paint-nodes: Make paint nodes handle color transformations
Either handle them directly, or when using the pipeline paint node, add
them on-demand if the color transformation capability isn't already set
by something else.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3433>
2024-07-09 18:56:07 +02:00
Jonas Ådahl
9b34aac441 clutter/text: Handle color state transformations
This uses the color state tracking in the paint context to add color
state transformations to the ClutterText actor.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3433>
2024-07-09 18:56:07 +02:00
Jonas Ådahl
2d48ca8aa1 clutter/paint-nodes: Copy instead of ref passed pipelines
A ClutterPipelineNode took a reference to the passed pipeline and used
it during the lifetime of the paint node. In theory this meant that a
paint node pipeline could be changed, and reused, affecting the previous
paint node drawing.

Referencing instead of copying also meant the ClutterPipelineNode isn't
able to itself manipulate the pipeline any further.

Fix both of these issues by copying, instead of adding a reference to,
the passed pipeline. While resulting in some additional allocation
over head, it means we can now eventually handle color transformations
automatically for ClutterPipelineNode's.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3433>
2024-07-09 18:56:07 +02:00
Jonas Ådahl
a1163385db paint-nodes: Sanity check color transform in blit nodes
Blitting cannot run with a shader, thus cannot do color state
transformations, so log a warning when that happens.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3433>
2024-07-09 18:56:07 +02:00
Jonas Ådahl
9a0fbbfa81 cogl/pango: Add argument to supply extra snippet
This will be applied to the pipeline used for drawing, and can be used
to include color state transformation snippets.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3433>
2024-07-09 18:56:07 +02:00
Jonas Ådahl
aaba08e5aa Set names of various Cogl pipelines
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3433>
2024-07-09 18:56:07 +02:00
Jonas Ådahl
0c653b4cf2 clutter/actor: Pass paint context in paint_node()
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3433>
2024-07-09 18:56:07 +02:00
Jonas Ådahl
15df584b7e clutter: Add color state pipeline capability enum
So far 'color-state' is added, intended to tag pipelines with color
state transformation capabilities. Color state transformation snippets
are tagged with it. Eventually handlers of pipelines will use this
information to on-demand decorate pipelines with color transformation
snippets.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3433>
2024-07-09 18:56:07 +02:00
Jonas Ådahl
4238512764 clutter: Introduce color transform aware pipeline cache
Color aware rendering needs shaders / pipelines that adapt to what
output they render to. For example if we want to render to a linear
BT.2020 intermediate framebuffer on one monitor, and a non-linear sRGB
direct target buffer on another, the shader for the same paint node or
content will depend on where they are going to be presented.

In order to help keeping track of what shader should target what
monitor, without having to regenerate them each time, introduce a
pipeline cache that knows how to handle differentiating between
transforming between different color state.

The cache is meant to handle caches for multiple pipeline users, where
each user might potentially want to keep track of multiple pipelines
itself. Lookup should be O(1), and in order to achieve this, separate
the cache into 3 levels.

The first level is the "pipeline group", where e.g. a ClutterContent
type allocates a group where it can store its pipelines. Each group has
a fixed number of "slots" where it can store a pipeline. Each slot has a
hash table where the key is derived from a color state transform, and
where the value is a CoglPipeline where the thame color state
transformation is expected to be handled.

A content will when painting know about its own color state, and the
target state it should render into, retrieve a cached pipeline for the
correct transform, or if the cache didn't have it, generate it.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3433>
2024-07-09 18:56:06 +02:00
Jonas Ådahl
0c2fa8e9a8 clutter/stage-view: Add linear intermediate color space buffer
Allow compositing in a linear color space and do so either when forcing
it via the debug controls D-Bus API, or when the experimental HDR mode
is enabled.

This relies on paint nodes etc to actually transform everything into the
linear target color space, which isn't done yet, so enabling it right
now will cause a broken result. Yet, introduce this now, so that
painting can be fixed piece by piece.

Linear blending is automatically enabled on monitors where HDR is
enabled, as this makes it possible to use an linear color space when
blending content from different color spaces with different transfer
functions.

Linear blending requires extra precision, i.e. 16 bit per channel
in the intermediate buffer due how the values are distributed,
so only enable the experimental HDR mode if the Cogl context supports
half float formats.

By default, no intermadiate linear offscreen framebuffer is used.

To test, do e.g.

  ./tools/debug-control.py --toggle ForceLinearBlending

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3433>
2024-07-09 18:55:54 +02:00