diff options
author | dkf <donal.k.fellows@manchester.ac.uk> | 2004-12-09 10:13:27 (GMT) |
---|---|---|
committer | dkf <donal.k.fellows@manchester.ac.uk> | 2004-12-09 10:13:27 (GMT) |
commit | a5d1ea94c49fda6e8d4a09fcac9c04559c1930c5 (patch) | |
tree | a248aa960247bf47b1be28853cd36c4caa4f1f27 | |
parent | 21df9ae7a1997e227dd3deb9a4855ab9b40bac7f (diff) | |
download | tk-a5d1ea94c49fda6e8d4a09fcac9c04559c1930c5.zip tk-a5d1ea94c49fda6e8d4a09fcac9c04559c1930c5.tar.gz tk-a5d1ea94c49fda6e8d4a09fcac9c04559c1930c5.tar.bz2 |
Speed up use of Tk_PhotoPutBlock by allowing it to skip the complex-alpha check
in degenerate (and common) cases. [Bug 1081966]
-rw-r--r-- | ChangeLog | 8 | ||||
-rw-r--r-- | generic/tkImgPhoto.c | 10 |
2 files changed, 15 insertions, 3 deletions
@@ -1,3 +1,11 @@ +2004-12-09 Donal K. Fellows <donal.k.fellows@man.ac.uk> + + * generic/tkImgPhoto.c (Tk_PhotoPutBlock, Tk_PhotoPutZoomedBlock): + Added guards so that rescanning for the complex-alpha check is not + done in the common case of creating a simple image a bit at a + time, or any other time where the image was simple before and the + input data has no alpha channel. [Bug 1081966] + 2004-12-07 Don Porter <dgp@users.sourceforge.net> * tests/canvPs.test: Cleaned up the matching of [makeFile] and diff --git a/generic/tkImgPhoto.c b/generic/tkImgPhoto.c index 34d0d46..fc3aa76 100644 --- a/generic/tkImgPhoto.c +++ b/generic/tkImgPhoto.c @@ -17,7 +17,7 @@ * Department of Computer Science, * Australian National University. * - * RCS: @(#) $Id: tkImgPhoto.c,v 1.53 2004/12/03 13:09:39 dkf Exp $ + * RCS: @(#) $Id: tkImgPhoto.c,v 1.54 2004/12/09 10:13:28 dkf Exp $ */ #include "tkInt.h" @@ -4590,7 +4590,9 @@ Tk_PhotoPutBlock(interp, handle, blockPtr, x, y, width, height, compRule) * Check if display code needs alpha blending... */ - ToggleComplexAlphaIfNeeded(masterPtr); + if (alphaOffset != 0 || masterPtr->flags & COMPLEX_ALPHA) { + ToggleComplexAlphaIfNeeded(masterPtr); + } /* * Update each instance. @@ -4890,7 +4892,9 @@ Tk_PhotoPutZoomedBlock(interp, handle, blockPtr, x, y, width, height, * Check if display code needs alpha blending... */ - ToggleComplexAlphaIfNeeded(masterPtr); + if (alphaOffset != 0 || masterPtr->flags & COMPLEX_ALPHA) { + ToggleComplexAlphaIfNeeded(masterPtr); + } /* * Update each instance. |