[gtk+/rendering-cleanup: 43/95] gdk: Simplify code
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/rendering-cleanup: 43/95] gdk: Simplify code
- Date: Sun, 8 Aug 2010 02:18:03 +0000 (UTC)
commit 51311ef9df7895e63bf1949cbc579cb0781b2853
Author: Benjamin Otte <otte redhat com>
Date: Tue Jul 20 01:21:38 2010 +0200
gdk: Simplify code
Use new Cairo APIs to make the code simpler.
gdk/gdkwindow.c | 15 ++++-----------
1 files changed, 4 insertions(+), 11 deletions(-)
---
diff --git a/gdk/gdkwindow.c b/gdk/gdkwindow.c
index acf715e..51971aa 100644
--- a/gdk/gdkwindow.c
+++ b/gdk/gdkwindow.c
@@ -3036,7 +3036,6 @@ setup_redirect_clip (GdkWindow *window,
GdkWindowObject *private = (GdkWindowObject *)window;
cairo_region_t *visible_region;
GdkRectangle dest_rect;
- cairo_region_t *tmpreg;
GdkWindow *toplevel;
int x_offset, y_offset;
@@ -3057,9 +3056,7 @@ setup_redirect_clip (GdkWindow *window,
dest_rect.y = -y_offset;
dest_rect.width = private->redirect->width;
dest_rect.height = private->redirect->height;
- tmpreg = cairo_region_create_rectangle (&dest_rect);
- cairo_region_intersect (visible_region, tmpreg);
- cairo_region_destroy (tmpreg);
+ cairo_region_intersect_rectangle (visible_region, &dest_rect);
/* Compensate for the dest pos */
x_offset += private->redirect->dest_x;
@@ -9033,7 +9030,7 @@ _gdk_window_calculate_full_clip_region (GdkWindow *window,
{
GdkWindowObject *private = GDK_WINDOW_OBJECT (window);
GdkRectangle visible_rect;
- cairo_region_t *real_clip_region, *tmpreg;
+ cairo_region_t *real_clip_region;
gint x_offset, y_offset;
GdkWindowObject *parentwin, *lastwin;
@@ -9102,9 +9099,7 @@ _gdk_window_calculate_full_clip_region (GdkWindow *window,
visible_rect.y + visible_rect.height <= real_clip_rect.y)
continue;
- tmpreg = cairo_region_create_rectangle (&visible_rect);
- cairo_region_subtract (real_clip_region, tmpreg);
- cairo_region_destroy (tmpreg);
+ cairo_region_subtract_rectangle (real_clip_region, &visible_rect);
}
/* Clip to the parent */
@@ -9113,9 +9108,7 @@ _gdk_window_calculate_full_clip_region (GdkWindow *window,
visible_rect.x += - x_offset;
visible_rect.y += - y_offset;
- tmpreg = cairo_region_create_rectangle (&visible_rect);
- cairo_region_intersect (real_clip_region, tmpreg);
- cairo_region_destroy (tmpreg);
+ cairo_region_intersect_rectangle (real_clip_region, &visible_rect);
}
if (base_x_offset)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]