mirror of
https://github.com/brl/mutter.git
synced 2024-11-25 01:20:42 -05:00
compositor: Avoid changing pipeline/source if shadow is not being painted
Avoids some context invalidations in cogl. https://bugzilla.gnome.org/show_bug.cgi?id=782344
This commit is contained in:
parent
65e816908a
commit
060543466c
@ -220,11 +220,7 @@ meta_shadow_paint (MetaShadow *shadow,
|
|||||||
int dest_x[4];
|
int dest_x[4];
|
||||||
int dest_y[4];
|
int dest_y[4];
|
||||||
int n_x, n_y;
|
int n_x, n_y;
|
||||||
|
gboolean source_updated = FALSE;
|
||||||
cogl_pipeline_set_color4ub (shadow->pipeline,
|
|
||||||
opacity, opacity, opacity, opacity);
|
|
||||||
|
|
||||||
cogl_set_source (shadow->pipeline);
|
|
||||||
|
|
||||||
if (shadow->scale_width)
|
if (shadow->scale_width)
|
||||||
{
|
{
|
||||||
@ -300,6 +296,17 @@ meta_shadow_paint (MetaShadow *shadow,
|
|||||||
else
|
else
|
||||||
overlap = CAIRO_REGION_OVERLAP_IN;
|
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
|
/* There's quite a bit of overhead from allocating a new
|
||||||
* region in order to find an exact intersection and
|
* region in order to find an exact intersection and
|
||||||
* generating more geometry - we make the assumption that
|
* generating more geometry - we make the assumption that
|
||||||
|
Loading…
Reference in New Issue
Block a user