[mutter/gbsneto/graphene-matrix: 9/39] clutter/actor: Split building the transform into a separate function




commit 0624dbc35106df9a58e5c7f78c49cf8ce9672892
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date:   Fri Sep 11 10:29:46 2020 -0300

    clutter/actor: Split building the transform into a separate function
    
    It'll be used independently by the next commit to ensure ClutterStage
    has a valid transform set.
    
    https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1439

 clutter/clutter/clutter-actor.c | 22 +++++++++++++++-------
 1 file changed, 15 insertions(+), 7 deletions(-)
---
diff --git a/clutter/clutter/clutter-actor.c b/clutter/clutter/clutter-actor.c
index 3559b4d64e..12a9fbf390 100644
--- a/clutter/clutter/clutter-actor.c
+++ b/clutter/clutter/clutter-actor.c
@@ -3145,20 +3145,28 @@ roll_back_pivot:
 
 /* Applies the transforms associated with this actor to the given
  * matrix. */
-void
-_clutter_actor_apply_modelview_transform (ClutterActor *self,
-                                          CoglMatrix   *matrix)
+static void
+ensure_valid_actor_transform (ClutterActor *actor)
 {
-  ClutterActorPrivate *priv = self->priv;
+  ClutterActorPrivate *priv = actor->priv;
 
   if (priv->transform_valid)
-    goto out;
+    return;
 
-  CLUTTER_ACTOR_GET_CLASS (self)->apply_transform (self, &priv->transform);
+  CLUTTER_ACTOR_GET_CLASS (actor)->apply_transform (actor, &priv->transform);
+  priv->has_inverse_transform =
+    cogl_matrix_get_inverse (&priv->transform, &priv->inverse_transform);
 
   priv->transform_valid = TRUE;
+}
 
-out:
+void
+_clutter_actor_apply_modelview_transform (ClutterActor *self,
+                                          CoglMatrix   *matrix)
+{
+  ClutterActorPrivate *priv = self->priv;
+
+  ensure_valid_actor_transform (self);
   cogl_matrix_multiply (matrix, matrix, &priv->transform);
 }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]