From d212be799a41f43adf8c7dead84975fbf5630d3c Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Thu, 23 Sep 2010 18:49:00 +0200 Subject: [PATCH] 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 --- src/ui/frames.c | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/src/ui/frames.c b/src/ui/frames.c index 2fdbbf86e..ee90541e9 100644 --- a/src/ui/frames.c +++ b/src/ui/frames.c @@ -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);