diff options
author | Jasper St. Pierre <jstpierre@mecheye.net> | 2014-06-20 20:20:14 -0400 |
---|---|---|
committer | Jasper St. Pierre <jstpierre@mecheye.net> | 2014-06-20 20:41:55 -0400 |
commit | be30e440c350f0f3e0f2572f7f3eab54ef96af0e (patch) | |
tree | 26a739ac35b8044ccea2b4fb9f0c243608d4d1c6 /gdk/quartz | |
parent | d48adf9cee7e340acd7f8b9a5f9716695352b848 (diff) | |
download | gtk+-be30e440c350f0f3e0f2572f7f3eab54ef96af0e.tar.gz |
gdkwindow: Remove the ability to call begin_paint_region more than once
Previously, each begin_paint_region added to a stack of current paints,
and when end_paint was called, the paint was popped off of the stack and
the surface was composited into the parent paint surface.
However, the code was broken in the case of a backend like Wayland which
didn't keep track of nested calls and simply wiped and returned the
native impl backing surface every time.
Since this feature is flat out unused by GTK+ and we don't want to
really support tricksy things like these for other clients, just remove
the feature. If somebody does call begin_paint_region more than once,
warn and return without doing anything.
Diffstat (limited to 'gdk/quartz')
-rw-r--r-- | gdk/quartz/gdkwindow-quartz.c | 47 | ||||
-rw-r--r-- | gdk/quartz/gdkwindow-quartz.h | 1 |
2 files changed, 3 insertions, 45 deletions
diff --git a/gdk/quartz/gdkwindow-quartz.c b/gdk/quartz/gdkwindow-quartz.c index 37efa7ccca..50d6865450 100644 --- a/gdk/quartz/gdkwindow-quartz.c +++ b/gdk/quartz/gdkwindow-quartz.c @@ -137,37 +137,6 @@ gdk_window_impl_quartz_get_context (GdkWindowImplQuartz *window_impl, CGContextSaveGState (cg_context); CGContextSetAllowsAntialiasing (cg_context, antialias); - /* We'll emulate the clipping caused by double buffering here */ - if (window_impl->begin_paint_count != 0) - { - CGRect rect; - CGRect *cg_rects; - gint n_rects, i; - - n_rects = cairo_region_num_rectangles (window_impl->paint_clip_region); - - if (n_rects == 1) - cg_rects = ▭ - else - cg_rects = g_new (CGRect, n_rects); - - for (i = 0; i < n_rects; i++) - { - cairo_rectangle_int_t cairo_rect; - cairo_region_get_rectangle (window_impl->paint_clip_region, - i, &cairo_rect); - cg_rects[i].origin.x = cairo_rect.x; - cg_rects[i].origin.y = cairo_rect.y; - cg_rects[i].size.width = cairo_rect.width; - cg_rects[i].size.height = cairo_rect.height; - } - - CGContextClipToRects (cg_context, cg_rects, n_rects); - - if (cg_rects != &rect) - g_free (cg_rects); - } - return cg_context; } @@ -379,12 +348,7 @@ gdk_window_impl_quartz_begin_paint_region (GdkWindow *window, cairo_region_translate (clipped_and_offset_region, window->abs_x, window->abs_y); - if (impl->begin_paint_count == 0) - impl->paint_clip_region = cairo_region_reference (clipped_and_offset_region); - else - cairo_region_union (impl->paint_clip_region, clipped_and_offset_region); - - impl->begin_paint_count++; + impl->paint_clip_region = cairo_region_reference (clipped_and_offset_region); if (cairo_region_is_empty (clipped_and_offset_region)) goto done; @@ -423,13 +387,8 @@ gdk_window_impl_quartz_end_paint (GdkWindow *window) { GdkWindowImplQuartz *impl = GDK_WINDOW_IMPL_QUARTZ (window->impl); - impl->begin_paint_count--; - - if (impl->begin_paint_count == 0) - { - cairo_region_destroy (impl->paint_clip_region); - impl->paint_clip_region = NULL; - } + cairo_region_destroy (impl->paint_clip_region); + impl->paint_clip_region = NULL; } static void diff --git a/gdk/quartz/gdkwindow-quartz.h b/gdk/quartz/gdkwindow-quartz.h index 396035d331..d1b5665a68 100644 --- a/gdk/quartz/gdkwindow-quartz.h +++ b/gdk/quartz/gdkwindow-quartz.h @@ -51,7 +51,6 @@ struct _GdkWindowImplQuartz GdkWindowTypeHint type_hint; cairo_region_t *paint_clip_region; - gint begin_paint_count; gint in_paint_rect_count; GdkWindow *transient_for; |