[gnome-shell/gbsneto/explicit-framebuffer-preparation: 2/3] st-private: Receive a CoglFramebuffer



commit 20627b2062aa5a5b08994beb2407dd8d56bff961
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date:   Fri Oct 5 22:38:11 2018 -0300

    st-private: Receive a CoglFramebuffer
    
    Same case of the previous patch; _st_paint_shadow_with_opacity()
    uses cogl_get_draw_framebuffer(), and this patch makes it receive
    a CoglFramebuffer as a parameter instead.
    
    The cautious reader might notice that this commit apparently goes
    against the long-term goal, for it introduces more instances of
    cogl_get_draw_framebuffer(). This is not wrong, but these introduced
    ones will be removed later on, when ClutterActor.paint() receives
    a CoglFramebuffer as a parameter instead.

 src/st/st-entry.c              | 1 +
 src/st/st-icon.c               | 1 +
 src/st/st-label.c              | 1 +
 src/st/st-private.c            | 5 +++--
 src/st/st-private.h            | 1 +
 src/st/st-shadow.c             | 1 +
 src/st/st-theme-node-drawing.c | 2 ++
 7 files changed, 10 insertions(+), 2 deletions(-)
---
diff --git a/src/st/st-entry.c b/src/st/st-entry.c
index a9c062937..53954dbf3 100644
--- a/src/st/st-entry.c
+++ b/src/st/st-entry.c
@@ -882,6 +882,7 @@ st_entry_paint (ClutterActor *actor)
 
       if (priv->text_shadow_material != COGL_INVALID_HANDLE)
         _st_paint_shadow_with_opacity (shadow_spec,
+                                       cogl_get_draw_framebuffer (),
                                        priv->text_shadow_material,
                                        &allocation,
                                        clutter_actor_get_paint_opacity (priv->entry));
diff --git a/src/st/st-icon.c b/src/st/st-icon.c
index 5892f8a52..34f9f6b45 100644
--- a/src/st/st-icon.c
+++ b/src/st/st-icon.c
@@ -176,6 +176,7 @@ st_icon_paint (ClutterActor *actor)
 
           clutter_actor_get_allocation_box (priv->icon_texture, &allocation);
           _st_paint_shadow_with_opacity (priv->shadow_spec,
+                                         cogl_get_draw_framebuffer (),
                                          priv->shadow_pipeline,
                                          &allocation,
                                          clutter_actor_get_paint_opacity (priv->icon_texture));
diff --git a/src/st/st-label.c b/src/st/st-label.c
index 515e34323..84e685705 100644
--- a/src/st/st-label.c
+++ b/src/st/st-label.c
@@ -216,6 +216,7 @@ st_label_paint (ClutterActor *actor)
 
       if (priv->text_shadow_pipeline != NULL)
         _st_paint_shadow_with_opacity (shadow_spec,
+                                       cogl_get_draw_framebuffer (),
                                        priv->text_shadow_pipeline,
                                        &allocation,
                                        clutter_actor_get_paint_opacity (priv->label));
diff --git a/src/st/st-private.c b/src/st/st-private.c
index 512fbba45..2e40d6521 100644
--- a/src/st/st-private.c
+++ b/src/st/st-private.c
@@ -659,11 +659,11 @@ _st_create_shadow_cairo_pattern (StShadow        *shadow_spec,
 
 void
 _st_paint_shadow_with_opacity (StShadow        *shadow_spec,
+                               CoglFramebuffer *framebuffer,
                                CoglPipeline    *shadow_pipeline,
                                ClutterActorBox *box,
                                guint8           paint_opacity)
 {
-  CoglFramebuffer *fb = cogl_get_draw_framebuffer ();
   ClutterActorBox shadow_box;
   CoglColor color;
 
@@ -679,7 +679,8 @@ _st_paint_shadow_with_opacity (StShadow        *shadow_spec,
                             shadow_spec->color.alpha * paint_opacity / 255);
   cogl_color_premultiply (&color);
   cogl_pipeline_set_layer_combine_constant (shadow_pipeline, 0, &color);
-  cogl_framebuffer_draw_rectangle (fb, shadow_pipeline,
+  cogl_framebuffer_draw_rectangle (framebuffer,
+                                   shadow_pipeline,
                                    shadow_box.x1, shadow_box.y1,
                                    shadow_box.x2, shadow_box.y2);
 }
diff --git a/src/st/st-private.h b/src/st/st-private.h
index 3bd934d00..f88f93009 100644
--- a/src/st/st-private.h
+++ b/src/st/st-private.h
@@ -70,6 +70,7 @@ cairo_pattern_t *_st_create_shadow_cairo_pattern (StShadow        *shadow_spec,
                                                   cairo_pattern_t *src_pattern);
 
 void _st_paint_shadow_with_opacity (StShadow        *shadow_spec,
+                                    CoglFramebuffer *framebuffer,
                                     CoglPipeline    *shadow_pipeline,
                                     ClutterActorBox *box,
                                     guint8           paint_opacity);
diff --git a/src/st/st-shadow.c b/src/st/st-shadow.c
index 73aa1a3a2..028240022 100644
--- a/src/st/st-shadow.c
+++ b/src/st/st-shadow.c
@@ -288,6 +288,7 @@ st_shadow_helper_paint (StShadowHelper  *helper,
                         guint8           paint_opacity)
 {
   _st_paint_shadow_with_opacity (helper->shadow,
+                                 cogl_get_draw_framebuffer (),
                                  helper->pipeline,
                                  actor_box,
                                  paint_opacity);
diff --git a/src/st/st-theme-node-drawing.c b/src/st/st-theme-node-drawing.c
index 2123cc487..601943481 100644
--- a/src/st/st-theme-node-drawing.c
+++ b/src/st/st-theme-node-drawing.c
@@ -2562,6 +2562,7 @@ st_theme_node_paint (StThemeNode           *node,
       if (state->alloc_width < node->box_shadow_min_width ||
           state->alloc_height < node->box_shadow_min_height)
         _st_paint_shadow_with_opacity (node->box_shadow,
+                                       framebuffer,
                                        state->box_shadow_pipeline,
                                        &allocation,
                                        paint_opacity);
@@ -2635,6 +2636,7 @@ st_theme_node_paint (StThemeNode           *node,
        */
       if (node->background_shadow_pipeline != COGL_INVALID_HANDLE)
         _st_paint_shadow_with_opacity (node->background_image_shadow,
+                                       framebuffer,
                                        node->background_shadow_pipeline,
                                        &background_box,
                                        paint_opacity);


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