summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2015-01-06 19:15:07 +0900
committerCedric BAIL <cedric@osg.samsung.com>2015-01-06 13:14:08 +0100
commit864c137471a45846764bc570067023a1d242d52c (patch)
tree70f230fdd2ffa80e4a89b2ce8ba383f32e25aac7
parentd64e3a27e510abfb8377d636fb72f30842c9af89 (diff)
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.c4
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 1c615f9c7e..448716ba46 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,
475 DATA32 *dst = dst_image->image.data; 475 DATA32 *dst = dst_image->image.data;
476 DATA32 coltab[16], col; 476 DATA32 coltab[16], col;
477 DATA16 mtab[16], v; 477 DATA16 mtab[16], v;
478 DATA8 tmp;
479 478
480 w = fgo->bitmap.width; h = fgo->bitmap.rows; 479 w = fgo->bitmap.width; h = fgo->bitmap.rows;
481 // skip if totally clipped out 480 // skip if totally clipped out
@@ -520,8 +519,7 @@ evas_common_font_glyph_draw(RGBA_Font_Glyph *fg,
520 { 519 {
521 v = (i << 4) | i; 520 v = (i << 4) | i;
522 coltab[i] = MUL_SYM(v, col); 521 coltab[i] = MUL_SYM(v, col);
523 tmp = (coltab[i] >> 24); 522 mtab[i] = 256 - (coltab[i] >> 24);
524 mtab[i] = 256 - (tmp + (tmp >> 7));
525 } 523 }
526#ifdef BUILD_MMX 524#ifdef BUILD_MMX
527 if (evas_common_cpu_has_feature(CPU_FEATURE_MMX)) 525 if (evas_common_cpu_has_feature(CPU_FEATURE_MMX))