[mutter/gbsneto/graphene-matrix: 99/104] renderer-view: Use graphene APIs
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc: 
- Subject: [mutter/gbsneto/graphene-matrix: 99/104] renderer-view: Use graphene APIs
- Date: Tue,  6 Oct 2020 14:43:28 +0000 (UTC)
commit 291b1c03aaab682f6810de783722609601c5a759
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date:   Fri Sep 11 19:12:06 2020 -0300
    renderer-view: Use graphene APIs
    
    Yet another case of swapping operations order upside down.
    
    https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1439
 src/backends/meta-renderer-view.c | 34 +++++++++++++++++-----------------
 1 file changed, 17 insertions(+), 17 deletions(-)
---
diff --git a/src/backends/meta-renderer-view.c b/src/backends/meta-renderer-view.c
index 07dab9ec1c..1688c5cb42 100644
--- a/src/backends/meta-renderer-view.c
+++ b/src/backends/meta-renderer-view.c
@@ -79,41 +79,41 @@ meta_renderer_view_get_offscreen_transformation_matrix (ClutterStageView  *view,
 {
   MetaRendererView *renderer_view = META_RENDERER_VIEW (view);
 
-  cogl_matrix_init_identity (matrix);
+  graphene_matrix_init_identity (matrix);
 
   switch (renderer_view->transform)
     {
     case META_MONITOR_TRANSFORM_NORMAL:
       break;
     case META_MONITOR_TRANSFORM_90:
-      cogl_matrix_rotate (matrix, 90, 0, 0, 1);
-      cogl_matrix_translate (matrix, 0, -1, 0);
+      graphene_matrix_translate (matrix, &GRAPHENE_POINT3D_INIT (0, -1, 0));
+      graphene_matrix_rotate (matrix, 90, graphene_vec3_z_axis ());
       break;
     case META_MONITOR_TRANSFORM_180:
-      cogl_matrix_rotate (matrix, 180, 0, 0, 1);
-      cogl_matrix_translate (matrix, -1, -1, 0);
+      graphene_matrix_translate (matrix, &GRAPHENE_POINT3D_INIT (-1, -1, 0));
+      graphene_matrix_rotate (matrix, 180, graphene_vec3_z_axis ());
       break;
     case META_MONITOR_TRANSFORM_270:
-      cogl_matrix_rotate (matrix, 270, 0, 0, 1);
-      cogl_matrix_translate (matrix, -1, 0, 0);
+      graphene_matrix_translate (matrix, &GRAPHENE_POINT3D_INIT (-1, 0, 0));
+      graphene_matrix_rotate (matrix, 270, graphene_vec3_z_axis ());
       break;
     case META_MONITOR_TRANSFORM_FLIPPED:
-      cogl_matrix_scale (matrix, -1, 1, 1);
-      cogl_matrix_translate (matrix, -1, 0, 0);
+      graphene_matrix_translate (matrix, &GRAPHENE_POINT3D_INIT (-1, 0, 0));
+      graphene_matrix_scale (matrix, -1, 1, 1);
       break;
     case META_MONITOR_TRANSFORM_FLIPPED_90:
-      cogl_matrix_scale (matrix, -1, 1, 1);
-      cogl_matrix_rotate (matrix, 90, 0, 0, 1);
+      graphene_matrix_rotate (matrix, 90, graphene_vec3_z_axis ());
+      graphene_matrix_scale (matrix, -1, 1, 1);
       break;
     case META_MONITOR_TRANSFORM_FLIPPED_180:
-      cogl_matrix_scale (matrix, -1, 1, 1);
-      cogl_matrix_rotate (matrix, 180, 0, 0, 1);
-      cogl_matrix_translate (matrix, 0, -1, 0);
+      graphene_matrix_translate (matrix, &GRAPHENE_POINT3D_INIT (0, -1, 0));
+      graphene_matrix_rotate (matrix, 180, graphene_vec3_z_axis ());
+      graphene_matrix_scale (matrix, -1, 1, 1);
       break;
     case META_MONITOR_TRANSFORM_FLIPPED_270:
-      cogl_matrix_scale (matrix, -1, 1, 1);
-      cogl_matrix_rotate (matrix, 270, 0, 0, 1);
-      cogl_matrix_translate (matrix, -1, -1, 0);
+      graphene_matrix_translate (matrix, &GRAPHENE_POINT3D_INIT (-1, -1, 0));
+      graphene_matrix_rotate (matrix, 270, graphene_vec3_z_axis ());
+      graphene_matrix_scale (matrix, -1, 1, 1);
       break;
     }
 }
[
Date Prev][
Date Next]   [
Thread Prev][
Thread Next]   
[
Thread Index]
[
Date Index]
[
Author Index]