diff options
author | Georges Basile Stavracas Neto <georges.stavracas@gmail.com> | 2020-10-18 14:29:13 -0300 |
---|---|---|
committer | Georges Basile Stavracas Neto <georges.stavracas@gmail.com> | 2020-10-23 19:21:10 -0300 |
commit | 08fcaa746eee68b3059ddabeb1fd50f7ecaa127e (patch) | |
tree | f806d8af26d18615a7729d0a1517d1dea02bd1d3 | |
parent | 9f59f0895723cd43d2168bfa464effa2b144b823 (diff) | |
download | mutter-gbsneto/graphene-ray.tar.gz |
clutter/actor: Don't push identity transformsgbsneto/graphene-ray
It is useless, and needlessly increases the matrix stack and
does more multiplications than necessary.
Don't push identity transforms to the pick stack.
https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1509
-rw-r--r-- | clutter/clutter/clutter-actor.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/clutter/clutter/clutter-actor.c b/clutter/clutter/clutter-actor.c index 79f4565ed..604438269 100644 --- a/clutter/clutter/clutter-actor.c +++ b/clutter/clutter/clutter-actor.c @@ -3931,6 +3931,7 @@ clutter_actor_pick (ClutterActor *actor, { ClutterActorPrivate *priv; ClutterActorBox clip; + gboolean transform_pushed = FALSE; gboolean clip_set = FALSE; if (CLUTTER_ACTOR_IN_DESTRUCTION (actor)) @@ -3953,7 +3954,11 @@ clutter_actor_pick (ClutterActor *actor, graphene_matrix_init_identity (&matrix); _clutter_actor_apply_modelview_transform (actor, &matrix); - clutter_pick_context_push_transform (pick_context, &matrix); + if (!graphene_matrix_is_identity (&matrix)) + { + clutter_pick_context_push_transform (pick_context, &matrix); + transform_pushed = TRUE; + } } if (priv->has_clip) @@ -3988,7 +3993,7 @@ clutter_actor_pick (ClutterActor *actor, if (clip_set) clutter_pick_context_pop_clip (pick_context); - if (priv->enable_model_view_transform) + if (transform_pushed) clutter_pick_context_pop_transform (pick_context); /* paint sequence complete */ |