[mutter/gbsneto/graphene-matrix: 69/73] src: Use graphene APIs




commit be42f92e851598385a7764e2204a77191793f8a8
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date:   Fri Sep 11 19:12:54 2020 -0300

    src: Use graphene APIs
    
    This commit encompasses the trivial ones.
    
    https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1439

 src/backends/x11/nested/meta-stage-x11-nested.c | 9 ++++-----
 src/compositor/clutter-utils.c                  | 6 +++---
 src/compositor/meta-window-actor.c              | 3 +--
 3 files changed, 8 insertions(+), 10 deletions(-)
---
diff --git a/src/backends/x11/nested/meta-stage-x11-nested.c b/src/backends/x11/nested/meta-stage-x11-nested.c
index e2c8de2b37..165d40c943 100644
--- a/src/backends/x11/nested/meta-stage-x11-nested.c
+++ b/src/backends/x11/nested/meta-stage-x11-nested.c
@@ -131,11 +131,10 @@ draw_view (MetaStageX11Nested *stage_nested,
                                                           &transform);
 
   cogl_framebuffer_push_matrix (onscreen);
-  cogl_matrix_init_identity (&projection_matrix);
-  cogl_matrix_translate (&projection_matrix, -1, 1, 0);
-  cogl_matrix_scale (&projection_matrix, 2, -2, 0);
-
-  cogl_matrix_multiply (&projection_matrix, &projection_matrix, &transform);
+  graphene_matrix_init_scale (&projection_matrix, 2, -2, 0);
+  graphene_matrix_translate (&projection_matrix,
+                             &GRAPHENE_POINT3D_INIT (-1, 1, 0));
+  graphene_matrix_multiply (&transform, &projection_matrix, &projection_matrix);
   cogl_framebuffer_set_projection_matrix (onscreen, &projection_matrix);
 
   s_1 = sample_x / texture_width;
diff --git a/src/compositor/clutter-utils.c b/src/compositor/clutter-utils.c
index 2be2da775a..86d788562e 100644
--- a/src/compositor/clutter-utils.c
+++ b/src/compositor/clutter-utils.c
@@ -148,9 +148,9 @@ meta_actor_painting_untransformed (CoglFramebuffer *fb,
   cogl_framebuffer_get_modelview_matrix (fb, &modelview);
   cogl_framebuffer_get_projection_matrix (fb, &projection);
 
-  cogl_matrix_multiply (&modelview_projection,
-                        &projection,
-                        &modelview);
+  graphene_matrix_multiply (&modelview,
+                            &projection,
+                            &modelview_projection);
 
   vertices[0].x = 0;
   vertices[0].y = 0;
diff --git a/src/compositor/meta-window-actor.c b/src/compositor/meta-window-actor.c
index a2086ca907..1091700aad 100644
--- a/src/compositor/meta-window-actor.c
+++ b/src/compositor/meta-window-actor.c
@@ -1118,8 +1118,7 @@ meta_window_actor_set_geometry_scale (MetaWindowActor *window_actor,
 
   priv->geometry_scale = geometry_scale;
 
-  cogl_matrix_init_identity (&child_transform);
-  cogl_matrix_scale (&child_transform, geometry_scale, geometry_scale, 1);
+  graphene_matrix_init_scale (&child_transform, geometry_scale, geometry_scale, 1);
   clutter_actor_set_child_transform (CLUTTER_ACTOR (window_actor),
                                      &child_transform);
 }


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