[gtk+/gtk-2-24] quartz: add _gdk_quartz_window_set_needs_display_in_region
- From: Michael Natterer <mitch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/gtk-2-24] quartz: add _gdk_quartz_window_set_needs_display_in_region
- Date: Thu, 15 Nov 2012 13:55:17 +0000 (UTC)
commit 4d01c56d8953d2b9f30625c32a5a8f223c0539d0
Author: Kristian Rietveld <kris lanedo com>
Date: Sat Oct 27 17:11:26 2012 +0200
quartz: add _gdk_quartz_window_set_needs_display_in_region
It's needed for the next commit, which is an actual fix.
gdk/quartz/gdkprivate-quartz.h | 2 ++
gdk/quartz/gdkwindow-quartz.c | 38 ++++++++++++++++++++++++++++----------
2 files changed, 30 insertions(+), 10 deletions(-)
---
diff --git a/gdk/quartz/gdkprivate-quartz.h b/gdk/quartz/gdkprivate-quartz.h
index c1b3083..03bba91 100644
--- a/gdk/quartz/gdkprivate-quartz.h
+++ b/gdk/quartz/gdkprivate-quartz.h
@@ -160,6 +160,8 @@ void _gdk_quartz_window_debug_highlight (GdkWindow *window,
void _gdk_quartz_window_set_needs_display_in_rect (GdkWindow *window,
GdkRectangle *rect);
+void _gdk_quartz_window_set_needs_display_in_region (GdkWindow *window,
+ GdkRegion *region);
void _gdk_quartz_window_update_position (GdkWindow *window);
diff --git a/gdk/quartz/gdkwindow-quartz.c b/gdk/quartz/gdkwindow-quartz.c
index 6cf54a8..2daf9d7 100644
--- a/gdk/quartz/gdkwindow-quartz.c
+++ b/gdk/quartz/gdkwindow-quartz.c
@@ -373,12 +373,37 @@ _gdk_quartz_window_set_needs_display_in_rect (GdkWindow *window,
}
void
-_gdk_windowing_window_process_updates_recurse (GdkWindow *window,
- GdkRegion *region)
+_gdk_quartz_window_set_needs_display_in_region (GdkWindow *window,
+ GdkRegion *region)
{
+ GdkWindowObject *private;
+ GdkWindowImplQuartz *impl;
int i, n_rects;
GdkRectangle *rects;
+ private = GDK_WINDOW_OBJECT (window);
+ impl = GDK_WINDOW_IMPL_QUARTZ (private->impl);
+
+ if (!impl->needs_display_region)
+ impl->needs_display_region = gdk_region_new ();
+
+ gdk_region_union (impl->needs_display_region, region);
+
+ gdk_region_get_rectangles (region, &rects, &n_rects);
+
+ for (i = 0; i < n_rects; i++)
+ [impl->view setNeedsDisplayInRect:NSMakeRect (rects[i].x, rects[i].y,
+ rects[i].width,
+ rects[i].height)];
+
+ g_free (rects);
+
+}
+
+void
+_gdk_windowing_window_process_updates_recurse (GdkWindow *window,
+ GdkRegion *region)
+{
/* Make sure to only flush each toplevel at most once if we're called
* from process_all_updates.
*/
@@ -410,14 +435,7 @@ _gdk_windowing_window_process_updates_recurse (GdkWindow *window,
}
if (WINDOW_IS_TOPLEVEL (window))
- {
- gdk_region_get_rectangles (region, &rects, &n_rects);
-
- for (i = 0; i < n_rects; i++)
- _gdk_quartz_window_set_needs_display_in_rect (window, &rects[i]);
-
- g_free (rects);
- }
+ _gdk_quartz_window_set_needs_display_in_region (window, region);
else
_gdk_window_process_updates_recurse (window, region);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]