From 647d64253b5c0c4ad94711d033771789bbc6bc6c Mon Sep 17 00:00:00 2001 From: dkf Date: Tue, 6 Jan 2009 09:22:29 +0000 Subject: Apply [Patch 1539990] to speed up Tk_PhotoPutBlock in one case. --- ChangeLog | 26 +++++++++++++++----------- generic/tkImgPhoto.c | 25 +++++++++++++++---------- 2 files changed, 30 insertions(+), 21 deletions(-) diff --git a/ChangeLog b/ChangeLog index 295572e..dcfc8c7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,7 +1,12 @@ +2009-01-06 Donal K. Fellows + + * generic/tkImgPhoto.c (Tk_PhotoPutBlock): Optimize a common case for + photo image building. [Patch 1539990] (jepler) + 2009-01-06 Pat Thoyts - * win/tkWinDialog.c: Use task modal for messagebox instead of - system modal [Bug 2484771] (ferrieux,thoyts,mjanssen) + * win/tkWinDialog.c: Use task modal for messagebox instead of system + modal. [Bug 2484771] (ferrieux,thoyts,mjanssen) 2009-01-03 Donal K. Fellows @@ -16,17 +21,16 @@ 2008-12-31 David Gravereaux - * win/rules.vc: small bug not setting SYMBOLS macro fixed. + * win/rules.vc: Small bug not setting SYMBOLS macro fixed. 2008-12-31 Joe English - * generic/ttk/ttkDefaultTheme.c: Fix color palette for - radiobutton and checkbutton indicators. Fixes [Bug 2003310]; - also makes "alt" theme check/radiobuttons look like Windows 98, - as intended. - * library/ttk/altTheme.tcl: Specify dark gray -bordercolor - to soften edges. - * tests/ttk/{checkbutton,radiobutton}.test: split out of ttk.test. + * generic/ttk/ttkDefaultTheme.c: Fix color palette for radiobutton and + checkbutton indicators. Fixes [Bug 2003310]; also makes "alt" theme + check/radiobuttons look like Windows 98, as intended. + * library/ttk/altTheme.tcl: Specify dark gray -bordercolor to soften + edges. + * tests/ttk/{checkbutton,radiobutton}.test: Split out of ttk.test. 2008-12-28 Donal K. Fellows @@ -114,7 +118,7 @@ 2008-12-12 Pat Thoyts - * library/demos/fontchoose.tcl: Simple fontchooser demo + * library/demos/fontchoose.tcl: Simple fontchooser demo. * library/demos/widget: 2008-12-11 Jan Nijtmans diff --git a/generic/tkImgPhoto.c b/generic/tkImgPhoto.c index 1513607..4722095 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.88 2008/11/18 23:49:43 nijtmans Exp $ + * RCS: @(#) $Id: tkImgPhoto.c,v 1.89 2009/01/06 09:22:30 dkf Exp $ */ #include "tkImgPhoto.h" @@ -2849,21 +2849,26 @@ Tk_PhotoPutBlock( * Check if display code needs alpha blending... */ - if (!sourceIsSimplePhoto && (width == 1) && (height == 1)) { + if (!sourceIsSimplePhoto && (height == 1)) { /* - * Optimize the single pixel case if we can. This speeds up code that - * builds up large simple-alpha images by single pixels. We don't - * negate COMPLEX_ALPHA in this case. [Bug 1409140] + * Optimize the single span case if we can. This speeds up code that + * builds up large simple-alpha images by scan-lines or individual + * pixels. We don't negate COMPLEX_ALPHA in this case. [Bug 1409140] + * [Patch 1539990] */ if (!(masterPtr->flags & COMPLEX_ALPHA)) { - unsigned char newAlpha; + register unsigned int x1; - destLinePtr = masterPtr->pix32 + (y * masterPtr->width + x) * 4; - newAlpha = destLinePtr[3]; + for (x1=x ; xflags |= COMPLEX_ALPHA; + destLinePtr = masterPtr->pix32 + (y*masterPtr->width + x1)*4; + newAlpha = destLinePtr[3]; + if (newAlpha && newAlpha != 255) { + masterPtr->flags |= COMPLEX_ALPHA; + break; + } } } } else if ((alphaOffset != 0) || (masterPtr->flags & COMPLEX_ALPHA)) { -- cgit v0.12