summaryrefslogtreecommitdiffstats
path: root/generic/tkImgPhoto.c
diff options
context:
space:
mode:
authordkf <dkf@noemail.net>2004-12-09 10:13:26 (GMT)
committerdkf <dkf@noemail.net>2004-12-09 10:13:26 (GMT)
commitc3f8ac20483a2b5435fe23a89850c13ea81a2c77 (patch)
treea248aa960247bf47b1be28853cd36c4caa4f1f27 /generic/tkImgPhoto.c
parent992428556af8f13be52512789a74cb6d8da436a4 (diff)
downloadtk-c3f8ac20483a2b5435fe23a89850c13ea81a2c77.zip
tk-c3f8ac20483a2b5435fe23a89850c13ea81a2c77.tar.gz
tk-c3f8ac20483a2b5435fe23a89850c13ea81a2c77.tar.bz2
Speed up use of Tk_PhotoPutBlock by allowing it to skip the complex-alpha check
in degenerate (and common) cases. [Bug 1081966] FossilOrigin-Name: 22092ce8a0d4de8e06f826153f574b9f83f1457c
Diffstat (limited to 'generic/tkImgPhoto.c')
-rw-r--r--generic/tkImgPhoto.c10
1 files changed, 7 insertions, 3 deletions
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.