com php-src: Port optimization from external libgd: ext/gd/libgd/gdft.c
| From: | Christoph Michael Becker | Date: | Thu, 15 Sep 2016 11:24:43 +0000 |
| Subject: | com php-src: Port optimization from external libgd: ext/gd/libgd/gdft.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-94558@lists.php.net to get a copy of this message | ||
Commit: ba2b50d097569381f98b306c932e240cd50cbb3d
Author: Christoph M. Becker <cmbecker69@gmx.de> Thu, 15 Sep 2016 13:18:54 +0200
Parents: 04b166a6c56315e84a9d40c751f29b81f84a10c1
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=ba2b50d097569381f98b306c932e240cd50cbb3d
Log:
Port optimization from external libgd
The functionality is identical, but we save two function calls for partially
transparent pixels.
Changed paths:
M ext/gd/libgd/gdft.c
Diff:
diff --git a/ext/gd/libgd/gdft.c b/ext/gd/libgd/gdft.c
index 6de314e..f91fcf7 100644
--- a/ext/gd/libgd/gdft.c
+++ b/ext/gd/libgd/gdft.c
@@ -626,6 +626,7 @@ static char * gdft_draw_bitmap (gdCache_head_t *tc_cache, gdImage * im, int fg,
{
unsigned char *pixel = NULL;
int *tpixel = NULL;
+ int opixel;
int x, y, row, col, pc, pcr;
tweencolor_t *tc_elem;
@@ -683,7 +684,13 @@ static char * gdft_draw_bitmap (gdCache_head_t *tc_cache, gdImage * im, int fg,
}
} else {
if (im->alphaBlendingFlag) {
- *tpixel = gdAlphaBlend(*tpixel, (level << 24) + (fg & 0xFFFFFF));
+ opixel = *tpixel;
+ if (gdTrueColorGetAlpha(opixel) != gdAlphaTransparent) {
+ *tpixel = gdAlphaBlend (opixel,
+ (level << 24) + (fg & 0xFFFFFF));
+ } else {
+ *tpixel = (level << 24) + (fg & 0xFFFFFF);
+ }
} else {
*tpixel = (level << 24) + (fg & 0xFFFFFF);
}