gtk+ r21136 - in trunk: . gdk/quartz



Author: rhult
Date: Fri Aug 15 20:27:22 2008
New Revision: 21136
URL: http://svn.gnome.org/viewvc/gtk+?rev=21136&view=rev

Log:
2008-08-15  Richard Hult  <richard imendio com>

	* 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.


Modified:
   trunk/ChangeLog
   trunk/gdk/quartz/gdkdrawable-quartz.c

Modified: trunk/gdk/quartz/gdkdrawable-quartz.c
==============================================================================
--- trunk/gdk/quartz/gdkdrawable-quartz.c	(original)
+++ trunk/gdk/quartz/gdkdrawable-quartz.c	Fri Aug 15 20:27:22 2008
@@ -337,7 +337,6 @@
   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_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



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]