Enlightenment CVS committal
Author : raster
Project : e17
Module : libs/evas
Dir : e17/libs/evas/src/lib/engines/common
Modified Files:
evas_blend_alpha_color_pixel.c evas_blend_color_pixel.c
evas_blend_main.c evas_blend_ops.h
evas_blend_pixel_cmod_pixel.c evas_blend_pixel_mul_pixel.c
evas_blend_pixel_pixel.c evas_draw_main.c evas_line_main.c
evas_scale_smooth.c
Log Message:
lean down memory usage per process - now it doesnt use up 64kb it doesnt need
to... :)
===================================================================
RCS file:
/cvsroot/enlightenment/e17/libs/evas/src/lib/engines/common/evas_blend_alpha_color_pixel.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -3 -r1.6 -r1.7
--- evas_blend_alpha_color_pixel.c 6 Apr 2004 03:36:51 -0000 1.6
+++ evas_blend_alpha_color_pixel.c 10 May 2004 06:40:50 -0000 1.7
@@ -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 @@
*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);
===================================================================
RCS file:
/cvsroot/enlightenment/e17/libs/evas/src/lib/engines/common/evas_blend_color_pixel.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -3 -r1.6 -r1.7
--- evas_blend_color_pixel.c 6 Apr 2004 03:36:51 -0000 1.6
+++ evas_blend_color_pixel.c 10 May 2004 06:40:50 -0000 1.7
@@ -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 @@
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),
===================================================================
RCS file:
/cvsroot/enlightenment/e17/libs/evas/src/lib/engines/common/evas_blend_main.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -3 -r1.4 -r1.5
--- evas_blend_main.c 18 Mar 2004 09:06:12 -0000 1.4
+++ evas_blend_main.c 10 May 2004 06:40:50 -0000 1.5
@@ -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_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 @@
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;
}
}
}
===================================================================
RCS file:
/cvsroot/enlightenment/e17/libs/evas/src/lib/engines/common/evas_blend_ops.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -3 -r1.2 -r1.3
--- evas_blend_ops.h 6 Apr 2004 03:36:51 -0000 1.2
+++ evas_blend_ops.h 10 May 2004 06:40:50 -0000 1.3
@@ -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); \
===================================================================
RCS file:
/cvsroot/enlightenment/e17/libs/evas/src/lib/engines/common/evas_blend_pixel_cmod_pixel.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -3 -r1.5 -r1.6
--- evas_blend_pixel_cmod_pixel.c 6 Apr 2004 03:36:51 -0000 1.5
+++ evas_blend_pixel_cmod_pixel.c 10 May 2004 06:40:50 -0000 1.6
@@ -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 @@
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),
===================================================================
RCS file:
/cvsroot/enlightenment/e17/libs/evas/src/lib/engines/common/evas_blend_pixel_mul_pixel.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -3 -r1.6 -r1.7
--- evas_blend_pixel_mul_pixel.c 6 Apr 2004 03:36:51 -0000 1.6
+++ evas_blend_pixel_mul_pixel.c 10 May 2004 06:40:50 -0000 1.7
@@ -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 @@
*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 @@
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),
===================================================================
RCS file:
/cvsroot/enlightenment/e17/libs/evas/src/lib/engines/common/evas_blend_pixel_pixel.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -3 -r1.9 -r1.10
--- evas_blend_pixel_pixel.c 6 Apr 2004 03:36:51 -0000 1.9
+++ evas_blend_pixel_pixel.c 10 May 2004 06:40:50 -0000 1.10
@@ -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 @@
*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),
===================================================================
RCS file:
/cvsroot/enlightenment/e17/libs/evas/src/lib/engines/common/evas_draw_main.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -3 -r1.6 -r1.7
--- evas_draw_main.c 16 Dec 2003 17:49:45 -0000 1.6
+++ evas_draw_main.c 10 May 2004 06:40:50 -0000 1.7
@@ -1,5 +1,7 @@
#include "evas_common.h"
+extern DATA8 *_evas_pow_lut;
+
void
evas_common_draw_init(void)
{
@@ -565,6 +567,7 @@
{
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 @@
{
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 @@
{
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 @@
{
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 @@
{
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 @@
{
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 @@
{
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
===================================================================
RCS file:
/cvsroot/enlightenment/e17/libs/evas/src/lib/engines/common/evas_line_main.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -3 -r1.6 -r1.7
--- evas_line_main.c 6 Apr 2004 03:36:51 -0000 1.6
+++ evas_line_main.c 10 May 2004 06:40:50 -0000 1.7
@@ -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 @@
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 @@
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 @@
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 @@
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),
===================================================================
RCS file:
/cvsroot/enlightenment/e17/libs/evas/src/lib/engines/common/evas_scale_smooth.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -3 -r1.4 -r1.5
--- evas_scale_smooth.c 30 Jan 2004 05:46:57 -0000 1.4
+++ evas_scale_smooth.c 10 May 2004 06:40:50 -0000 1.5
@@ -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);
-------------------------------------------------------
This SF.Net email is sponsored by Sleepycat Software
Learn developer strategies Cisco, Motorola, Ericsson & Lucent use to
deliver higher performing products faster, at low TCO.
http://www.sleepycat.com/telcomwpreg.php?From=osdnemail3
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs