1
0
Fork 0
Commit graph

8253 commits

Author SHA1 Message Date
Shmuel Melamud
f4c6fa949d clutter: Make clutter_actor_create_texture_paint_node public
Since StDrawingArea in gnome-shell is the only user of ClutterCanvas,
it is possible to move ClutterCanvas completely out of Mutter to
gnome-shell. This allows to remove another Cairo dependency from
Mutter.

This patch makes clutter_actor_create_texture_paint_node() function
public to be used by StDrawingArea in gnome-shell that replaces
ClutterCanvas.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3507>
2024-01-15 17:02:55 +00:00
Carlos Garnacho
bd387a6308 clutter: Drop clutter_event_new() from public headers
This is a leftover of the port to immutable events, and should
not be used.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3511>
2024-01-12 14:39:17 +00:00
Bilal Elmoussaoui
692e1f2759 docs/clutter: Drop no longer applicable examples links
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3515>
2024-01-12 11:40:20 +00:00
Carlos Garnacho
9108f2eeec clutter: Update picked actor on scroll events
On one hand this avoids crashes early after startup if the very first
pointer event is a scroll event, since the stage did not pick an actor
for the pointer device yet.

On the other hand, scroll events have some likelihood to change the
actor under the pointer even though it doesn't move. We still want to
cross towards the new actor under the pointer ASAP, without waiting
for later events.

Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/3112
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3517>
2024-01-11 14:23:25 +00:00
Bilal Elmoussaoui
8ae87ce041 clutter: Mark FixedLayout as derivable
As GNOME Shell derives this type

Fixes: 5b527ac89 ("fixed-layout: Use macros for subclassing
boilerplate")

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3509>
2024-01-10 12:55:02 +01:00
Bilal Elmoussaoui
38fd27b528 clutter: Mark BoxLayout as derivable
As it is subclassed in GNOME Shell

Fixes: 23d921080 ("box-layout: Use macros for subclassing boilerplate")
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3509>
2024-01-10 11:52:51 +01:00
Bilal Elmoussaoui
8e04168fb2 Revert "clutter: Mark BinLayout as final"
This reverts commit 2dca60bd1c.

As GNOME Shell subclass that layout manager 3 times in the JS code part

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3509>
2024-01-10 11:31:13 +01:00
Bilal Elmoussaoui
2dca60bd1c clutter: Mark BinLayout as final
It doesn't make sense to subclass a layout manager

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3387>
2024-01-10 09:37:38 +01:00
Bilal Elmoussaoui
56023e3110 cally/text: Use macros for subclassing boilerplate
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3387>
2024-01-10 09:37:38 +01:00
Bilal Elmoussaoui
cdcf32620a cally/stage: Use macros for subclassing boilerplate
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3387>
2024-01-10 09:37:38 +01:00
Bilal Elmoussaoui
22d77c9ba4 cally/root: Use macros for subclassing boilerplate
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3387>
2024-01-10 09:37:37 +01:00
Bilal Elmoussaoui
befb21cbb2 cally/clone: Use macros for subclassing boilerplate
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3387>
2024-01-10 09:37:37 +01:00
Bilal Elmoussaoui
4483d3ee96 cally/actor: Use macros for subclassing boilerplate
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3387>
2024-01-10 09:37:36 +01:00
Bilal Elmoussaoui
105c8583ee cally/util: Use macros for subclassing boilerplate
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3387>
2024-01-10 09:37:19 +01:00
Bilal Elmoussaoui
566b14e48d clutter/input-device: Move autocleanup macro
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3387>
2024-01-10 09:37:15 +01:00
Bilal Elmoussaoui
3679c82482 text: Use macros for subclassing boilerplate
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3387>
2024-01-10 09:37:13 +01:00
Bilal Elmoussaoui
9409604820 scroll-actor: Use macros for subclassing boilerplate
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3387>
2024-01-10 09:35:33 +01:00
Bilal Elmoussaoui
fbef2afb37 clone: Use macros for subclassing boilerplate
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3387>
2024-01-10 09:34:58 +01:00
Bilal Elmoussaoui
d07056992b stage: Use macros for subclassing boilerplate
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3387>
2024-01-10 09:34:24 +01:00
Bilal Elmoussaoui
62482c2ac0 clutter/actor: Move autocleanup functions
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3387>
2024-01-10 09:32:49 +01:00
Bilal Elmoussaoui
35b9d24cae actor-meta-group: Use macros for subclassing boilerplate
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3387>
2024-01-10 09:32:47 +01:00
Bilal Elmoussaoui
c40be814c1 brightness-contrast-effect: Use macros for subclassing boilerplate
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3387>
2024-01-10 09:31:54 +01:00
Bilal Elmoussaoui
5fecb069a0 desaturate-effect: Use macros for subclassing boilerplate
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3387>
2024-01-10 09:31:22 +01:00
Bilal Elmoussaoui
0c46978188 input-device-tool: Use macros for subclassing boilerplate
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3387>
2024-01-10 09:30:34 +01:00
Bilal Elmoussaoui
acb2c4b6be flatten-effect: Use macros for subclassing boilerplate
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3387>
2024-01-10 09:30:23 +01:00
Bilal Elmoussaoui
4a2f7a51e3 stage-manager: Use macros for subclassing boilerplate
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3387>
2024-01-10 09:30:21 +01:00
Bilal Elmoussaoui
4425636219 clutter: Move autoptr cleanup function defintion
So we can drop the header file

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3387>
2024-01-10 09:29:47 +01:00
Bilal Elmoussaoui
84dabd9f8b interval: Use macros for subclassing boilerplate
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3387>
2024-01-10 09:29:44 +01:00
Bilal Elmoussaoui
43d6f73714 grid-layout: Use macros for subclassing boilerplate
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3387>
2024-01-10 09:28:47 +01:00
Bilal Elmoussaoui
ba689b86ba flow-layout: Use macros for subclassing boilerplate
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3387>
2024-01-10 09:28:47 +01:00
Bilal Elmoussaoui
5b527ac89b fixed-layout: Use macros for subclassing boilerplate
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3387>
2024-01-10 09:28:40 +01:00
Bilal Elmoussaoui
23d9210806 box-layout: Use macros for subclassing boilerplate
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3387>
2024-01-10 09:28:26 +01:00
Bilal Elmoussaoui
764c3ef602 blur-effect: Use macros for subclassing boilerplate
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3387>
2024-01-10 09:28:08 +01:00
Bilal Elmoussaoui
9bd12d7e88 page-turn-effect: Use macros for subclassing boilerplate
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3387>
2024-01-10 09:27:46 +01:00
Bilal Elmoussaoui
581343dc9a deform-effect: Use macros for subclassing boilerplate
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3387>
2024-01-10 09:27:42 +01:00
Bilal Elmoussaoui
accff6b937 shader-effect: Use macros for subclassing boilerplate
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3387>
2024-01-10 09:26:20 +01:00
Bilal Elmoussaoui
7b32f06f44 colorize-effect: Use macros for subclassing boilerplate
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3387>
2024-01-10 09:25:03 +01:00
Bilal Elmoussaoui
99501482df offscreen-effect: Use macros for subclassing boilerplate
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3387>
2024-01-10 09:24:20 +01:00
Bilal Elmoussaoui
0760e90b0d keyframe-transition: Use macros for subclassing boilerplate
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3387>
2024-01-10 09:23:16 +01:00
Bilal Elmoussaoui
6e3223a0cc property-transition: Use macros for subclassing boilerplate
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3387>
2024-01-10 09:22:19 +01:00
Bilal Elmoussaoui
57fbc304f5 swipe-action: Use macros for subclassing boilerplate
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3387>
2024-01-10 09:21:14 +01:00
Bilal Elmoussaoui
1df56ca77a text-buffer: Use macros for subclassing boilerplate
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3387>
2024-01-10 09:21:05 +01:00
Bilal Elmoussaoui
a944889f49 tap-action: Use macros for subclassing boilerplate
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3387>
2024-01-10 09:20:31 +01:00
Bilal Elmoussaoui
64ad3abded rotate-action: Use macros for subclassing boilerplate
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3387>
2024-01-10 09:20:09 +01:00
Bilal Elmoussaoui
aa8ef78b17 pan-action: Use macros for subclassing boilerplate
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3387>
2024-01-10 09:20:07 +01:00
Bilal Elmoussaoui
d79f0ab9f3 snap-constraint: Use macros for subclassing boilerplate
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3387>
2024-01-10 09:19:18 +01:00
Bilal Elmoussaoui
7e7e9795fe bind-constraint: Use macros for subclassing boilerplate
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3387>
2024-01-10 09:19:14 +01:00
Bilal Elmoussaoui
1565756fea align-constraint: Use macros for subclassing boilerplate
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3387>
2024-01-10 09:19:05 +01:00
Bilal Elmoussaoui
ae23caa537 binding-pool: Use macros for subclassing boilerplate
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3387>
2024-01-10 09:18:47 +01:00
Bilal Elmoussaoui
e729e63963 settings: Use macros for subclassing boilerplate
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3387>
2024-01-10 09:18:30 +01:00
Bilal Elmoussaoui
d6b4c3a5d1 canvas: Use macros for subclassing boilerplate
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3387>
2024-01-10 09:18:27 +01:00
Bilal Elmoussaoui
e32268e181 constraint: Use macros for subclassing boilerplate
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3387>
2024-01-10 09:16:52 +01:00
Bilal Elmoussaoui
f96683a89f effect: Use macros for subclassing boilerplate
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3387>
2024-01-10 09:16:14 +01:00
Bilal Elmoussaoui
edfd489732 transition-group: Use macros for subclassing boilerplate
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3387>
2024-01-10 09:15:51 +01:00
Bilal Elmoussaoui
dc0a4c554a transition: Use macros for subclassing boilerplate
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3387>
2024-01-10 09:15:47 +01:00
Bilal Elmoussaoui
e9c1f1c642 timeline: Use macros for subclassing boilerplate
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3387>
2024-01-10 09:11:56 +01:00
Bilal Elmoussaoui
5fb78dfbad zoom-action: Use macros for subclassing boilerplate
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3387>
2024-01-10 09:11:52 +01:00
Robert Mader
5ffeb34251 build: Enable no-omit-frame-pointer for all non-plain builds
This is useful for local installations with e.g. the `release`
buildtype.
Further more, Fedora has been doing the same system wide and it
apparently was helpful in various ways, see also

Also add -mno-omit-leaf-frame-pointer, like Fedora.

https://blogs.gnome.org/chergert/2023/10/03/what-have-frame-pointers-given-us-anyway/

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3333>
2024-01-09 16:26:57 +00:00
Robert Mader
ee65ca791b build: Harmonize c_args handling
The slightly different styles in the different build files make it
harder to reason about or share c_args.

This notably ensures we never set any extra c_args for plain builds and
fixes the cc.get_supported_arguments() check in Cogl, Clutter and Mtk.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3333>
2024-01-09 16:26:57 +00:00
Bilal Elmoussaoui
aaa63c1e08 clutter: Remove no longer useful since tags
As they represent the pre-merge version of Clutter

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3489>
2024-01-09 15:23:04 +00:00
Bilal Elmoussaoui
346e9a7f2c docs: Remove remaining SECTIONs
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3489>
2024-01-09 15:23:04 +00:00
Bilal Elmoussaoui
00b4d4c4bc docs: Update more links to gi-docgen
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3489>
2024-01-09 15:23:04 +00:00
Bilal Elmoussaoui
e7a920f94d docs: Migrate remaining content to markdown
By stopping using gtk-doc annotations

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3489>
2024-01-09 15:23:04 +00:00
Bilal Elmoussaoui
fb959f3a5d clutter: Remove no longer useful gitignore
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3500>
2024-01-08 19:50:50 +01:00
Bilal Elmoussaoui
6b8c1c430e cleanup: Make clutter includes consistent
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3491>
2024-01-05 14:22:22 +01:00
Bilal Elmoussaoui
0f6df633fe cogl/pango: Drop PANGO_ENABLE_BACKEND usage
Dropped before Pango 1.46 which is the min required version
so the backward compatibility is no longer needed

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3491>
2024-01-05 14:22:22 +01:00
Bilal Elmoussaoui
9d7d25e9ee clutter/stage: Remove no longer used struct
Drops a cairo usage

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3486>
2024-01-04 14:00:26 +00:00
Daniel van Vugt
6db9a0d77e clutter/stage: Fix indentation check-code-style is complaining about
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3487>
2024-01-04 12:26:38 +00:00
Robert Mader
cb794329e7 clutter/stage-view: Remove superfluous return in void function
Fixes: 9d3e4fd402 ("clutter/stage-cogl: Use buffer age when view monitor is rotated")
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3473>
2024-01-02 13:54:38 +00:00
Joan Torres
3a94822e75 clutter/actor: Set a minimum guessed scale
When running headlessly it fails guessing the scale to -1.0f making
the assertion g_assert (guessed_scale >= 0.5) fail.

Setting it to 1.f in that case fixes it.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3464>
2023-12-22 15:44:37 +00:00
Bilal Elmoussaoui
6daa21c930 clutter: Remove unnused private functions
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3458>
2023-12-19 12:44:35 +00:00
Bilal Elmoussaoui
4d7dfb08c9 cally: Remove useless cally_actor_get_top_level_origin
Does nothing...

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3458>
2023-12-19 12:44:35 +00:00
Sebastian Keller
c86d8a23c3 clutter/actor: Don't write uninitialized out values on failed transform
clutter_actor_get_transformed_position() would write the uninitialized
values of v2 when clutter_actor_apply_transform_to_point() fails in
_clutter_actor_fully_transform_vertices() because the actor has not been
added to the stage yet.

When called from JS this would overwrite the zero initialized values
passed in from gjs. If the uninitialized values now happen to correspond
to one of the NaN float values used by mozjs to represent a pointer
type, this would lead to seemingly random crashes in mozjs code later
on.

Avoid this by using _clutter_actor_fully_transform_vertices() directly,
which allows us to check if it failed.

Related: https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/issues/469
Related: https://gitlab.gnome.org/GNOME/gjs/-/issues/591
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3453>
2023-12-15 15:08:22 +00:00
Daniel van Vugt
85f173d0d7 clutter: Pass 'radius' to public blur APIs instead of 'sigma'
Although they're in the same units, `radius` is easier to understand than
`sigma` and makes the public API independent of the blur algorithm used
behind the scenes. We now only keep the `sigma` terminology where the
implementation is Gaussian-specific.

The assumption that `sigma = radius / 2.0` is actually not new here. We
just move it from `_st_create_shadow_pipeline` (gnome-shell!1905) into
`clutter_blur_new`.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1908>
2023-12-14 18:12:55 +00:00
Bilal Elmoussaoui
90cff013a5 clutter: Remove unused enums
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3437>
2023-12-13 11:20:04 +00:00
Bilal Elmoussaoui
580d62b9b6 clutter: Remove unused Path related types
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3437>
2023-12-13 11:20:04 +00:00
Bilal Elmoussaoui
893e6e49b1 clutter: Drop unused private functions/defines
The commit also stops defining certain functions in a private header
when they are only used in the same file.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3437>
2023-12-13 11:20:04 +00:00
Bilal Elmoussaoui
4b7a29377b clutter: Drop remaining params nick/blurbs
Also the i18n macros from clutter as they are no longer used

Leftover from https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3101

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3437>
2023-12-13 11:20:04 +00:00
Bilal Elmoussaoui
3f09a86e7a clutter: Drop CLUTTER_PARAM_* defines
They are not used every where making the codebase very incosistent
So just drop the current usages

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3437>
2023-12-13 11:20:04 +00:00
Florian Müllner
5291be8f30 clutter/actor: Allow specifying the layout manager for an actor type
Some actors have a well-defined layout manager other than FixedLayout.

If they do, we can handle the layout manager creation at the
ClutterActor instantiation, like GTK does for widget layout managers.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3445>
2023-12-07 18:02:11 +00:00
Ivan Molodetskikh
e63a5369d0 clutter/frame-clock: Add output name to span descriptions
Lets you tell spans for multiple monitors apart in profilers.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3417>
2023-12-06 16:12:58 +00:00
Ivan Molodetskikh
77413ed9a0 clutter/frame-clock: Store output name
Will be used in a subsequent commit for including the output name in
COGL_TRACE plot names.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3417>
2023-12-06 16:12:58 +00:00
Ivan Molodetskikh
39e3415912 clutter/actor: Adjust trace actor name for better filtering
Tracy can filter its statistics by user text, in our case by span
description. It's useful to filter by actor type and name, and not so
much by the pointer. So, remove it, and also reduce the amount of
punctuation.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3417>
2023-12-06 16:12:58 +00:00
Ivan Molodetskikh
b0691d581a clutter/stage: Add trace span to paint_to_framebuffer
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3417>
2023-12-06 16:12:58 +00:00
Ivan Molodetskikh
58ee1dfdc8 clutter/stage-view: Add trace span to before_swap
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3417>
2023-12-06 16:12:58 +00:00
Ivan Molodetskikh
72bbb1416e clutter/timeline: Add trace spans
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3417>
2023-12-06 16:12:57 +00:00
Ivan Molodetskikh
ce836e37e8 clutter: Add trace spans to event handling
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3417>
2023-12-06 16:12:57 +00:00
Sebastian Keller
dfe4d218f1 clutter/actor: Make get_transformed_paint_volume() transfer full
Transfer none was achieved using a stack GArray in the stage which
would get resized to 0 at the end of every frame to "free" it.
In the case of direct scanout however, painting the next frame only
happens after leaving fullscreen again. Until then the array just kept
growing and because GArrays don't reallocate when shrunk, this memory
remained allocated even after leaving fullscreen.

There is no cache benefit from storing paint volumes this way, because
nothing accesses them after their immediate use in the calling code.
Also the reduced overhead from avoiding malloc calls seems negligible as
according to heaptrack this only makes up about 2-3% of the temporary
allocations.

Changing this to transfer full and removing the stack array simplifies
the code and fixes the "leak".

Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/3191
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3442>
2023-12-06 14:07:39 +00:00
Jonas Ådahl
ae3a20a0a0 clutter/paint-nodes: Use g_clear_object() in a few places
It's possible now that they are GObject's.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3443>
2023-12-06 13:45:03 +00:00
Jonas Ådahl
7152779ae0 clutter/stage-view: Remove unused double buffered shadow fb
It was for a failed expriment that tried to mmap() dmabuf memory and
find damaged regions to decrease the amount that was eventually used to
write to an onscreen, but mmap:ing is only fast enough on intel, and
it's only relevant on various server GPUs. For it to be achievable, we
need to render to system memory in a way that we don't need to copy it
out of OpenGL, but that's currently not possible.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3443>
2023-12-06 13:45:03 +00:00
Jonas Ådahl
d8ff97ebf6 clutter/stage-view: Pass around view when creating shadow fb
Instead of passing around the CoglContext, pass around the view, which
can be used to fetch the CoglContext. We'll use it for more stuff later.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3443>
2023-12-06 13:45:03 +00:00
Jonas Ådahl
b282097834 clutter/stage-view: Rename offscreen pipeline vfunc
It doesn't really "set it up", it just sets the transform according to
the renderer view state. We'll do more setup outside, so lets rename it.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3443>
2023-12-06 13:45:03 +00:00
Jonas Ådahl
008f2642ca clutter/enums: Add trailing comma in colorspace enum
Would make it easier would we add more colorspaces later on.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3443>
2023-12-06 13:45:03 +00:00
Sebastian Wick
0f1c5223ff clutter: Add ClutterContext to clutter-types.h
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3443>
2023-12-06 13:45:03 +00:00
Jonas Ådahl
501d19656e context: Make ClutterContext a GObject and move to separate file
This is a step in cleaning up the Clutter context management. By making
it a GObject it's easier to add e.g. properties and features that helps
with introspection.

For now, this means the context creation is changed to go via a
"constructor" (clutter_create_context()). This is so that the global
context singleton can be mantained outsid of ClutterContext, until it
can be removed.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2016>
2023-12-05 14:39:25 +00:00
Jonas Ådahl
d96e458d93 clutter: Remove unused sync-to-vblank setter
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2016>
2023-12-05 14:39:25 +00:00
Jonas Ådahl
1209320cd2 clutter/context: Remove left-over locking declarations
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2016>
2023-12-05 14:39:25 +00:00
Jonas Ådahl
f14b5da387 clutter/backend: Remove 'finish_init()' vfunc
The original purpose of being able to report errors is no longer
relevant, since the Clutter backend is now practically a thin wrapper
around the actual backend, which has already dealt with error reporting.
Thus move this to the regular constructor path.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2016>
2023-12-05 14:39:25 +00:00
Jonas Ådahl
579532f644 clutter: Rename ClutterMainContext to ClutterContext
The intention for ClutterContext is to be more or less the MetaContext
or CoglContext equivalent. Lets rename the type so that it becomes more
consistent with the other similar types.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2016>
2023-12-05 14:39:25 +00:00
Ivan Molodetskikh
edbc9a2086 clutter/pick-stack: Add an allocation check to calculate_clear_area ()
We might pick an actor that needs relayout. I've seen this happen inside
hiding / unmapping in particular. In this case, calculate_clear_area ()
will call clutter_actor_get_abs_allocation_vertices () which in turn
will force a relayout. However, this is not what we want, because:

1. We don't want to run layout during picking.
2. If the actor needs an allocation, then the pick stack could not have
   used an up-to-date allocation, because it is not computed. Therefore
   this clear area would use a potentially completely different
   allocation than the one stored in the pick stack.

Thankfully, clear area seems to be used as a cache/optimization, so
let's just avoid computing it if the actor is not allocated.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3425>
2023-12-01 15:36:32 +00:00