diff options
author | Jean-Philippe Andre <jp.andre@samsung.com> | 2015-01-06 19:15:07 +0900 |
---|---|---|
committer | Cedric BAIL <cedric@osg.samsung.com> | 2015-01-06 13:13:32 +0100 |
commit | 58d65f2cc43b4208b67e29330f21ac0fe975edd2 (patch) | |
tree | ce11864866c07720b3d056a2a5815c8cd67e56d6 | |
parent | 9c05b0c381a5b0e6ec1c6f07c3d5423d20153a61 (diff) | |
download | efl-58d65f2cc43b4208b67e29330f21ac0fe975edd2.tar.gz |
Evas fonts: Fix minor deviation in RLE font render
So I've discovered some weird output values after drawing
some text. The destination alpha would become 0xFE even
when the back buffer had a background with 0xFF alpha.
Example:
Dest is 0xff00ff00 (green).
Color is 0xffffffff (white).
Current font alpha is 170 (0xaa).
--> Output was 0xFEaaFEaa instead of 0xFFaaFFaa.
This is because of some slightly invalid calculation
when doing the font masking (mtab[v] = 0x55 above).
Indeed, MUL_256 takes alpha values in the range [1-256]
and not [0-256] as was assumed.
-rw-r--r-- | src/lib/evas/common/evas_font_compress.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/lib/evas/common/evas_font_compress.c b/src/lib/evas/common/evas_font_compress.c index 1b8d63114b..f84824d11b 100644 --- a/src/lib/evas/common/evas_font_compress.c +++ b/src/lib/evas/common/evas_font_compress.c @@ -475,7 +475,6 @@ evas_common_font_glyph_draw(RGBA_Font_Glyph *fg, DATA32 *dst = dst_image->image.data; DATA32 coltab[16], col; DATA16 mtab[16], v; - DATA8 tmp; w = fgo->bitmap.width; h = fgo->bitmap.rows; // skip if totally clipped out @@ -520,8 +519,7 @@ evas_common_font_glyph_draw(RGBA_Font_Glyph *fg, { v = (i << 4) | i; coltab[i] = MUL_SYM(v, col); - tmp = (coltab[i] >> 24); - mtab[i] = 256 - (tmp + (tmp >> 7)); + mtab[i] = 256 - (coltab[i] >> 24); } #ifdef BUILD_MMX if (evas_common_cpu_has_feature(CPU_FEATURE_MMX)) |