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:
Benjamin Otte 2010-09-23 18:49:00 +02:00
parent 84986c7695
commit d212be799a

View File

@ -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.
*/
@ -2113,10 +2099,11 @@ generate_pixmap (MetaFrames *frames,
result = gdk_pixmap_new (frame->window,
rect->width, rect->height, -1);
clear_backing (result, frame->window, rect->x, rect->y);
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);
cairo_destroy (cr);