[gnome-shell] blur-effect: Only apply paint opacity to actor blur



commit ca35ae4364a0dad092197cd8f6fe39578ce1a359
Author: Jonas Dreßler <verdre v0yd nl>
Date:   Fri Feb 7 10:21:21 2020 +0100

    blur-effect: Only apply paint opacity to actor blur
    
    We don't want to apply the opacity of the actor when blurring the
    background.
    
    https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/991

 src/shell-blur-effect.c | 15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)
---
diff --git a/src/shell-blur-effect.c b/src/shell-blur-effect.c
index 881592027f..f7b391dad4 100644
--- a/src/shell-blur-effect.c
+++ b/src/shell-blur-effect.c
@@ -578,19 +578,15 @@ paint_texture (ShellBlurEffect     *self,
 static void
 apply_blur (ShellBlurEffect     *self,
             ClutterPaintContext *paint_context,
-            FramebufferData     *from)
+            FramebufferData     *from,
+            uint8_t              paint_opacity)
 {
-  ClutterActor *actor;
   BlurData *vblur;
   BlurData *hblur;
-  guint8 paint_opacity;
 
   vblur = &self->blur[VERTICAL];
   hblur = &self->blur[HORIZONTAL];
 
-  actor = clutter_actor_meta_get_actor (CLUTTER_ACTOR_META (self));
-  paint_opacity = clutter_actor_get_paint_opacity (actor);
-
   /* Copy the actor contents into the vblur framebuffer */
   cogl_pipeline_set_color4ub (from->pipeline,
                               paint_opacity,
@@ -784,6 +780,7 @@ shell_blur_effect_paint (ClutterEffect           *effect,
                          ClutterEffectPaintFlags  flags)
 {
   ShellBlurEffect *self = SHELL_BLUR_EFFECT (effect);
+  uint8_t paint_opacity;
 
   if (self->blur_radius > 0)
     {
@@ -798,13 +795,15 @@ shell_blur_effect_paint (ClutterEffect           *effect,
           switch (self->mode)
             {
             case SHELL_BLUR_MODE_ACTOR:
+              paint_opacity = clutter_actor_get_paint_opacity (self->actor);
+
               paint_actor_offscreen (self, paint_context, flags);
-              apply_blur (self, paint_context, &self->actor_fb);
+              apply_blur (self, paint_context, &self->actor_fb, paint_opacity);
               break;
 
             case SHELL_BLUR_MODE_BACKGROUND:
               paint_background (self, paint_context);
-              apply_blur (self, paint_context, &self->background_fb);
+              apply_blur (self, paint_context, &self->background_fb, 255);
               break;
             }
         }


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