[mutter/gbsneto/graphene2: 40/45] Scale matrices before rotating and translating



commit f5fe0c05abd30728d1e3b929af6037abdff44db9
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date:   Fri Mar 1 21:44:54 2019 -0300

    Scale matrices before rotating and translating
    
    This is the correct operation.

 clutter/clutter/clutter-stage-view.c           | 2 +-
 cogl/tests/conform/test-offscreen.c            | 2 +-
 cogl/tests/conform/test-pipeline-user-matrix.c | 4 ++--
 src/backends/x11/meta-stage-x11-nested.c       | 2 +-
 4 files changed, 5 insertions(+), 5 deletions(-)
---
diff --git a/clutter/clutter/clutter-stage-view.c b/clutter/clutter/clutter-stage-view.c
index cd6cd35cb..a4319683e 100644
--- a/clutter/clutter/clutter-stage-view.c
+++ b/clutter/clutter/clutter-stage-view.c
@@ -133,8 +133,8 @@ clutter_stage_view_blit_offscreen (ClutterStageView            *view,
    * the bottom right corner.
    */
   cogl_matrix_init_identity (&matrix);
-  cogl_matrix_translate (&matrix, -1, 1, 0);
   cogl_matrix_scale (&matrix, 2, -2, 0);
+  cogl_matrix_translate (&matrix, -1, 1, 0);
   cogl_framebuffer_set_projection_matrix (priv->framebuffer, &matrix);
 
   cogl_framebuffer_draw_rectangle (priv->framebuffer,
diff --git a/cogl/tests/conform/test-offscreen.c b/cogl/tests/conform/test-offscreen.c
index 6dcc6a55f..896bd1cad 100644
--- a/cogl/tests/conform/test-offscreen.c
+++ b/cogl/tests/conform/test-offscreen.c
@@ -63,8 +63,8 @@ test_paint (TestState *state)
    * window.
    */
   cogl_push_matrix ();
-  cogl_translate (0.5, 0.5, 0);
   cogl_scale (-0.5, 0.5, 1);
+  cogl_translate (0.5, 0.5, 0);
 
   cogl_push_framebuffer (offscreen);
 
diff --git a/cogl/tests/conform/test-pipeline-user-matrix.c b/cogl/tests/conform/test-pipeline-user-matrix.c
index 7771073f3..4cd760750 100644
--- a/cogl/tests/conform/test-pipeline-user-matrix.c
+++ b/cogl/tests/conform/test-pipeline-user-matrix.c
@@ -105,14 +105,14 @@ paint (TestState *state)
 
   /* Set a matrix on the first layer so that it will mirror about the y-axis */
   cogl_matrix_init_identity (&matrix);
-  cogl_matrix_translate (&matrix, 0.0f, 1.0f, 0.0f);
   cogl_matrix_scale (&matrix, 1.0f, -1.0f, 1.0f);
+  cogl_matrix_translate (&matrix, 0.0f, 1.0f, 0.0f);
   cogl_pipeline_set_layer_matrix (pipeline, 0, &matrix);
 
   /* Set a matrix on the second layer so that it will mirror about the x-axis */
   cogl_matrix_init_identity (&matrix);
-  cogl_matrix_translate (&matrix, 1.0f, 0.0f, 0.0f);
   cogl_matrix_scale (&matrix, -1.0f, 1.0f, 1.0f);
+  cogl_matrix_translate (&matrix, 1.0f, 0.0f, 0.0f);
   cogl_pipeline_set_layer_matrix (pipeline, 1, &matrix);
 
   cogl_framebuffer_draw_rectangle (test_fb,
diff --git a/src/backends/x11/meta-stage-x11-nested.c b/src/backends/x11/meta-stage-x11-nested.c
index 02fef1e55..13e46c4d6 100644
--- a/src/backends/x11/meta-stage-x11-nested.c
+++ b/src/backends/x11/meta-stage-x11-nested.c
@@ -143,8 +143,8 @@ draw_crtc (MetaMonitor         *monitor,
 
   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_translate (&projection_matrix, -1, 1, 0);
 
   cogl_matrix_multiply (&projection_matrix, &projection_matrix, &transform);
   cogl_framebuffer_set_projection_matrix (onscreen, &projection_matrix);


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