[gtk+] Optimize remove_child_area for children outside region
- From: Alexander Larsson <alexl src gnome org>
- To: svn-commits-list gnome org
- Subject: [gtk+] Optimize remove_child_area for children outside region
- Date: Sun, 19 Jul 2009 21:46:14 +0000 (UTC)
commit a057c038893b7a9c84524796662de17a97e4437a
Author: Alexander Larsson <alexl redhat com>
Date: Sun Jul 19 22:35:25 2009 +0200
Optimize remove_child_area for children outside region
If a child is totally outside the current region, bail early instead
of doing costly calculations to subtract the child region.
gdk/gdkwindow.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
---
diff --git a/gdk/gdkwindow.c b/gdk/gdkwindow.c
index eeb8932..a1fa450 100644
--- a/gdk/gdkwindow.c
+++ b/gdk/gdkwindow.c
@@ -636,6 +636,10 @@ remove_child_area (GdkWindowObject *private,
r.width = child->width;
r.height = child->height;
+ /* Bail early if child totally outside region */
+ if (gdk_region_rect_in (region, &r) == GDK_OVERLAP_RECTANGLE_OUT)
+ continue;
+
child_region = gdk_region_rectangle (&r);
if (child->shape)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]