From d13722ccef1255b9bf4059b3c47cf34d73a290db Mon Sep 17 00:00:00 2001 From: das Date: Sat, 18 Sep 2004 00:48:13 +0000 Subject: * macosx/README: typos * macosx/tkMacOSXDraw.c (TkMacOSXSetUpCGContext): performance improvements: removed slow & unnecessary calls. --- ChangeLog | 6 ++++++ macosx/README | 5 +++-- macosx/tkMacOSXDraw.c | 18 +++++++++--------- 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 + + * macosx/README: typos + * macosx/tkMacOSXDraw.c (TkMacOSXSetUpCGContext): performance + improvements: removed slow & unnecessary calls. + 2004-09-17 Jeff Hobbs * 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 -in your script before drawing, in which case only lines thinner that pixels will be antialiased. +in your script before drawing, in which case only lines thinner that 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); } -- cgit v0.12