lean down memory usage per process - now it doesnt use up 64kb it doesnt need

to... :)


SVN revision: 10153
This commit is contained in:
Carsten Haitzler 2004-05-10 06:40:51 +00:00
parent d6b340b674
commit e2725f4690
11 changed files with 36 additions and 26 deletions

View File

@ -4,7 +4,7 @@
#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
@ -158,7 +158,7 @@ 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)];
a = _evas_pow_lut[(aa << 8) | A_VAL(dst_ptr)];
BLEND_COLOR(aa, A_VAL(dst_ptr),
255, A_VAL(dst_ptr),
tmp);

View File

@ -4,7 +4,7 @@
#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
@ -94,7 +94,7 @@ evas_common_blend_color_rgba_to_rgba_c(DATA32 src, DATA32 *dst, int len)
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),

View File

@ -4,9 +4,7 @@
#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
@ -22,14 +20,16 @@ evas_common_blend_init(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++)
@ -37,8 +37,8 @@ evas_blend_init_evas_pow_lut(void)
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;
}
}
}

View File

@ -8,7 +8,7 @@
\
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); \

View File

@ -4,7 +4,7 @@
#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
@ -77,7 +77,7 @@ evas_common_blend_pixels_cmod_rgba_to_rgba_c(DATA32 *src, DATA32 *dst, int len,
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),

View File

@ -4,7 +4,7 @@
#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
@ -200,7 +200,7 @@ evas_common_blend_pixels_mul_color_rgba_to_rgba_c(DATA32 *src, DATA32 *dst, int
*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),
@ -239,7 +239,7 @@ evas_common_blend_pixels_mul_color_rgba_to_rgba_c(DATA32 *src, DATA32 *dst, int
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),

View File

@ -4,7 +4,7 @@
#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
@ -125,7 +125,7 @@ evas_common_blend_pixels_rgba_to_rgba_c(DATA32 *src, DATA32 *dst, int len)
*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),

View File

@ -1,5 +1,7 @@
#include "evas_common.h"
extern DATA8 *_evas_pow_lut;
void
evas_common_draw_init(void)
{
@ -565,6 +567,7 @@ evas_common_draw_func_blend_color_get(DATA32 src, RGBA_Image *dst, int pixels)
{
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
@ -585,6 +588,7 @@ evas_common_draw_func_blend_color_get(DATA32 src, RGBA_Image *dst, int pixels)
{
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
@ -619,6 +623,7 @@ evas_common_draw_func_blend_cmod_get(RGBA_Image *src, RGBA_Image *dst, int pixel
{
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
@ -630,6 +635,7 @@ evas_common_draw_func_blend_cmod_get(RGBA_Image *src, RGBA_Image *dst, int pixel
{
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
@ -648,6 +654,7 @@ evas_common_draw_func_blend_mul_get(RGBA_Image *src, DATA32 col, RGBA_Image *dst
{
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
@ -668,6 +675,7 @@ evas_common_draw_func_blend_mul_get(RGBA_Image *src, DATA32 col, RGBA_Image *dst
{
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
@ -694,6 +702,7 @@ evas_common_draw_func_blend_alpha_get(RGBA_Image *dst)
{
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

View File

@ -1,6 +1,6 @@
#include "evas_common.h"
extern DATA8 _evas_pow_lut[256][256];
extern DATA8 *_evas_pow_lut;
void
evas_common_line_init(void)
@ -54,7 +54,7 @@ evas_common_line_draw(RGBA_Image *dst, RGBA_Draw_Context *dc, int x1, int y1, in
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),
@ -133,6 +133,7 @@ evas_common_line_draw(RGBA_Image *dst, RGBA_Draw_Context *dc, int x1, int y1, in
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);
@ -146,7 +147,7 @@ evas_common_line_draw(RGBA_Image *dst, RGBA_Draw_Context *dc, int x1, int y1, in
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),
@ -185,7 +186,7 @@ evas_common_line_draw(RGBA_Image *dst, RGBA_Draw_Context *dc, int x1, int y1, in
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),

View File

@ -5,7 +5,6 @@
#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);

View File

@ -627,7 +627,8 @@ void evas_common_cpu_end_opt (void);
/****/
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);