summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog6
-rw-r--r--macosx/README5
-rw-r--r--macosx/tkMacOSXDraw.c18
3 files changed, 18 insertions, 11 deletions
diff --git a/ChangeLog b/ChangeLog
index 2848999..efcb1f6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2004-09-18 Daniel Steffen <das@users.sourceforge.net>
+
+ * macosx/README: typos
+ * macosx/tkMacOSXDraw.c (TkMacOSXSetUpCGContext): performance
+ improvements: removed slow & unnecessary calls.
+
2004-09-17 Jeff Hobbs <jeffh@ActiveState.com>
* tests/winWm.test: Add 'wm attributes -alpha' to control toplevel
diff --git a/macosx/README b/macosx/README
index 14d66d0..eff9032 100644
--- a/macosx/README
+++ b/macosx/README
@@ -1,7 +1,7 @@
TclTkAqua README
----------------
-RCS: @(#) $Id: README,v 1.6.2.5 2004/07/27 18:52:26 wolfsuit Exp $
+RCS: @(#) $Id: README,v 1.6.2.6 2004/09/18 00:48:14 das Exp $
This is the README file for the Mac OS X native versions of Tcl & Tk.
@@ -100,7 +100,8 @@ is set to 3 pixel width lines. You can change this if you want by putting:
set tk::mac::CGAntialiasLimit <limit>
-in your script before drawing, in which case only lines thinner that <limit> pixels will be antialiased.
+in your script before drawing, in which case only lines thinner that <limit> pixels
+will not be antialiased.
- Quickdraw text antialiasing is enabled by default when available (from 10.1.5
onwards). Changing the global boolean variable '::tk::mac::antialiasedtext'
diff --git a/macosx/tkMacOSXDraw.c b/macosx/tkMacOSXDraw.c
index e4d6431..81d36aa 100644
--- a/macosx/tkMacOSXDraw.c
+++ b/macosx/tkMacOSXDraw.c
@@ -11,7 +11,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.2.2.4 2004/07/27 18:58:33 das Exp $
+ * RCS: @(#) $Id: tkMacOSXDraw.c,v 1.2.2.5 2004/09/18 00:48:14 das Exp $
*/
#include "tclInt.h"
@@ -1723,11 +1723,10 @@ TkMacOSXSetUpCGContext(
OSStatus err;
Rect boundsRect;
CGAffineTransform coordsTransform;
- RgnHandle clipRgn;
+ static RgnHandle clipRgn = NULL;
err = QDBeginCGContext(destPort, contextPtr);
outContext = *contextPtr;
- CGContextSaveGState(outContext);
/*
* Now clip the CG Context to the port. Note, we have already
@@ -1739,15 +1738,17 @@ TkMacOSXSetUpCGContext(
* visible region so we don't overwrite the window decoration.
*/
- clipRgn = NewRgn();
- GetPortClipRegion(destPort, clipRgn);
-
- SectRegionWithPortVisibleRegion(destPort, clipRgn);
+ if (!clipRgn) {
+ clipRgn = NewRgn();
+ }
GetPortBounds(destPort, &boundsRect);
+ RectRgn(clipRgn, &boundsRect);
+ SectRegionWithPortClipRegion(destPort, clipRgn);
+ SectRegionWithPortVisibleRegion(destPort, clipRgn);
ClipCGContextToRegion(outContext, &boundsRect, clipRgn);
- DisposeRgn(clipRgn);
+ SetEmptyRgn(clipRgn);
/*
* Note: You have to call SyncCGContextOriginWithPort
@@ -1823,7 +1824,6 @@ TkMacOSXReleaseCGContext(
CGrafPtr destPort,
CGContextRef *outContext)
{
- CGContextRestoreGState(*outContext);
CGContextSynchronize(*outContext);
QDEndCGContext(destPort, outContext);
}