From aca2880c6acd1c391b77457ef52c09b2f0781f1f Mon Sep 17 00:00:00 2001 From: Georges Basile Stavracas Neto Date: Fri, 11 Sep 2020 16:39:50 -0300 Subject: [PATCH] clutter/stage-view: Use graphene APIs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In this case, since we are building the entire matrix by ourselves, reverse the order of operations (translate + scale → scale + translate) and build it using graphene-specific APIs. https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1439 --- clutter/clutter/clutter-stage-view.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/clutter/clutter/clutter-stage-view.c b/clutter/clutter/clutter-stage-view.c index c75b1f25e..6e505bd07 100644 --- a/clutter/clutter/clutter-stage-view.c +++ b/clutter/clutter/clutter-stage-view.c @@ -236,13 +236,14 @@ paint_transformed_framebuffer (ClutterStageView *view, cogl_framebuffer_push_matrix (dst_framebuffer); - cogl_matrix_init_identity (&matrix); - cogl_matrix_scale (&matrix, - 1.0 / (dst_width / 2.0), - -1.0 / (dst_height / 2.0), 0); - cogl_matrix_translate (&matrix, - -(dst_width / 2.0), - -(dst_height / 2.0), 0); + graphene_matrix_init_translate (&matrix, + &GRAPHENE_POINT3D_INIT (-dst_width / 2.0, + -dst_height / 2.0, + 0.f)); + graphene_matrix_scale (&matrix, + 1.0 / (dst_width / 2.0), + -1.0 / (dst_height / 2.0), + 0.f); cogl_framebuffer_set_projection_matrix (dst_framebuffer, &matrix); cogl_framebuffer_set_viewport (dst_framebuffer, 0, 0, dst_width, dst_height); @@ -987,7 +988,7 @@ static void clutter_stage_default_get_offscreen_transformation_matrix (ClutterStageView *view, graphene_matrix_t *matrix) { - cogl_matrix_init_identity (matrix); + graphene_matrix_init_identity (matrix); } void