From 9e9af775d8bb015804f39d8b28b0f5a3d7052b95 Mon Sep 17 00:00:00 2001 From: das Date: Mon, 24 Aug 2009 00:55:30 +0000 Subject: * macosx/tkMacOSXDraw.c (TkMacOSX{Setup,Restore}DrawingContext): Disable window flushing during Tk drawing to avoid immediate flush of NSView-based native widgets on draw. (fixes drawing performance issue reported by Youness Alaoui on tcl-mac) FossilOrigin-Name: 18d5779a7a5d01435637492da6e4fe542227deeb --- macosx/tkMacOSXDraw.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/macosx/tkMacOSXDraw.c b/macosx/tkMacOSXDraw.c index 7964f5f..a867bf7 100644 --- a/macosx/tkMacOSXDraw.c +++ b/macosx/tkMacOSXDraw.c @@ -12,7 +12,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkMacOSXDraw.c,v 1.36 2009/08/14 14:50:19 das Exp $ + * RCS: @(#) $Id: tkMacOSXDraw.c,v 1.37 2009/08/24 00:55:31 das Exp $ */ #include "tkMacOSXPrivate.h" @@ -1565,6 +1565,7 @@ TkMacOSXSetupDrawingContext( if (dontDraw) { goto end; } + [[view window] disableFlushWindow]; dc.view = view; dc.context = [[NSGraphicsContext currentContext] graphicsPort]; dc.portBounds = NSRectToCGRect([view bounds]); @@ -1690,6 +1691,7 @@ TkMacOSXRestoreDrawingContext( { if (dcPtr->context) { CGContextSynchronize(dcPtr->context); + [[dcPtr->view window] enableFlushWindow]; if (dcPtr->focusLocked) { [dcPtr->view unlockFocus]; } else { -- cgit v0.12