shaped-texture: Fix the logic when the blended region is empty
When the blended region was empty, meaning we didn't have to paint anything blended -- the case for an app update -- was drawing the entire window blended, because of a think-o in the complex and complicated logic. Fix this so that we don't draw anything for the blended region when empty.
This commit is contained in:
parent
e1acb69cf1
commit
c15b3b4a09
@ -430,6 +430,16 @@ meta_shaped_texture_paint (ClutterActor *actor)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Now, go ahead and paint the blended parts. */
|
/* Now, go ahead and paint the blended parts. */
|
||||||
|
|
||||||
|
/* We have three cases:
|
||||||
|
* 1) blended_region has rectangles - paint the rectangles.
|
||||||
|
* 2) blended_region is empty - don't paint anything
|
||||||
|
* 3) blended_region is NULL - paint fully-blended.
|
||||||
|
*
|
||||||
|
* 1) and 3) are the times where we have to paint stuff. This tests
|
||||||
|
* for 1) and 3).
|
||||||
|
*/
|
||||||
|
if (blended_region == NULL || !cairo_region_is_empty (blended_region))
|
||||||
{
|
{
|
||||||
CoglPipeline *blended_pipeline;
|
CoglPipeline *blended_pipeline;
|
||||||
|
|
||||||
@ -451,8 +461,9 @@ meta_shaped_texture_paint (ClutterActor *actor)
|
|||||||
cogl_color_init_from_4ub (&color, opacity, opacity, opacity, opacity);
|
cogl_color_init_from_4ub (&color, opacity, opacity, opacity, opacity);
|
||||||
cogl_pipeline_set_color (blended_pipeline, &color);
|
cogl_pipeline_set_color (blended_pipeline, &color);
|
||||||
|
|
||||||
if (blended_region != NULL && !cairo_region_is_empty (blended_region))
|
if (blended_region != NULL)
|
||||||
{
|
{
|
||||||
|
/* 1) blended_region is NULL and not empty. Paint the rectangles. */
|
||||||
int i;
|
int i;
|
||||||
int n_rects = cairo_region_num_rectangles (blended_region);
|
int n_rects = cairo_region_num_rectangles (blended_region);
|
||||||
|
|
||||||
@ -469,6 +480,7 @@ meta_shaped_texture_paint (ClutterActor *actor)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
/* 3) blended_region is NULL. Do a full paint. */
|
||||||
cogl_framebuffer_draw_rectangle (fb, blended_pipeline,
|
cogl_framebuffer_draw_rectangle (fb, blended_pipeline,
|
||||||
0, 0,
|
0, 0,
|
||||||
alloc.x2 - alloc.x1,
|
alloc.x2 - alloc.x1,
|
||||||
|
Loading…
Reference in New Issue
Block a user