cedric pushed a commit to branch efl-1.10.

http://git.enlightenment.org/core/efl.git/commit/?id=58d65f2cc43b4208b67e29330f21ac0fe975edd2

commit 58d65f2cc43b4208b67e29330f21ac0fe975edd2
Author: Jean-Philippe Andre <jp.an...@samsung.com>
Date:   Tue Jan 6 19:15:07 2015 +0900

    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.
---
 src/lib/evas/common/evas_font_compress.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/src/lib/evas/common/evas_font_compress.c 
b/src/lib/evas/common/evas_font_compress.c
index 1b8d631..f84824d 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))

-- 


Reply via email to