[mutter] Change the cached rectangle ares to a GdkRectangle
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter] Change the cached rectangle ares to a GdkRectangle
- Date: Thu, 23 Sep 2010 10:58:10 +0000 (UTC)
commit a0ffe71db31e45a9ad9abe6fcd587b530a3094bf
Author: Benjamin Otte <otte redhat com>
Date: Mon Sep 20 21:14:00 2010 +0200
Change the cached rectangle ares to a GdkRectangle
Simplifies the code as the rectangle is mainly interacting with GDK
APIs.
https://bugzilla.gnome.org/show_bug.cgi?id=630203
src/ui/frames.c | 22 ++++++++--------------
1 files changed, 8 insertions(+), 14 deletions(-)
---
diff --git a/src/ui/frames.c b/src/ui/frames.c
index bb37c20..dc03646 100644
--- a/src/ui/frames.c
+++ b/src/ui/frames.c
@@ -275,7 +275,7 @@ meta_frames_finalize (GObject *object)
typedef struct
{
- MetaRectangle rect;
+ GdkRectangle rect;
GdkPixmap *pixmap;
} CachedFramePiece;
@@ -2109,30 +2109,24 @@ clear_backing (GdkPixmap *pixmap,
static GdkPixmap *
generate_pixmap (MetaFrames *frames,
MetaUIFrame *frame,
- MetaRectangle rect)
+ GdkRectangle *rect)
{
- GdkRectangle rectangle;
MetaRegion *region;
GdkPixmap *result;
/* do not create a pixmap for nonexisting areas */
- if (rect.width <= 0 || rect.height <= 0)
+ if (rect->width <= 0 || rect->height <= 0)
return NULL;
- rectangle.x = rect.x;
- rectangle.y = rect.y;
- rectangle.width = rect.width;
- rectangle.height = rect.height;
-
result = gdk_pixmap_new (frame->window,
- rect.width, rect.height, -1);
+ rect->width, rect->height, -1);
- clear_backing (result, frame->window, rectangle.x, rectangle.y);
+ clear_backing (result, frame->window, rect->x, rect->y);
- region = meta_region_new_from_rectangle (&rectangle);
+ region = meta_region_new_from_rectangle (rect);
meta_frames_paint_to_drawable (frames, frame, result, region,
- -rectangle.x, -rectangle.y);
+ -rect->x, -rect->y);
meta_region_destroy (region);
@@ -2207,7 +2201,7 @@ populate_cache (MetaFrames *frames,
/* generate_pixmap() returns NULL for 0 width/height pieces, but
* does so cheaply so we don't need to cache the NULL return */
if (!piece->pixmap)
- piece->pixmap = generate_pixmap (frames, frame, piece->rect);
+ piece->pixmap = generate_pixmap (frames, frame, &piece->rect);
}
if (frames->invalidate_cache_timeout_id)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]