forked from enlightenment/efl
parent
f92a6c5b02
commit
920d353509
|
@ -7,3 +7,4 @@ Corey Donohoe <atmos@atmos.org>
|
|||
Yuri Hudobin <glassy_ape@users.sourceforge.net>
|
||||
Nathan Ingersoll <ningerso@d.umn.edu>
|
||||
Willem Monsuwe <willem@stack.nl>
|
||||
Jose O Gonzalez <jose_ogp@juno.com>
|
||||
|
|
|
@ -147,12 +147,10 @@ evas_common_blend_alpha_color_rgba_to_rgba_c (DATA8 *src, DATA32 *dst, int len,
|
|||
while (dst_ptr < dst_end_ptr)
|
||||
{
|
||||
DATA32 tmp;
|
||||
DATA8 a;
|
||||
DATA8 aa;
|
||||
DATA8 a, aa;
|
||||
|
||||
aa = (((*src_ptr) + 1) * A_VAL(&col)) >> 8;
|
||||
a = _evas_pow_lut[aa][A_VAL(dst_ptr)];
|
||||
switch (a)
|
||||
switch (aa)
|
||||
{
|
||||
case 0:
|
||||
break;
|
||||
|
@ -160,6 +158,10 @@ evas_common_blend_alpha_color_rgba_to_rgba_c (DATA8 *src, DATA32 *dst, int len,
|
|||
*dst_ptr = col;
|
||||
break;
|
||||
default:
|
||||
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(&col), R_VAL(dst_ptr),
|
||||
tmp);
|
||||
|
@ -169,7 +171,6 @@ evas_common_blend_alpha_color_rgba_to_rgba_c (DATA8 *src, DATA32 *dst, int len,
|
|||
BLEND_COLOR(a, B_VAL(dst_ptr),
|
||||
B_VAL(&col), B_VAL(dst_ptr),
|
||||
tmp);
|
||||
A_VAL(dst_ptr) = A_VAL(dst_ptr) + ((aa * (255 - A_VAL(dst_ptr))) / 255);
|
||||
break;
|
||||
}
|
||||
src_ptr++;
|
||||
|
|
|
@ -96,6 +96,9 @@ evas_common_blend_color_rgba_to_rgba_c(DATA32 src, DATA32 *dst, int len)
|
|||
|
||||
a = _evas_pow_lut[A_VAL(&src)][A_VAL(dst_ptr)];
|
||||
|
||||
BLEND_COLOR(A_VAL(&src), A_VAL(dst_ptr),
|
||||
255, A_VAL(dst_ptr),
|
||||
tmp);
|
||||
BLEND_COLOR(a, R_VAL(dst_ptr),
|
||||
R_VAL(&src), R_VAL(dst_ptr),
|
||||
tmp);
|
||||
|
@ -105,7 +108,6 @@ evas_common_blend_color_rgba_to_rgba_c(DATA32 src, DATA32 *dst, int len)
|
|||
BLEND_COLOR(a, B_VAL(dst_ptr),
|
||||
B_VAL(&src), B_VAL(dst_ptr),
|
||||
tmp);
|
||||
A_VAL(dst_ptr) = A_VAL(dst_ptr) + ((A_VAL(&src) * (255 - A_VAL(dst_ptr))) / 255);
|
||||
|
||||
dst_ptr++;
|
||||
}
|
||||
|
|
|
@ -9,6 +9,9 @@
|
|||
if (A_VAL(src)) /* hmmm - do we need this? */ \
|
||||
{ \
|
||||
__a = _evas_pow_lut[A_VAL(src)][A_VAL(dst)]; \
|
||||
BLEND_COLOR(A_VAL(src), A_VAL(dst), \
|
||||
255, A_VAL(dst), \
|
||||
__tmp); \
|
||||
BLEND_COLOR(__a, R_VAL(dst), \
|
||||
R_VAL(src), R_VAL(dst), \
|
||||
__tmp); \
|
||||
|
@ -18,7 +21,6 @@
|
|||
BLEND_COLOR(__a, B_VAL(dst), \
|
||||
B_VAL(src), B_VAL(dst), \
|
||||
__tmp); \
|
||||
A_VAL(dst) = A_VAL(dst) + ((A_VAL(src) * (255 - A_VAL(dst))) / 255);\
|
||||
} \
|
||||
}
|
||||
|
||||
|
|
|
@ -27,7 +27,10 @@ evas_common_blend_pixels_cmod_rgba_to_rgb_c(DATA32 *src, DATA32 *dst, int len, D
|
|||
case 0:
|
||||
break;
|
||||
case 255:
|
||||
*dst_ptr = *src_ptr;
|
||||
A_VAL(dst_ptr) = 0xff;
|
||||
R_VAL(dst_ptr) = rmod[R_VAL(src_ptr)];
|
||||
G_VAL(dst_ptr) = gmod[G_VAL(src_ptr)];
|
||||
B_VAL(dst_ptr) = bmod[B_VAL(src_ptr)];
|
||||
break;
|
||||
default:
|
||||
BLEND_COLOR(a, R_VAL(dst_ptr),
|
||||
|
@ -60,17 +63,23 @@ evas_common_blend_pixels_cmod_rgba_to_rgba_c(DATA32 *src, DATA32 *dst, int len,
|
|||
while (dst_ptr < dst_end_ptr)
|
||||
{
|
||||
DATA32 tmp;
|
||||
DATA8 a;
|
||||
|
||||
a = _evas_pow_lut[amod[A_VAL(src_ptr)]][A_VAL(dst_ptr)];
|
||||
switch (a)
|
||||
DATA8 a, aa;
|
||||
|
||||
aa = amod[A_VAL(src_ptr)];
|
||||
switch (aa)
|
||||
{
|
||||
case 0:
|
||||
break;
|
||||
case 255:
|
||||
*dst_ptr = *src_ptr;
|
||||
A_VAL(dst_ptr) = 0xff;
|
||||
R_VAL(dst_ptr) = rmod[R_VAL(src_ptr)];
|
||||
G_VAL(dst_ptr) = gmod[G_VAL(src_ptr)];
|
||||
B_VAL(dst_ptr) = bmod[B_VAL(src_ptr)];
|
||||
break;
|
||||
default:
|
||||
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),
|
||||
rmod[R_VAL(src_ptr)], R_VAL(dst_ptr),
|
||||
tmp);
|
||||
|
@ -80,8 +89,6 @@ evas_common_blend_pixels_cmod_rgba_to_rgba_c(DATA32 *src, DATA32 *dst, int len,
|
|||
BLEND_COLOR(a, B_VAL(dst_ptr),
|
||||
bmod[B_VAL(src_ptr)], B_VAL(dst_ptr),
|
||||
tmp);
|
||||
BLEND_COLOR(A_VAL(src),A_VAL(dst),255,A_VAL(dst),tmp);
|
||||
/* A_VAL(dst_ptr) = A_VAL(dst_ptr) + ((amod[A_VAL(src_ptr)] * (255 - A_VAL(dst_ptr))) / 255);*/
|
||||
break;
|
||||
}
|
||||
src_ptr++;
|
||||
|
|
|
@ -202,6 +202,9 @@ evas_common_blend_pixels_mul_color_rgba_to_rgba_c(DATA32 *src, DATA32 *dst, int
|
|||
default:
|
||||
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);
|
||||
|
@ -211,7 +214,6 @@ evas_common_blend_pixels_mul_color_rgba_to_rgba_c(DATA32 *src, DATA32 *dst, int
|
|||
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);
|
||||
break;
|
||||
}
|
||||
src_ptr++;
|
||||
|
@ -231,14 +233,17 @@ evas_common_blend_pixels_mul_color_rgba_to_rgba_c(DATA32 *src, DATA32 *dst, int
|
|||
case 0:
|
||||
break;
|
||||
case 255:
|
||||
A_VAL(dst_ptr) = 255;
|
||||
R_VAL(dst_ptr) = ((R_VAL(src_ptr) * (R_VAL(&mul_color) + 1)) >> 8);
|
||||
G_VAL(dst_ptr) = ((G_VAL(src_ptr) * (G_VAL(&mul_color) + 1)) >> 8);
|
||||
B_VAL(dst_ptr) = ((B_VAL(src_ptr) * (B_VAL(&mul_color) + 1)) >> 8);
|
||||
A_VAL(dst_ptr) = 255;
|
||||
break;
|
||||
default:
|
||||
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(&mul_color) + 1)) >> 8), R_VAL(dst_ptr),
|
||||
tmp);
|
||||
|
@ -248,7 +253,6 @@ evas_common_blend_pixels_mul_color_rgba_to_rgba_c(DATA32 *src, DATA32 *dst, int
|
|||
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);
|
||||
break;
|
||||
}
|
||||
src_ptr++;
|
||||
|
|
|
@ -4,8 +4,6 @@
|
|||
#include "evas_mmx.h"
|
||||
#endif
|
||||
|
||||
#define CONDITIONAL_BLEND 1
|
||||
|
||||
extern DATA8 _evas_pow_lut[256][256];
|
||||
extern const DATA16 _evas_const_c1[4];
|
||||
|
||||
|
@ -22,9 +20,11 @@ evas_common_blend_pixels_rgba_to_rgb_c(DATA32 *src, DATA32 *dst, int len)
|
|||
while (dst_ptr < dst_end_ptr)
|
||||
{
|
||||
DATA32 tmp;
|
||||
DATA8 a;
|
||||
|
||||
a = A_VAL(src_ptr);
|
||||
|
||||
#ifdef CONDITIONAL_BLEND
|
||||
switch (A_VAL(src_ptr))
|
||||
switch (a)
|
||||
{
|
||||
case 0:
|
||||
break;
|
||||
|
@ -32,31 +32,17 @@ evas_common_blend_pixels_rgba_to_rgb_c(DATA32 *src, DATA32 *dst, int len)
|
|||
*dst_ptr = *src_ptr;
|
||||
break;
|
||||
default:
|
||||
BLEND_COLOR(A_VAL(src_ptr), R_VAL(dst_ptr),
|
||||
BLEND_COLOR(a, R_VAL(dst_ptr),
|
||||
R_VAL(src_ptr), R_VAL(dst_ptr),
|
||||
tmp);
|
||||
BLEND_COLOR(A_VAL(src_ptr), G_VAL(dst_ptr),
|
||||
BLEND_COLOR(a, G_VAL(dst_ptr),
|
||||
G_VAL(src_ptr), G_VAL(dst_ptr),
|
||||
tmp);
|
||||
BLEND_COLOR(A_VAL(src_ptr), B_VAL(dst_ptr),
|
||||
BLEND_COLOR(a, B_VAL(dst_ptr),
|
||||
B_VAL(src_ptr), B_VAL(dst_ptr),
|
||||
tmp);
|
||||
break;
|
||||
}
|
||||
#else
|
||||
if (A_VAL(src_ptr))
|
||||
{
|
||||
BLEND_COLOR(A_VAL(src_ptr), R_VAL(dst_ptr),
|
||||
R_VAL(src_ptr), R_VAL(dst_ptr),
|
||||
tmp);
|
||||
BLEND_COLOR(A_VAL(src_ptr), G_VAL(dst_ptr),
|
||||
G_VAL(src_ptr), G_VAL(dst_ptr),
|
||||
tmp);
|
||||
BLEND_COLOR(A_VAL(src_ptr), B_VAL(dst_ptr),
|
||||
B_VAL(src_ptr), B_VAL(dst_ptr),
|
||||
tmp);
|
||||
}
|
||||
#endif
|
||||
src_ptr++;
|
||||
dst_ptr++;
|
||||
}
|
||||
|
@ -128,9 +114,10 @@ evas_common_blend_pixels_rgba_to_rgba_c(DATA32 *src, DATA32 *dst, int len)
|
|||
while (dst_ptr < dst_end_ptr)
|
||||
{
|
||||
DATA32 tmp;
|
||||
DATA8 a;
|
||||
DATA8 a, aa;
|
||||
|
||||
switch (A_VAL(src_ptr))
|
||||
aa = A_VAL(src_ptr);
|
||||
switch (aa)
|
||||
{
|
||||
case 0:
|
||||
break;
|
||||
|
@ -138,8 +125,11 @@ evas_common_blend_pixels_rgba_to_rgba_c(DATA32 *src, DATA32 *dst, int len)
|
|||
*dst_ptr = *src_ptr;
|
||||
break;
|
||||
default:
|
||||
a = _evas_pow_lut[A_VAL(src_ptr)][A_VAL(dst_ptr)];
|
||||
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);
|
||||
|
@ -149,7 +139,6 @@ evas_common_blend_pixels_rgba_to_rgba_c(DATA32 *src, DATA32 *dst, int len)
|
|||
BLEND_COLOR(a, B_VAL(dst_ptr),
|
||||
B_VAL(src_ptr), B_VAL(dst_ptr),
|
||||
tmp);
|
||||
A_VAL(dst_ptr) = A_VAL(dst_ptr) + ((A_VAL(src_ptr) * (255 - A_VAL(dst_ptr))) / 255);
|
||||
}
|
||||
src_ptr++;
|
||||
dst_ptr++;
|
||||
|
|
|
@ -31,6 +31,8 @@ evas_common_line_draw(RGBA_Image *dst, RGBA_Draw_Context *dc, int x1, int y1, in
|
|||
sx = SGN(dx);
|
||||
sy = SGN(dy);
|
||||
|
||||
col = dc->col.col;
|
||||
|
||||
if ((dx == 0) && (dy == 0))
|
||||
{
|
||||
if ((x1 < 0) ||
|
||||
|
@ -54,6 +56,9 @@ evas_common_line_draw(RGBA_Image *dst, RGBA_Draw_Context *dc, int x1, int y1, in
|
|||
ptr = dst->image->data + (y1 * dst->image->w) + x1;
|
||||
__blend_a = _evas_pow_lut[A_VAL(&(col))][A_VAL(ptr)];
|
||||
|
||||
BLEND_COLOR(A_VAL(&(col)), A_VAL(ptr),
|
||||
255, A_VAL(ptr),
|
||||
__blend_tmp);
|
||||
BLEND_COLOR(__blend_a, R_VAL(ptr),
|
||||
R_VAL(&(col)), R_VAL(ptr),
|
||||
__blend_tmp);
|
||||
|
@ -63,7 +68,6 @@ evas_common_line_draw(RGBA_Image *dst, RGBA_Draw_Context *dc, int x1, int y1, in
|
|||
BLEND_COLOR(__blend_a, B_VAL(ptr),
|
||||
B_VAL(&(col)), B_VAL(ptr),
|
||||
__blend_tmp);
|
||||
A_VAL(ptr) = A_VAL(ptr) + ((A_VAL(&(col)) * (255 - A_VAL(ptr))) / 255);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -86,8 +90,6 @@ evas_common_line_draw(RGBA_Image *dst, RGBA_Draw_Context *dc, int x1, int y1, in
|
|||
im = dst->image->data;
|
||||
im_w = dst->image->w;
|
||||
im_h = dst->image->h;
|
||||
col = dc->col.col;
|
||||
if (!A_VAL(&(col))) return;
|
||||
|
||||
ext_x = 0; ext_y = 0; ext_w = im_w; ext_h = im_h;
|
||||
if (dc->clip.use)
|
||||
|
@ -146,6 +148,9 @@ evas_common_line_draw(RGBA_Image *dst, RGBA_Draw_Context *dc, int x1, int y1, in
|
|||
|
||||
__blend_a = _evas_pow_lut[A_VAL(&(col))][A_VAL(ptr)];
|
||||
|
||||
BLEND_COLOR(A_VAL(&(col)), A_VAL(ptr),
|
||||
255, A_VAL(ptr),
|
||||
__blend_tmp);
|
||||
BLEND_COLOR(__blend_a, R_VAL(ptr),
|
||||
R_VAL(&(col)), R_VAL(ptr),
|
||||
__blend_tmp);
|
||||
|
@ -155,7 +160,6 @@ evas_common_line_draw(RGBA_Image *dst, RGBA_Draw_Context *dc, int x1, int y1, in
|
|||
BLEND_COLOR(__blend_a, B_VAL(ptr),
|
||||
B_VAL(&(col)), B_VAL(ptr),
|
||||
__blend_tmp);
|
||||
A_VAL(ptr) = A_VAL(ptr) + ((A_VAL(&(col)) * (255 - A_VAL(ptr))) / 255);
|
||||
}
|
||||
}
|
||||
if (x == x2) return;
|
||||
|
@ -183,6 +187,9 @@ evas_common_line_draw(RGBA_Image *dst, RGBA_Draw_Context *dc, int x1, int y1, in
|
|||
|
||||
__blend_a = _evas_pow_lut[A_VAL(&(col))][A_VAL(ptr)];
|
||||
|
||||
BLEND_COLOR(A_VAL(&(col)), A_VAL(ptr),
|
||||
255, A_VAL(ptr),
|
||||
__blend_tmp);
|
||||
BLEND_COLOR(__blend_a, R_VAL(ptr),
|
||||
R_VAL(&(col)), R_VAL(ptr),
|
||||
__blend_tmp);
|
||||
|
@ -192,7 +199,6 @@ evas_common_line_draw(RGBA_Image *dst, RGBA_Draw_Context *dc, int x1, int y1, in
|
|||
BLEND_COLOR(__blend_a, B_VAL(ptr),
|
||||
B_VAL(&(col)), B_VAL(ptr),
|
||||
__blend_tmp);
|
||||
A_VAL(ptr) = A_VAL(ptr) + ((A_VAL(&(col)) * (255 - A_VAL(ptr))) / 255);
|
||||
}
|
||||
}
|
||||
if (y == y2) return;
|
||||
|
|
Loading…
Reference in New Issue