This patch, the six -- and last -- in a series, involves the file "evas_blend_pixel_mul_pixel.c" of the "engines/common" dir.
jose. ----------------------------------------------------------------------- Index: cvs/e17/libs/evas/src/lib/engines/common/evas_blend_pixel_mul_pixel.c =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/evas/src/lib/engines/common/evas_blend_pi xel_mul_pixel.c,v retrieving revision 1.3 diff -u -r1.3 evas_blend_pixel_mul_pixel.c --- cvs/e17/libs/evas/src/lib/engines/common/evas_blend_pixel_mul_pixel.c 12 May 2003 02:26:26 -0000 1.3 +++ cvs/e17/libs/evas/src/lib/engines/common/evas_blend_pixel_mul_pixel.c 17 Mar 2004 18:53:03 -0000 @@ -26,46 +26,71 @@ DATA32 tmp; DATA8 a; - a = (A_VAL(src_ptr) * (A_VAL(&mul_color) + 1)) >> 8; - if (a) /* hmmm - do we need this? */ - { - BLEND_COLOR(a, R_VAL(dst_ptr), - R_VAL(src_ptr), R_VAL(dst_ptr), - tmp); - BLEND_COLOR(a, G_VAL(dst_ptr), - G_VAL(src_ptr), G_VAL(dst_ptr), - tmp); - BLEND_COLOR(a, B_VAL(dst_ptr), - B_VAL(src_ptr), B_VAL(dst_ptr), - tmp); - } + MULT_COLOR(a, A_VAL(src_ptr), A_VAL(&mul_color), tmp); + if (!a) { src_ptr++; dst_ptr++; continue; } + + BLEND_COLOR(a, R_VAL(dst_ptr), + R_VAL(src_ptr), R_VAL(dst_ptr), + tmp); + BLEND_COLOR(a, G_VAL(dst_ptr), + G_VAL(src_ptr), G_VAL(dst_ptr), + tmp); + BLEND_COLOR(a, B_VAL(dst_ptr), + B_VAL(src_ptr), B_VAL(dst_ptr), + tmp); + src_ptr++; dst_ptr++; } + return; } - else + + if (A_VAL(&mul_color) < 0xff) { while (dst_ptr < dst_end_ptr) { DATA32 tmp; - DATA8 a; - - a = (A_VAL(src_ptr) * (A_VAL(&mul_color) + 1)) >> 8; - if (a) /* hmmm - do we need this? */ - { - BLEND_COLOR(a, R_VAL(dst_ptr), - ((R_VAL(src_ptr) * (R_VAL(&mul_color) + 1)) >> 8), R_VAL(dst_ptr), - tmp); - BLEND_COLOR(a, G_VAL(dst_ptr), - ((G_VAL(src_ptr) * (G_VAL(&mul_color) + 1)) >> 8), G_VAL(dst_ptr), - tmp); - BLEND_COLOR(a, B_VAL(dst_ptr), - ((B_VAL(src_ptr) * (B_VAL(&mul_color) + 1)) >> 8), B_VAL(dst_ptr), - tmp); - } + DATA8 a, r, g, b; + + MULT_COLOR(a, A_VAL(src_ptr), A_VAL(&mul_color), tmp); + if (!a) { src_ptr++; dst_ptr++; continue; } + + MULT_COLOR(r, R_VAL(src_ptr), R_VAL(&mul_color), tmp); + BLEND_COLOR(a, R_VAL(dst_ptr), r, R_VAL(dst_ptr), tmp); + MULT_COLOR(g, G_VAL(src_ptr), G_VAL(&mul_color), tmp); + BLEND_COLOR(a, G_VAL(dst_ptr), g, G_VAL(dst_ptr), tmp); + MULT_COLOR(b, B_VAL(src_ptr), B_VAL(&mul_color), tmp); + BLEND_COLOR(a, B_VAL(dst_ptr), b, B_VAL(dst_ptr), tmp); + src_ptr++; dst_ptr++; } + return; + } + + while (dst_ptr < dst_end_ptr) + { + DATA32 tmp; + DATA8 a, r, g, b; + + a = A_VAL(src_ptr); + if (!a) { src_ptr++; dst_ptr++; continue; } + if (a == 0xff) + { + MULT_COLOR(R_VAL(dst_ptr), R_VAL(src_ptr), R_VAL(&mul_color), tmp); + MULT_COLOR(G_VAL(dst_ptr), G_VAL(src_ptr), G_VAL(&mul_color), tmp); + MULT_COLOR(B_VAL(dst_ptr), B_VAL(src_ptr), B_VAL(&mul_color), tmp); + src_ptr++; dst_ptr++; continue; + } + MULT_COLOR(r, R_VAL(src_ptr), R_VAL(&mul_color), tmp); + BLEND_COLOR(a, R_VAL(dst_ptr), r, R_VAL(dst_ptr), tmp); + MULT_COLOR(g, G_VAL(src_ptr), G_VAL(&mul_color), tmp); + BLEND_COLOR(a, G_VAL(dst_ptr), g, G_VAL(dst_ptr), tmp); + MULT_COLOR(b, B_VAL(src_ptr), B_VAL(&mul_color), tmp); + BLEND_COLOR(a, B_VAL(dst_ptr), b, B_VAL(dst_ptr), tmp); + + src_ptr++; + dst_ptr++; } } #endif @@ -151,52 +176,78 @@ { DATA32 tmp; DATA8 a, aa; - - aa = (A_VAL(src_ptr) * (A_VAL(&mul_color) + 1)) >> 8; - if (aa) /* hmmm - do we need this? */ - { - a = _evas_pow_lut[aa][A_VAL(dst_ptr)]; - - BLEND_COLOR(a, R_VAL(dst_ptr), - R_VAL(src_ptr), R_VAL(dst_ptr), - tmp); - BLEND_COLOR(a, G_VAL(dst_ptr), - G_VAL(src_ptr), G_VAL(dst_ptr), - tmp); - BLEND_COLOR(a, B_VAL(dst_ptr), - B_VAL(src_ptr), B_VAL(dst_ptr), - tmp); - A_VAL(dst_ptr) = A_VAL(dst_ptr) + ((aa * (255 - A_VAL(dst_ptr))) / 255); - } + + MULT_COLOR(aa, A_VAL(src_ptr), A_VAL(&mul_color), tmp); + if (!aa) { src_ptr++; dst_ptr++; continue; } + + a = _evas_pow_lut[aa][A_VAL(dst_ptr)]; + BLEND_COLOR(aa, A_VAL(dst_ptr), 255, A_VAL(dst_ptr), tmp); + BLEND_COLOR(a, R_VAL(dst_ptr), + R_VAL(src_ptr), R_VAL(dst_ptr), + tmp); + BLEND_COLOR(a, G_VAL(dst_ptr), + G_VAL(src_ptr), G_VAL(dst_ptr), + tmp); + BLEND_COLOR(a, B_VAL(dst_ptr), + B_VAL(src_ptr), B_VAL(dst_ptr), + tmp); + src_ptr++; dst_ptr++; - } + } + return; } - else + + if (A_VAL(&mul_color) < 0xff) { while (dst_ptr < dst_end_ptr) { DATA32 tmp; - DATA8 a, aa; - - aa = (A_VAL(src_ptr) * (A_VAL(&mul_color) + 1)) >> 8; - if (aa) /* hmmm - do we need this? */ - { - a = _evas_pow_lut[aa][A_VAL(dst_ptr)]; - - BLEND_COLOR(a, R_VAL(dst_ptr), - ((R_VAL(src_ptr) * (R_VAL(&mul_color) + 1)) >> 8), R_VAL(dst_ptr), - tmp); - BLEND_COLOR(a, G_VAL(dst_ptr), - ((G_VAL(src_ptr) * (G_VAL(&mul_color) + 1)) >> 8), G_VAL(dst_ptr), - tmp); - BLEND_COLOR(a, B_VAL(dst_ptr), - ((B_VAL(src_ptr) * (B_VAL(&mul_color) + 1)) >> 8), B_VAL(dst_ptr), - tmp); - A_VAL(dst_ptr) = A_VAL(dst_ptr) + ((aa * (255 - A_VAL(dst_ptr))) / 255); - } + DATA8 a, aa, r, g, b; + + MULT_COLOR(aa, A_VAL(src_ptr), A_VAL(&mul_color), tmp); + if (!aa) { src_ptr++; dst_ptr++; continue; } + + a = _evas_pow_lut[aa][A_VAL(dst_ptr)]; + BLEND_COLOR(aa, A_VAL(dst_ptr), 255, A_VAL(dst_ptr), tmp); + MULT_COLOR(r, R_VAL(src_ptr), R_VAL(&mul_color), tmp); + BLEND_COLOR(a, R_VAL(dst_ptr), r, R_VAL(dst_ptr), tmp); + MULT_COLOR(g, G_VAL(src_ptr), G_VAL(&mul_color), tmp); + BLEND_COLOR(a, G_VAL(dst_ptr), g, G_VAL(dst_ptr), tmp); + MULT_COLOR(b, B_VAL(src_ptr), B_VAL(&mul_color), tmp); + BLEND_COLOR(a, B_VAL(dst_ptr), b, B_VAL(dst_ptr), tmp); + src_ptr++; dst_ptr++; } + return; + } + + while (dst_ptr < dst_end_ptr) + { + DATA32 tmp; + DATA8 a, aa, r, g, b; + + aa = A_VAL(src_ptr); + if (!aa) { src_ptr++; dst_ptr++; continue; } + if (aa == 0xff) + { + A_VAL(dst_ptr) = 0xff; + MULT_COLOR(R_VAL(dst_ptr), R_VAL(src_ptr), R_VAL(&mul_color), tmp); + MULT_COLOR(G_VAL(dst_ptr), G_VAL(src_ptr), G_VAL(&mul_color), tmp); + MULT_COLOR(B_VAL(dst_ptr), B_VAL(src_ptr), B_VAL(&mul_color), tmp); + src_ptr++; dst_ptr++; continue; + } + a = _evas_pow_lut[aa][A_VAL(dst_ptr)]; + BLEND_COLOR(aa, A_VAL(dst_ptr), 255, A_VAL(dst_ptr), tmp); + MULT_COLOR(r, R_VAL(src_ptr), R_VAL(&mul_color), tmp); + BLEND_COLOR(a, R_VAL(dst_ptr), r, R_VAL(dst_ptr), tmp); + MULT_COLOR(g, G_VAL(src_ptr), G_VAL(&mul_color), tmp); + BLEND_COLOR(a, G_VAL(dst_ptr), g, G_VAL(dst_ptr), tmp); + MULT_COLOR(b, B_VAL(src_ptr), B_VAL(&mul_color), tmp); + BLEND_COLOR(a, B_VAL(dst_ptr), b, B_VAL(dst_ptr), tmp); + + src_ptr++; + dst_ptr++; } } ------------------------------------------------------- This SF.Net email is sponsored by: IBM Linux Tutorials Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click _______________________________________________ enlightenment-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/enlightenment-devel