Commit Graph

6938 Commits

Author SHA1 Message Date
Marco Trevisan (Treviño)
f133de2dd4 clutter/actor: Unref the root node if set as child
When setting the root node as child of a clip or transform node, we add a
new reference to it, without removing the one that we've previously added
when getting it from the actor node (and that won't ever be unset by the
auto-pointer since the root_node is re-associated).

So, once we add the root node as child and re-define it, unref it.

Fixes https://gitlab.gnome.org/GNOME/mutter/issues/908
2019-11-04 12:07:43 +00:00
Olivier Fourdan
db90c0d509 clutter/stage-view: Separate offscreen and shadowfb
Previously, we would use a single offscreen framebuffer for both
transformations and when a shadow framebuffer should be used, but that
can be dreadfully slow when using software rendering with a discrete GPU
due to bandwidth limitations.

Keep the offscreen framebuffer for transformations only and add another
intermediate shadow framebuffer used as a copy of the onscreen
framebuffer.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/877
2019-11-04 10:44:42 +01:00
Carlos Garnacho
1688cf7c44 clutter: Drop the no-clear stage hint
A compositor is notably opaque (usually has nothing to be painted on!).
gnome-shell sets this hint, but there's no reason why we wouldn't want
it by default.

Also, the color buffer being cleared messes with stencil clips, as the
clear operation by definition ignores the stencil buffer. We want to
use these more extensively in the future, so just drop this API.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/911
2019-11-01 15:02:09 +00:00
Carlos Garnacho
6bfa61a3a7 Revert "clutter/cogl: Store empty clip regions for buffer age"
This reverts commit 4918893326.

This commit prevented cogl_stage_cogl_redraw_view() from skipping
swap buffers entirely if the invalidation region ended up empty.
This meant we were actually swapping buffers when we didn't need to.

The source of the glitches was fixed more properly, so this just adds
extra work.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/898
2019-10-30 17:17:29 +00:00
Carlos Garnacho
cf89e4d2cd clutter/cogl: Fix invalidation on non-primary monitors with no buffer age
We passed the view rectangle, we however want a fb-scaled rectangle starting
at 0,0. Fixes invalidation on other than the primary monitor when those
paths are hit.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/898
2019-10-30 17:17:29 +00:00
Robert Mader
9678fd5306 clutter/cogl: Scale clip region in paint_stage()
To simplify the code and because it was forgotten once in a7f4f5b291,
breaking clipped redraws of clipped views.

Also sneak in a very small cleanup.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/889
2019-10-28 18:18:34 +01:00
Georges Basile Stavracas Neto
563e7139b6 Allow changing Clutter debug flags at runtime
This way, we can simply pop up the Looking Glass and run:

 >>> Meta.add_clutter_debug_flags(Clutter.DebugFlag.PICK, 0, 0)

And measure specific actions or events on GNOME Shell.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/862
2019-10-25 19:12:34 +00:00
Carlos Garnacho
2e9faaf67a clutter/cogl: Ensure to paint full view if there's no buffer age support
This was falling back to painting an empty area, which is not what we want.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/888
2019-10-25 15:03:24 +00:00
Carlos Garnacho
4918893326 clutter/cogl: Store empty clip regions for buffer age
As we do not prevent the SwapBuffers call from happening, those also
do count. Results in clip area calculations to be right for monitors
that previously did not get invalidated.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/888
2019-10-25 15:03:24 +00:00
Adam Jackson
acc7b83322 cogl: Remove the stub winsys
It's not useful and supporting it leaks into the API in other weird
ways.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/885
2019-10-24 16:52:49 -04:00
Adam Jackson
a60457c2d8 clutter: Remove behaviours
https://gitlab.gnome.org/GNOME/mutter/merge_requests/879
2019-10-22 19:01:17 +00:00
Adam Jackson
33d1bae03f clutter: Remove deprecated/clutter-behaviour-scale.c
https://gitlab.gnome.org/GNOME/mutter/merge_requests/879
2019-10-22 19:01:17 +00:00
Adam Jackson
013b336690 clutter: Remove unused deprecated/clutter-behaviour-depth.c
https://gitlab.gnome.org/GNOME/mutter/merge_requests/879
2019-10-22 19:01:17 +00:00
Adam Jackson
68fca552d7 clutter: Remove unused deprecated/clutter-behaviour-opacity.c
https://gitlab.gnome.org/GNOME/mutter/merge_requests/879
2019-10-22 19:01:17 +00:00
Georges Basile Stavracas Neto
cd2ee44216 clutter/actor: Always paint using paint nodes
Make ClutterActor paint using ClutterTransformNode, ClutterClip
node, and ClutterActorNode. Essencially, the actor node is a
replacement for clutter_actor_continue_paint().

An interesting aspect of this commit is that the order of the
operations is reversed to be preserved.

Before being able to remove the dummy node hack, we'll need to
make ClutterEffects compatible with paint nodes first -- and
naturally, that's enough content for its own merge request.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/872
2019-10-22 14:53:48 -03:00
Georges Basile Stavracas Neto
ebf9ac091d clutter/paint-nodes: Introduce ClutterActorNode
ClutterActorNode is a paint node that runs the 'paint'
function of an actor. It is a useful helper node to be
used during the transition to paint nodes.

The role of ClutterActorNode will change over time. For
now, it is just a call to clutter_actor_continue_paint(),
which also paints the effects. When ClutterEffect is
ported to paint nodes, ClutterActorNode will morph to
only notify the actor about the painting, and will become
a private node to Clutter.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/872
2019-10-22 14:47:37 -03:00
Georges Basile Stavracas Neto
cf791c09f0 clutter/paint-nodes: Expose and cleanup ClutterTransformNode
It will also be used by ClutterActor to apply it's own transform
to the paint node tree, and thus preserve it's rendering area.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/872
2019-10-22 14:47:37 -03:00
Georges Basile Stavracas Neto
1d8807a171 clutter/paint-nodes: Expose ClutterLayerNode
It will be useful to port ClutterOffscreenEffect in
the future.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/872
2019-10-22 14:47:37 -03:00
Adam Jackson
f18e2d2e62 clutter: Remove unused clutter-layout-manager-deprecated.c
https://gitlab.gnome.org/GNOME/mutter/merge_requests/878
2019-10-22 11:57:55 -04:00
Robert Mader
3078394951 ClutterStage: Use clutter_region_t for swap_region
We use `clutter_region_t` for the clip now, so lets also use it
for the swap region.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/692
2019-10-22 00:28:47 +02:00
Carlos Garnacho
a7f4f5b291 ClutterStage: Store clip area as a region
This will allow drawing optimizations as a region is more concrete
than the bounding rectangle.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/692
2019-10-22 00:28:47 +02:00
Adam Jackson
bd1630a12c cogl: Remove unused CoglFeatureFlags
https://gitlab.gnome.org/GNOME/mutter/merge_requests/866
2019-10-21 21:43:08 +00:00
Adam Jackson
ba7b8a5de3 cogl: Remove unused COGL_FEATURE_TEXTURE_YUV
https://gitlab.gnome.org/GNOME/mutter/merge_requests/866
2019-10-21 21:43:08 +00:00
Adam Jackson
d54c548aac clutter: Remove unused deprecated clutter_texture_set_from_yuv_data
https://gitlab.gnome.org/GNOME/mutter/merge_requests/866
2019-10-21 21:43:08 +00:00
Adam Jackson
5e0989532e clutter: Remove unused CLUTTER_FEATURE_TEXTURE_READ_PIXELS
https://gitlab.gnome.org/GNOME/mutter/merge_requests/866
2019-10-21 21:43:08 +00:00
Adam Jackson
cf107c89b8 cogl: Remove always-set COGL_FEATURE_OFFSCREEN
https://gitlab.gnome.org/GNOME/mutter/merge_requests/866
2019-10-21 21:43:08 +00:00
Georges Basile Stavracas Neto
05da4a6094 clutter/effect: Remove pick flags
As pointed out, they are now unused. Remove
the pick flags.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/865
2019-10-21 13:49:26 +00:00
Georges Basile Stavracas Neto
db8fcc0537 clutter/actor: Remove pick code from paint
Now that they are properly split, remove the pick
code from paint paths.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/865
2019-10-21 13:49:26 +00:00
Georges Basile Stavracas Neto
86a5358812 clutter/stage: Pick with clutter_actor_pick()
Use the new function to perform picking.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/865
2019-10-21 13:49:26 +00:00
Georges Basile Stavracas Neto
ff8ed70f84 clutter/stage: Refactor view setup code
We'll share it between pick and paint, so refactor
the framebuffer and view setup code from paint
into a new function.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/865
2019-10-21 13:49:26 +00:00
Georges Basile Stavracas Neto
179d5ba6a6 clutter: Split pick and paint
Add the corresponding clutter_actor_pick() and
clutter_actor_continue_pick() as public APIs,
and use them in pick overrides and ClutterEffect.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/865
2019-10-21 13:49:26 +00:00
Daniel van Vugt
e82a657cd9 clutter/actor: Remove color from the pick virtual function
It's unused since commit 14c706e51.

**ABI break**

https://gitlab.gnome.org/GNOME/mutter/merge_requests/851
2019-10-16 12:01:16 +00:00
Daniel van Vugt
8c89ea5f0a clutter/stage: Do picking with float coordinates
Previously picking was done on an int (x,y) to address a particular pixel.
While `int` was the minimum precision required, it was also an unnecessary
type conversion.

The callers (input events mainly) all provide float coordinates and the
internal picking calculations also have always used floats. So it was
inconsistent and unnecessary to drop to integer precision in between those.

ABI break: This changes the parameter types for public function
`clutter_stage_get_actor_at_pos`, but its documentation is already
sufficiently vague to not need changing.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/844
2019-10-16 11:52:04 +00:00
Georges Basile Stavracas Neto
bdf5e3f357 Replace ClutterGeometry by graphene_rect_t
The last of the replacements. It is fine for now
to replace ClutterGeometry's integers by floats.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/458
2019-10-16 11:38:14 +00:00
Georges Basile Stavracas Neto
94682e69aa Replace ClutterRect by graphene_rect_t
https://gitlab.gnome.org/GNOME/mutter/merge_requests/458
2019-10-16 11:38:14 +00:00
Georges Basile Stavracas Neto
160cc9182d Replace ClutterPoint by graphene_point_t
Remove the tests for ClutterPoint since it's
corresponding code moved to private ClutterStage
methods.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/458
2019-10-16 11:38:14 +00:00
Georges Basile Stavracas Neto
cd293f764e Replace ClutterSize by graphene_size_t
https://gitlab.gnome.org/GNOME/mutter/merge_requests/458
2019-10-16 11:38:13 +00:00
Georges Basile Stavracas Neto
a5d0cfe8fb Replace ClutterVertex by graphene_point3d_t
Pretty direct and straightforward port. This requires a
GNOME Shell counterpart. In addition to that, include a
progress function.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/458
2019-10-16 11:38:13 +00:00
Georges Basile Stavracas Neto
ba0f17f5b1 Replace CoglVector* by graphene_vec*_t
This is an extremely straightforward and minimalistic port of
CoglVector APIs to the corresponding Graphene APIs.

Make ClutterPlane use graphene_vec3_t internally too, for the
simplest purpose of keeping the patch focused.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/458
2019-10-16 11:38:13 +00:00
Georges Basile Stavracas Neto
7c7ccb2e43 clutter: Pull in Clutter dependencies
Mutter requires Clutter, which requires Cogl. That means
Clutter requires all Cogl dependencies, and Mutter requires
all Clutter dependencies as well.

However, currently, Clutter does not pull in its dependencies,
which means we need to link against Cogl manually.

Add Clutter dependencies to declare_dependency() so that the
graphene dependency only needs to be declared once, for Cogl,
and pulled together.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/458
2019-10-16 11:38:13 +00:00
Georges Basile Stavracas Neto
4f2b217a6a clutter/actor: Drop ClutterActor:clip property
This is a deprecated property that is not used anywhere
in the codebase. Not by GNOME Shell. Because it uses the
deprecated ClutterGeometry type, it's a good target for
cleaning up, given that ClutterGeometry will be dropped
later on.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/458
2019-10-16 11:38:13 +00:00
Georges Basile Stavracas Neto
b1a1d4e13d Remove fog support
Fog is explicitly deprecated in favour of CoglSnippet API,
and in nowhere we are using this deprecated feature, which
means we can simply drop it without any sort of replacement.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/458
2019-10-16 11:38:13 +00:00
Marco Trevisan (Treviño)
553211dd81 clutter/stage: Actually set key focus to an actor on key focus
As per commit c2d03bf73 we're using a private method to set the actors key
focus and emit key-focus-in signal, but we're using inverted logic here.

So flip the parameter to match the expected result.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/860
2019-10-15 16:39:04 +02:00
Marco Trevisan (Treviño)
c2d03bf73e clutter/actor: Save key-focus state and unset it before destruction
When clutter actors with key focus are destroyed we emit ::key-focus-out on
them just after their destruction. This is against our assumption that no
signal should be emitted after "::destroy" (see GNOME/mutter!769 [1]), and
in fact could cause the shell to do actions that we won't ever stop on
destroy callback.

To avoid this to happen, use a private function to set its key-state (so we
can avoid looking for the stage) and emit ::key-focus-in/out events and use
this value in both clutter_actor_has_key_focus(),
clutter_actor_grab_key_focus() and on unmap and destruction to unset the
stage key focus before we emit the ::destroy signal.

As result of this, we can now avoid to unset the key focus on actor
destruction in the stage.

[1] https://gitlab.gnome.org/GNOME/mutter/merge_requests/769

Fixes https://gitlab.gnome.org/GNOME/gnome-shell/issues/1704
2019-10-15 12:20:58 +02:00
Marco Trevisan (Treviño)
d4ff5e2d31 clutter/actor: Remove deprecated clutter container foreach
This is deprecated, so replace it with ClutterActorIter or alternative funcs

https://gitlab.gnome.org/GNOME/mutter/merge_requests/816
2019-10-15 08:51:45 +00:00
Marco Trevisan (Treviño)
2773e8adf8 clutter/actor: Remove deprecated internal child support
Clutter had support for internal children in its early revisions, but they
were deprecated for long time (commit f41061b8df, more than 7 years ago) and
no one is using them in both clutter and in gnome-shell.

So remove any alternative code path that uses internal children.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/816
2019-10-15 08:51:45 +00:00
Niels De Graef
0d0286d59e cogl: Remove COGL_INVALID_HANDLE
Just use `NULL`, which is the normal C convention

https://gitlab.gnome.org/GNOME/mutter/merge_requests/451
2019-10-14 17:05:28 +00:00
Niels De Graef
23f77a1b63 cogl: Remove cogl_handle_ref/unref
This is for all intents and purposes the same as
`cogl_object_ref/unref`, but still refers to handles rather than
objects (while we're trying to get rid of the former) so it's a bit of
unnecessary redundant API.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/451
2019-10-14 17:05:28 +00:00
Georges Basile Stavracas Neto
943b069996 clutter/shader-effect: Initialize shader-type properly
The default value of the ClutterShaderEffect:shader-type
property is CLUTTER_FRAGMENT_SHADER. However, because the
struct field is not actually initialized to it, it ends
up assuming the value 0, which is CLUTTER_VERTEX_SHADER.

Properly initialize ClutterShaderEffect's shader_type to
CLUTTER_FRAGMENT_SHADER.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/846
2019-10-11 10:53:33 -03:00
Jonas Ådahl
2c388e2155 clutter/transition: Don't split reference counting with actor
ClutterActor took a reference in its transition 'stopped' handler,
aiming to keep the transition alive during signal emission even if it
was removed during. This is, however, already taken care of by
ClutterTimeline, by always taking a reference during its 'stopped'
signal emission, so no need to add another one.

This also has the bonus of making reference ownership simpler, as well
as avoidance of double free if an actor was destroyed before a
transition has finished.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/828
2019-10-07 18:33:28 +00:00