[mutter] frames.c: Simplify cached area subtraction code
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter] frames.c: Simplify cached area subtraction code
- Date: Thu, 23 Sep 2010 10:58:15 +0000 (UTC)
commit 741d2b761a6e5d0175b9234941f6b5b464374dc2
Author: Benjamin Otte <otte redhat com>
Date: Mon Sep 20 21:14:49 2010 +0200
frames.c: Simplify cached area subtraction code
Because we store the affected rectangle in the piece, we can just
subtract it and don't need any complicated computations.
https://bugzilla.gnome.org/show_bug.cgi?id=630203
src/ui/frames.c | 23 +++++------------------
1 files changed, 5 insertions(+), 18 deletions(-)
---
diff --git a/src/ui/frames.c b/src/ui/frames.c
index dc03646..8ce50ae 100644
--- a/src/ui/frames.c
+++ b/src/ui/frames.c
@@ -2275,26 +2275,11 @@ subtract_client_area (MetaRegion *region, MetaUIFrame *frame)
}
static void
-subtract_from_region (MetaRegion *region, GdkDrawable *drawable,
- gint x, gint y)
-{
- GdkRectangle rect;
- MetaRegion *reg_rect;
-
- gdk_drawable_get_size (drawable, &rect.width, &rect.height);
- rect.x = x;
- rect.y = y;
-
- reg_rect = meta_region_new_from_rectangle (&rect);
- meta_region_subtract (region, reg_rect);
- meta_region_destroy (reg_rect);
-}
-
-static void
cached_pixels_draw (CachedPixels *pixels,
GdkWindow *window,
MetaRegion *region)
{
+ MetaRegion *region_piece;
cairo_t *cr;
int i;
@@ -2310,8 +2295,10 @@ cached_pixels_draw (CachedPixels *pixels,
gdk_cairo_set_source_pixmap (cr, piece->pixmap,
piece->rect.x, piece->rect.y);
cairo_paint (cr);
- subtract_from_region (region, piece->pixmap,
- piece->rect.x, piece->rect.y);
+
+ region_piece = meta_region_new_from_rectangle (&piece->rect);
+ meta_region_subtract (region, region_piece);
+ meta_region_destroy (region_piece);
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]