diff --git a/src/compositor/meta-shadow-factory.c b/src/compositor/meta-shadow-factory.c index cd006008b..19147ca9f 100644 --- a/src/compositor/meta-shadow-factory.c +++ b/src/compositor/meta-shadow-factory.c @@ -220,9 +220,7 @@ meta_shadow_paint (MetaShadow *shadow, int dest_x[4]; int dest_y[4]; int n_x, n_y; - - cogl_pipeline_set_color4ub (shadow->pipeline, - opacity, opacity, opacity, opacity); + gboolean source_updated = FALSE; cogl_set_source (shadow->pipeline); @@ -300,6 +298,17 @@ meta_shadow_paint (MetaShadow *shadow, else overlap = CAIRO_REGION_OVERLAP_IN; + if (overlap == CAIRO_REGION_OVERLAP_OUT) + continue; + + if (!source_updated) + { + cogl_pipeline_set_color4ub (shadow->pipeline, + opacity, opacity, opacity, opacity); + cogl_set_source (shadow->pipeline); + source_updated = TRUE; + } + /* There's quite a bit of overhead from allocating a new * region in order to find an exact intersection and * generating more geometry - we make the assumption that