mirror of
https://github.com/brl/mutter.git
synced 2024-11-22 08:00:42 -05:00
frames.c: Merge clear_backing() function into its only user
Avoids creating a cairo_t twice. And without the code to create a cairo_t, there was not a lot left to warrant a separate function. https://bugzilla.gnome.org/show_bug.cgi?id=630203
This commit is contained in:
parent
84986c7695
commit
d212be799a
@ -2081,20 +2081,6 @@ setup_bg_cr (cairo_t *cr, GdkWindow *window, int x_offset, int y_offset)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
clear_backing (GdkPixmap *pixmap,
|
|
||||||
GdkWindow *window,
|
|
||||||
int xoffset, int yoffset)
|
|
||||||
{
|
|
||||||
cairo_t *cr = gdk_cairo_create (pixmap);
|
|
||||||
|
|
||||||
setup_bg_cr (cr, window, xoffset, yoffset);
|
|
||||||
|
|
||||||
cairo_paint (cr);
|
|
||||||
|
|
||||||
cairo_destroy (cr);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Returns a pixmap with a piece of the windows frame painted on it.
|
/* Returns a pixmap with a piece of the windows frame painted on it.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -2113,10 +2099,11 @@ generate_pixmap (MetaFrames *frames,
|
|||||||
result = gdk_pixmap_new (frame->window,
|
result = gdk_pixmap_new (frame->window,
|
||||||
rect->width, rect->height, -1);
|
rect->width, rect->height, -1);
|
||||||
|
|
||||||
clear_backing (result, frame->window, rect->x, rect->y);
|
|
||||||
|
|
||||||
cr = meta_cairo_create (result);
|
cr = meta_cairo_create (result);
|
||||||
|
|
||||||
|
setup_bg_cr (cr, frame->window, rect->x, rect->y);
|
||||||
|
cairo_paint (cr);
|
||||||
|
|
||||||
meta_frames_paint (frames, frame, cr, -rect->x, -rect->y);
|
meta_frames_paint (frames, frame, cr, -rect->x, -rect->y);
|
||||||
|
|
||||||
cairo_destroy (cr);
|
cairo_destroy (cr);
|
||||||
|
Loading…
Reference in New Issue
Block a user