[mutter/gbsneto/graphene-matrix: 88/104] clutter/offscreen-effect: Stop using CoglMatrix API




commit 8d10b7840296096acccb169e6d87666600545260
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date:   Fri Sep 11 16:34:59 2020 -0300

    clutter/offscreen-effect: Stop using CoglMatrix API
    
    Switch to using CoglFramebuffer APIs, which use the modelview matrix
    stack. CoglMatrixStack will be ported to graphene APIs later, but it
    will be transparent to this change.
    
    https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1439

 clutter/clutter/clutter-offscreen-effect.c | 14 +++++---------
 1 file changed, 5 insertions(+), 9 deletions(-)
---
diff --git a/clutter/clutter/clutter-offscreen-effect.c b/clutter/clutter/clutter-offscreen-effect.c
index e4a9a45e5a..129d7e6f4b 100644
--- a/clutter/clutter/clutter-offscreen-effect.c
+++ b/clutter/clutter/clutter-offscreen-effect.c
@@ -427,7 +427,6 @@ clutter_offscreen_effect_paint_texture (ClutterOffscreenEffect *effect,
   ClutterOffscreenEffectPrivate *priv = effect->priv;
   CoglFramebuffer *framebuffer =
     clutter_paint_context_get_framebuffer (paint_context);
-  graphene_matrix_t modelview;
   float resource_scale;
 
   cogl_framebuffer_push_matrix (framebuffer);
@@ -435,21 +434,18 @@ clutter_offscreen_effect_paint_texture (ClutterOffscreenEffect *effect,
   /* The current modelview matrix is *almost* perfect already. It's only
    * missing a correction for the expanded FBO and offset rendering within...
    */
-  cogl_framebuffer_get_modelview_matrix (framebuffer, &modelview);
-
   resource_scale = clutter_actor_get_resource_scale (priv->actor);
 
   if (resource_scale != 1.0f)
     {
       float paint_scale = 1.0f / resource_scale;
-      cogl_matrix_scale (&modelview, paint_scale, paint_scale, 1);
+      cogl_framebuffer_scale (framebuffer, paint_scale, paint_scale, 1.f);
     }
 
-  cogl_matrix_translate (&modelview,
-                         priv->fbo_offset_x,
-                         priv->fbo_offset_y,
-                         0.0f);
-  cogl_framebuffer_set_modelview_matrix (framebuffer, &modelview);
+  cogl_framebuffer_translate (framebuffer,
+                              priv->fbo_offset_x,
+                              priv->fbo_offset_y,
+                              0.0f);
 
   /* paint the target material; this is virtualized for
    * sub-classes that require special hand-holding


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