From 31d013d4bfff1f3361229d14b9c9b2f72b061364 Mon Sep 17 00:00:00 2001 From: Richard Hult Date: Fri, 15 Aug 2008 20:27:22 +0000 Subject: [PATCH] Some aftermath of the fix of bug #543868. Clip and flip to the source, not 2008-08-15 Richard Hult * gdk/quartz/gdkdrawable-quartz.c (gdk_quartz_draw_drawable): Some aftermath of the fix of bug #543868. Clip and flip to the source, not the destination. Don't save/restore the gstate, it's already done when getting/releasing the context. svn path=/trunk/; revision=21136 --- ChangeLog | 7 +++++++ gdk/quartz/gdkdrawable-quartz.c | 13 +++---------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/ChangeLog b/ChangeLog index 82ef9c824a..0cfbce4ee5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2008-08-15 Richard Hult + + * gdk/quartz/gdkdrawable-quartz.c (gdk_quartz_draw_drawable): Some + aftermath of the fix of bug #543868. Clip and flip to the source, + not the destination. Don't save/restore the gstate, it's already + done when getting/releasing the context. + 2008-08-15 Richard Hult * gtk/gtkclipboard-quartz.c (gtk_clipboard_wait_is_uris_available): diff --git a/gdk/quartz/gdkdrawable-quartz.c b/gdk/quartz/gdkdrawable-quartz.c index ec0cf6c746..9ad9c66d2e 100644 --- a/gdk/quartz/gdkdrawable-quartz.c +++ b/gdk/quartz/gdkdrawable-quartz.c @@ -337,7 +337,6 @@ gdk_quartz_draw_drawable (GdkDrawable *drawable, else if (dest_depth != 0 && src_depth == dest_depth) { CGContextRef context = gdk_quartz_drawable_get_context (drawable, FALSE); - gint width, height; if (!context) return; @@ -345,23 +344,17 @@ gdk_quartz_draw_drawable (GdkDrawable *drawable, _gdk_quartz_gc_update_cg_context (gc, drawable, context, GDK_QUARTZ_CONTEXT_STROKE); - CGContextSaveGState (context); - - /* convert coordinates from gtk+ to core graphics */ - gdk_drawable_get_size (drawable, &width, &height); - CGContextTranslateCTM (context, 0, height); + CGContextClipToRect (context, CGRectMake (xdest, ydest, width, height)); + CGContextTranslateCTM (context, xdest - xsrc, ydest - ysrc + + GDK_PIXMAP_IMPL_QUARTZ (src_impl)->height); CGContextScaleCTM (context, 1.0, -1.0); - CGContextClipToRect (context, CGRectMake (xdest, ydest, width, height)); - CGContextTranslateCTM (context, xdest - xsrc, ydest - ysrc); CGContextDrawImage (context, CGRectMake(0, 0, GDK_PIXMAP_IMPL_QUARTZ (src_impl)->width, GDK_PIXMAP_IMPL_QUARTZ (src_impl)->height), GDK_PIXMAP_IMPL_QUARTZ (src_impl)->image); - CGContextRestoreGState (context); - gdk_quartz_drawable_release_context (drawable, context); } else