[gtk+/gtk-2-22] Remove arbitrary limit on number of redraw rectangles
- From: Kristian Rietveld <kristian src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/gtk-2-22] Remove arbitrary limit on number of redraw rectangles
- Date: Wed, 12 May 2010 10:26:37 +0000 (UTC)
commit 7d61c9fff51548ba54149eb66de85c70970f0b13
Author: Paul Davis <paul linuxaudiosystems com>
Date: Wed May 12 12:11:40 2010 +0200
Remove arbitrary limit on number of redraw rectangles
The aim of this limit was to not degrade performance too much, however,
it actually did degrade performance to a large extent.
gdk/quartz/GdkQuartzView.c | 38 +++++++++++---------------------------
1 files changed, 11 insertions(+), 27 deletions(-)
---
diff --git a/gdk/quartz/GdkQuartzView.c b/gdk/quartz/GdkQuartzView.c
index a3a8d2a..02018ff 100644
--- a/gdk/quartz/GdkQuartzView.c
+++ b/gdk/quartz/GdkQuartzView.c
@@ -18,8 +18,9 @@
* Boston, MA 02111-1307, USA.
*/
-
#import "GdkQuartzView.h"
+#include "gdkregion.h"
+#include "gdkregion-generic.h"
#include "gdkwindow-quartz.h"
#include "gdkprivate-quartz.h"
@@ -92,33 +93,16 @@
}
[self getRectsBeingDrawn:&drawn_rects count:&count];
-
- /* Note: arbitrary limit here to not degrade performace too much. It would
- * be better to optimize the construction of the region below, by using
- * _gdk_region_new_from_yxbanded_rects.
- */
- if (count > 25)
- {
- gdk_rect.x = rect.origin.x;
- gdk_rect.y = rect.origin.y;
- gdk_rect.width = rect.size.width;
- gdk_rect.height = rect.size.height;
-
- region = gdk_region_rectangle (&gdk_rect);
- }
- else
+ region = gdk_region_new ();
+
+ for (i = 0; i < count; i++)
{
- region = gdk_region_new ();
-
- for (i = 0; i < count; i++)
- {
- gdk_rect.x = drawn_rects[i].origin.x;
- gdk_rect.y = drawn_rects[i].origin.y;
- gdk_rect.width = drawn_rects[i].size.width;
- gdk_rect.height = drawn_rects[i].size.height;
-
- gdk_region_union_with_rect (region, &gdk_rect);
- }
+ gdk_rect.x = drawn_rects[i].origin.x;
+ gdk_rect.y = drawn_rects[i].origin.y;
+ gdk_rect.width = drawn_rects[i].size.width;
+ gdk_rect.height = drawn_rects[i].size.height;
+
+ gdk_region_union_with_rect (region, &gdk_rect);
}
impl->in_paint_rect_count++;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]