summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2004-12-09 10:05:37 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2004-12-09 10:05:37 (GMT)
commitdf22aaf69eaaaf896c7520ee40bcfaf2f6209101 (patch)
treecef9444ddc60045b183dd8553137f48c68a841d1
parentf842b0ddfdbd3c96c8bc82fdac2b74c59ce68574 (diff)
downloadtk-df22aaf69eaaaf896c7520ee40bcfaf2f6209101.zip
tk-df22aaf69eaaaf896c7520ee40bcfaf2f6209101.tar.gz
tk-df22aaf69eaaaf896c7520ee40bcfaf2f6209101.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--ChangeLog8
-rw-r--r--generic/tkImgPhoto.c10
2 files changed, 15 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 6e8ec10..df139a0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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-06 Jeff Hobbs <jeffh@ActiveState.com>
*** 8.4.9 TAGGED FOR RELEASE ***
diff --git a/generic/tkImgPhoto.c b/generic/tkImgPhoto.c
index 05b0e57..9daf790 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.36.2.12 2004/12/03 13:16:35 dkf Exp $
+ * RCS: @(#) $Id: tkImgPhoto.c,v 1.36.2.13 2004/12/09 10:05:38 dkf Exp $
*/
#include "tkInt.h"
@@ -4586,7 +4586,9 @@ Tk_PhotoPutBlock(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.
@@ -4878,7 +4880,9 @@ Tk_PhotoPutZoomedBlock(handle, blockPtr, x, y, width, height, zoomX, zoomY,
* Check if display code needs alpha blending...
*/
- ToggleComplexAlphaIfNeeded(masterPtr);
+ if (alphaOffset != 0 || masterPtr->flags & COMPLEX_ALPHA) {
+ ToggleComplexAlphaIfNeeded(masterPtr);
+ }
/*
* Update each instance.