#include "evas_mmx.h"
#endif
-extern DATA8 _evas_pow_lut[256][256];
+extern DATA8 *_evas_pow_lut;
extern const DATA16 _evas_const_c1[4];
#ifdef BUILD_C
*dst_ptr = col;
break;
default:
- a = _evas_pow_lut[aa][A_VAL(dst_ptr)];
+ a = _evas_pow_lut[(aa << 8) | A_VAL(dst_ptr)];
BLEND_COLOR(aa, A_VAL(dst_ptr),
255, A_VAL(dst_ptr),
tmp);
#include "evas_mmx.h"
#endif
-extern DATA8 _evas_pow_lut[256][256];
+extern DATA8 *_evas_pow_lut;
extern const DATA16 _evas_const_c1[4];
#ifdef BUILD_C
DATA32 tmp;
DATA8 a;
- a = _evas_pow_lut[A_VAL(&src)][A_VAL(dst_ptr)];
+ a = _evas_pow_lut[(A_VAL(&src) << 8) | A_VAL(dst_ptr)];
BLEND_COLOR(A_VAL(&src), A_VAL(dst_ptr),
255, A_VAL(dst_ptr),
#include "evas_mmx.h"
#endif
-static void evas_blend_init_evas_pow_lut(void);
-
-DATA8 _evas_pow_lut[256][256];
+DATA8 *_evas_pow_lut = NULL;
const DATA16 _evas_const_c1[4] = {1, 1, 1, 1};
void
evas_common_cpu_can_do(&mmx, &sse, &sse2);
- evas_blend_init_evas_pow_lut();
+/* evas_common_blend_init_evas_pow_lut(); */
}
void
-evas_blend_init_evas_pow_lut(void)
+evas_common_blend_init_evas_pow_lut(void)
{
int i, j;
-
+
+ _evas_pow_lut = malloc(256 * 256);
+ if (!_evas_pow_lut) return;
for (i = 0; i < 256; i++)
{
for (j = 0; j < 256; j++)
int divisor;
divisor = (i + (j * (255 - i)) / 255);
- if (divisor > 0) _evas_pow_lut[i][j] = (i * 255) / divisor;
- else _evas_pow_lut[i][j] = 0;
+ if (divisor > 0) _evas_pow_lut[(i << 8) | j] = (i * 255) / divisor;
+ else _evas_pow_lut[(i << 8) | j] = 0;
}
}
}
\
if (A_VAL(src)) /* hmmm - do we need this? */ \
{ \
- __a = _evas_pow_lut[A_VAL(src)][A_VAL(dst)]; \
+ __a = _evas_pow_lut[(A_VAL(src) << 8) | A_VAL(dst)]; \
BLEND_COLOR(A_VAL(src), A_VAL(dst), \
255, A_VAL(dst), \
__tmp); \
#include "evas_mmx.h"
#endif
-extern DATA8 _evas_pow_lut[256][256];
+extern DATA8 *_evas_pow_lut;
extern const DATA16 _evas_const_c1[4];
void
B_VAL(dst_ptr) = bmod[B_VAL(src_ptr)];
break;
default:
- a = _evas_pow_lut[aa][A_VAL(dst_ptr)];
+ a = _evas_pow_lut[(aa << 8) | A_VAL(dst_ptr)];
BLEND_COLOR(aa,A_VAL(dst_ptr),
255,A_VAL(dst_ptr),tmp);
BLEND_COLOR(a, R_VAL(dst_ptr),
#include "evas_mmx.h"
#endif
-extern DATA8 _evas_pow_lut[256][256];
+extern DATA8 *_evas_pow_lut;
extern const DATA16 _evas_const_c1[4];
#ifdef BUILD_C
*dst_ptr = *src_ptr;
break;
default:
- a = _evas_pow_lut[aa][A_VAL(dst_ptr)];
+ a = _evas_pow_lut[(aa << 8) | A_VAL(dst_ptr)];
BLEND_COLOR(aa, A_VAL(dst_ptr),
255, A_VAL(dst_ptr),
B_VAL(dst_ptr) = ((B_VAL(src_ptr) * (B_VAL(&mul_color) + 1)) >> 8);
break;
default:
- a = _evas_pow_lut[aa][A_VAL(dst_ptr)];
+ a = _evas_pow_lut[(aa << 8) | A_VAL(dst_ptr)];
BLEND_COLOR(aa, A_VAL(dst_ptr),
255, A_VAL(dst_ptr),
#include "evas_mmx.h"
#endif
-extern DATA8 _evas_pow_lut[256][256];
+extern DATA8 *_evas_pow_lut;
extern const DATA16 _evas_const_c1[4];
#ifdef BUILD_C
*dst_ptr = *src_ptr;
break;
default:
- a = _evas_pow_lut[aa][A_VAL(dst_ptr)];
+ a = _evas_pow_lut[(aa << 8) | A_VAL(dst_ptr)];
BLEND_COLOR(aa, A_VAL(dst_ptr),
255, A_VAL(dst_ptr),
#include "evas_common.h"
+extern DATA8 *_evas_pow_lut;
+
void
evas_common_draw_init(void)
{
{
if (dst->flags & RGBA_IMAGE_HAS_ALPHA)
{
+ if (!_evas_pow_lut) evas_common_blend_init_evas_pow_lut();
return evas_common_blend_color_rgba_to_rgba_c;
}
else
{
if (dst->flags & RGBA_IMAGE_HAS_ALPHA)
{
+ if (!_evas_pow_lut) evas_common_blend_init_evas_pow_lut();
return evas_common_copy_color_rgb_to_rgba_c;
}
else
{
if (dst->flags & RGBA_IMAGE_HAS_ALPHA)
{
+ if (!_evas_pow_lut) evas_common_blend_init_evas_pow_lut();
return evas_common_blend_pixels_cmod_rgba_to_rgba_c;
}
else
{
if (dst->flags & RGBA_IMAGE_HAS_ALPHA)
{
+ if (!_evas_pow_lut) evas_common_blend_init_evas_pow_lut();
return evas_common_copy_pixels_cmod_rgb_to_rgba_c;
}
else
{
if (dst->flags & RGBA_IMAGE_HAS_ALPHA)
{
+ if (!_evas_pow_lut) evas_common_blend_init_evas_pow_lut();
return evas_common_blend_pixels_mul_color_rgba_to_rgba_c;
}
else
{
if (dst->flags & RGBA_IMAGE_HAS_ALPHA)
{
+ if (!_evas_pow_lut) evas_common_blend_init_evas_pow_lut();
return evas_common_blend_pixels_mul_color_rgba_to_rgba_c;
}
else
{
if (dst->flags & RGBA_IMAGE_HAS_ALPHA)
{
+ if (!_evas_pow_lut) evas_common_blend_init_evas_pow_lut();
return evas_common_blend_alpha_color_rgba_to_rgba_c;
}
else
#include "evas_common.h"
-extern DATA8 _evas_pow_lut[256][256];
+extern DATA8 *_evas_pow_lut;
void
evas_common_line_init(void)
DATA8 __blend_a;
ptr = dst->image->data + (y1 * dst->image->w) + x1;
- __blend_a = _evas_pow_lut[A_VAL(&(col))][A_VAL(ptr)];
+ __blend_a = _evas_pow_lut[(A_VAL(&(col)) << 8) | A_VAL(ptr)];
BLEND_COLOR(A_VAL(&(col)), A_VAL(ptr),
255, A_VAL(ptr),
y = y1;
if (dst->flags & RGBA_IMAGE_HAS_ALPHA)
{
+ if (!_evas_pow_lut) evas_common_blend_init_evas_pow_lut();
if (ax > ay)
{
d = ay - (ax >> 1);
DATA32 __blend_tmp;
DATA8 __blend_a;
- __blend_a = _evas_pow_lut[A_VAL(&(col))][A_VAL(ptr)];
+ __blend_a = _evas_pow_lut[(A_VAL(&(col)) << 8) | A_VAL(ptr)];
BLEND_COLOR(A_VAL(&(col)), A_VAL(ptr),
255, A_VAL(ptr),
DATA32 __blend_tmp;
DATA8 __blend_a;
- __blend_a = _evas_pow_lut[A_VAL(&(col))][A_VAL(ptr)];
+ __blend_a = _evas_pow_lut[(A_VAL(&(col)) << 8) | A_VAL(ptr)];
BLEND_COLOR(A_VAL(&(col)), A_VAL(ptr),
255, A_VAL(ptr),
#include "evas_blend_ops.h"
-extern DATA8 _evas_pow_lut[256][256];
extern const DATA16 _evas_const_c1[4];
static DATA32 **scale_calc_y_points(DATA32 *src, int sw, int sh, int dh);
/****/
void evas_common_blend_init (void);
-
+void evas_common_blend_init_evas_pow_lut (void);
+
void evas_common_blend_pixels_rgba_to_rgb_c (DATA32 *src, DATA32 *dst, int len);
void evas_common_blend_pixels_rgba_to_rgb_mmx (DATA32 *src, DATA32 *dst, int len);
void evas_common_blend_pixels_rgba_to_rgba_c (DATA32 *src, DATA32 *dst, int len);