[mutter] background: simplify conditional in meta_background_get_texture



commit 0ffd4254d9d226f14655a9ef9a459afe1cf36fe7
Author: Ray Strode <rstrode redhat com>
Date:   Thu Sep 3 13:58:29 2015 -0400

    background: simplify conditional in meta_background_get_texture
    
    meta_background_get_texture only draws the bottom image texture
    if
       1) the blend factor leaves the top image translucent
       or
       2) the top image is translucent from alpha
    
    The latter case doesn't actually matter since we're using REPLACE
    on the top image texture.
    
    This commit drops the unnecessary check for the second case and
    applies demorgans law to the conditional for clarity.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=754476

 src/compositor/meta-background.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)
---
diff --git a/src/compositor/meta-background.c b/src/compositor/meta-background.c
index 3f2e23f..0db6698 100644
--- a/src/compositor/meta-background.c
+++ b/src/compositor/meta-background.c
@@ -796,8 +796,7 @@ meta_background_get_texture (MetaBackground         *self,
                                     0.0, 0.0, 0.0, 0.0);
         }
 
-      if (texture1 != NULL &&
-          !(texture2 != NULL && priv->blend_factor == 1.0 && !texture_has_alpha (texture2)))
+      if (texture1 != NULL && priv->blend_factor != 1.0)
         {
           CoglPipeline *pipeline = create_pipeline (PIPELINE_ADD);
           cogl_pipeline_set_color4f (pipeline,


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