[mutter/gbsneto/graphene-matrix: 28/57] clutter/actor: Split building the transform into a separate function
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter/gbsneto/graphene-matrix: 28/57] clutter/actor: Split building the transform into a separate function
- Date: Thu, 24 Sep 2020 11:43:35 +0000 (UTC)
commit 74696b58dc33cdcc4ad72a013ee3d3894f9b9993
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]