mirror of
https://github.com/brl/mutter.git
synced 2025-02-21 07:24:09 +00:00
frames: Only make one call to meta_frames_paint
This commit is contained in:
parent
02bb550bd6
commit
dd0a6d7e08
@ -1852,7 +1852,6 @@ meta_frames_draw (GtkWidget *widget,
|
|||||||
CachedPixels *pixels;
|
CachedPixels *pixels;
|
||||||
cairo_region_t *region;
|
cairo_region_t *region;
|
||||||
cairo_rectangle_int_t clip;
|
cairo_rectangle_int_t clip;
|
||||||
int i, n_areas;
|
|
||||||
cairo_surface_t *target;
|
cairo_surface_t *target;
|
||||||
|
|
||||||
frames = META_FRAMES (widget);
|
frames = META_FRAMES (widget);
|
||||||
@ -1877,34 +1876,28 @@ meta_frames_draw (GtkWidget *widget,
|
|||||||
|
|
||||||
pixels = get_cache (frames, frame);
|
pixels = get_cache (frames, frame);
|
||||||
|
|
||||||
|
/* cached_pixels_draw will subtract the painted
|
||||||
|
* parts from the region. */
|
||||||
cached_pixels_draw (pixels, cr, region);
|
cached_pixels_draw (pixels, cr, region);
|
||||||
|
|
||||||
|
if (cairo_region_num_rectangles (region) == 0)
|
||||||
|
goto out;
|
||||||
|
|
||||||
clip_to_screen (region, frame);
|
clip_to_screen (region, frame);
|
||||||
subtract_client_area (region, frame);
|
subtract_client_area (region, frame);
|
||||||
|
|
||||||
n_areas = cairo_region_num_rectangles (region);
|
if (cairo_region_num_rectangles (region) == 0)
|
||||||
|
goto out;
|
||||||
|
|
||||||
for (i = 0; i < n_areas; i++)
|
/* OK. Now that we've painted the cached frame
|
||||||
{
|
* pixels, paint the actual pixels that are left over. */
|
||||||
cairo_rectangle_int_t area;
|
|
||||||
|
|
||||||
cairo_region_get_rectangle (region, i, &area);
|
gdk_cairo_region (cr, region);
|
||||||
|
|
||||||
cairo_save (cr);
|
|
||||||
|
|
||||||
cairo_rectangle (cr, area.x, area.y, area.width, area.height);
|
|
||||||
cairo_clip (cr);
|
cairo_clip (cr);
|
||||||
|
|
||||||
cairo_push_group (cr);
|
|
||||||
|
|
||||||
meta_frames_paint (frames, frame, cr);
|
meta_frames_paint (frames, frame, cr);
|
||||||
|
|
||||||
cairo_pop_group_to_source (cr);
|
out:
|
||||||
cairo_paint (cr);
|
|
||||||
|
|
||||||
cairo_restore (cr);
|
|
||||||
}
|
|
||||||
|
|
||||||
cairo_region_destroy (region);
|
cairo_region_destroy (region);
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user