[mutter/gbsneto/graphene-matrix: 30/57] clutter: Register progress function for graphene_matrix_t




commit 976c8751f4df8a5eff49ea27386a248c5aa0294e
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date:   Fri Sep 11 10:34:28 2020 -0300

    clutter: Register progress function for graphene_matrix_t
    
    Soon, there'll be no CoglMatrix anymore, and to pair CoglMatrix's
    progress function, add the same for graphene_matrix_t.
    
    https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1439

 clutter/clutter/clutter-graphene.c | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
---
diff --git a/clutter/clutter/clutter-graphene.c b/clutter/clutter/clutter-graphene.c
index d1c447a5e5..409c189b07 100644
--- a/clutter/clutter/clutter-graphene.c
+++ b/clutter/clutter/clutter-graphene.c
@@ -29,6 +29,23 @@
 #include "clutter-private.h"
 #include "clutter-types.h"
 
+static gboolean
+graphene_matrix_progress (const GValue *a,
+                          const GValue *b,
+                          double        progress,
+                          GValue       *retval)
+{
+  const graphene_matrix_t *am = g_value_get_boxed (a);
+  const graphene_matrix_t *bm = g_value_get_boxed (b);
+  graphene_matrix_t res;
+
+  graphene_matrix_interpolate (am, bm, progress, &res);
+
+  g_value_set_boxed (retval, &res);
+
+  return TRUE;
+}
+
 static gboolean
 graphene_point_progress (const GValue *a,
                          const GValue *b,
@@ -100,6 +117,8 @@ graphene_size_progress (const GValue *a,
 void
 clutter_graphene_init (void)
 {
+  clutter_interval_register_progress_func (GRAPHENE_TYPE_MATRIX,
+                                           graphene_matrix_progress);
   clutter_interval_register_progress_func (GRAPHENE_TYPE_POINT,
                                            graphene_point_progress);
   clutter_interval_register_progress_func (GRAPHENE_TYPE_POINT3D,


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