[gnome-shell/gbsneto/explicit-framebuffer-preparation: 3/3] st-shadow: Add a CoglFramebuffer argument



commit 23d6d13d80ab81ba8c4b0aad9f1648684e1d0ec5
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date:   Mon Oct 8 22:33:19 2018 -0300

    st-shadow: Add a CoglFramebuffer argument
    
    The last patch in the series, this one adapts StShadowHelper
    to received a CoglFramebuffer. This is where we first touch
    JavaScript with Cogl types, and as such, it depends on the
    latest Mutter. Earlier versions of Mutter didn't have its
    Mutter-Clutter GIR to generate types for various Cogl types.
    
    https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/283

 js/ui/screenShield.js | 5 ++++-
 src/st/st-shadow.c    | 4 +++-
 src/st/st-shadow.h    | 1 +
 3 files changed, 8 insertions(+), 2 deletions(-)
---
diff --git a/js/ui/screenShield.js b/js/ui/screenShield.js
index f5ba1c299..5e9eae2e2 100644
--- a/js/ui/screenShield.js
+++ b/js/ui/screenShield.js
@@ -2,6 +2,7 @@
 
 const AccountsService = imports.gi.AccountsService;
 const Cairo = imports.cairo;
+const Cogl = imports.gi.Cogl;
 const Clutter = imports.gi.Clutter;
 const Gio = imports.gi.Gio;
 const GLib = imports.gi.GLib;
@@ -405,7 +406,9 @@ class ScreenShieldArrow extends St.Bin {
 
             let allocation = this._drawingArea.get_allocation_box();
             let paintOpacity = this._drawingArea.get_paint_opacity();
-            this._shadowHelper.paint(allocation, paintOpacity);
+            let framebuffer = Cogl.get_draw_framebuffer();
+
+            this._shadowHelper.paint(framebuffer, allocation, paintOpacity);
         }
 
         this._drawingArea.paint();
diff --git a/src/st/st-shadow.c b/src/st/st-shadow.c
index 028240022..f3a22f034 100644
--- a/src/st/st-shadow.c
+++ b/src/st/st-shadow.c
@@ -276,6 +276,7 @@ st_shadow_helper_free (StShadowHelper *helper)
 /**
  * st_shadow_helper_paint:
  * @helper: a #StShadowHelper
+ * @framebuffer: a #CoglFramebuffer
  * @actor_box: the bounding box of the shadow
  * @paint_opacity: the opacity at which the shadow is painted
  *
@@ -284,11 +285,12 @@ st_shadow_helper_free (StShadowHelper *helper)
  */
 void
 st_shadow_helper_paint (StShadowHelper  *helper,
+                        CoglFramebuffer *framebuffer,
                         ClutterActorBox *actor_box,
                         guint8           paint_opacity)
 {
   _st_paint_shadow_with_opacity (helper->shadow,
-                                 cogl_get_draw_framebuffer (),
+                                 framebuffer,
                                  helper->pipeline,
                                  actor_box,
                                  paint_opacity);
diff --git a/src/st/st-shadow.h b/src/st/st-shadow.h
index 40c214958..8173f34f4 100644
--- a/src/st/st-shadow.h
+++ b/src/st/st-shadow.h
@@ -84,6 +84,7 @@ void            st_shadow_helper_update (StShadowHelper *helper,
                                          ClutterActor   *source);
 
 void            st_shadow_helper_paint (StShadowHelper  *helper,
+                                        CoglFramebuffer *framebuffer,
                                         ClutterActorBox *actor_box,
                                         guint8           paint_opacity);
 


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