This is the second in a series of patches to Evas files.

        The main thrust of these is to "improve" the drawing/blending
C functions in the "engines/common" dir via the following:

        1)  Replace the current formula for the new destination
alpha (when blending to rgba) by the formula
                BLEND_COLOR(a, A_VAL(dst), 255, A_VAL(dst), tmp)
where "a" is the relevant alpha value.

        2)  Add tests, where appropiate, for the blending alpha
value cases 0 and 255, and replace the latter with simpler 'copy'
type equations.

        3)  Improve the accuracy of the "blend_alpha_color_pixel"
and "blend_pixel_mult_pixel" types of functions by replacing
equations of the form
        nc = ((c + 1) * cc) >> 8
with a macro defined by
        MULT_COLOR(nc, c, cc, tmp)                        \
        {                                                 \
          (tmp) = (c) * (cc);                             \
          (nc) = ((tmp) + ((tmp) >> 8) + 0x80) >> 8;      \
        }

This can also be defined as  BLEND_COLOR(c, nc, cc, 0, tmp),
but I believe it merits its own separate definition.
        The macro has been added to the file "evas_common.h"
of the "include" dir, and is used by some of the subsequent
patches.

        This patch involves the above mentioned file, and the
file "evas_blend_ops.h"

                        jose.

-------------------------------------------------------------------------
----------------------------

----------------------------------------------
          for evas_blend_ops.h
----------------------------------------------

Index: cvs/e17/libs/evas/src/lib/engines/common/evas_blend_ops.h
===================================================================
RCS file:
/cvsroot/enlightenment/e17/libs/evas/src/lib/engines/common/evas_blend_op
s.h,v
retrieving revision 1.1
diff -u -r1.1 evas_blend_ops.h
--- cvs/e17/libs/evas/src/lib/engines/common/evas_blend_ops.h   30 Jan 2004
05:46:57 -0000  1.1
+++ cvs/e17/libs/evas/src/lib/engines/common/evas_blend_ops.h   17 Mar 2004
07:32:45 -0000
@@ -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);\
      } \
 }
 


----------------------------------------------
          for evas_common.h
----------------------------------------------

Index: cvs/e17/libs/evas/src/lib/include/evas_common.h
===================================================================
RCS file:
/cvsroot/enlightenment/e17/libs/evas/src/lib/include/evas_common.h,v
retrieving revision 1.23
diff -u -r1.23 evas_common.h
--- cvs/e17/libs/evas/src/lib/include/evas_common.h     30 Jan 2004 05:46:57
-0000   1.23
+++ cvs/e17/libs/evas/src/lib/include/evas_common.h     17 Mar 2004 07:17:19
-0000
@@ -545,6 +545,12 @@
 
 #define PIXEL_SOLID_ALPHA 0xff000000
 
+#define MULT_COLOR(nc, c, cc, tmp)                    \
+{                                                     \
+  (tmp) = (c) * (cc);                                 \
+  (nc) = ((tmp) + ((tmp) >> 8) + 0x80) >> 8;          \
+}
+
 #define SPANS_COMMON(x1, w1, x2, w2) \
 (!((((x2) + (w2)) <= (x1)) || ((x2) >= ((x1) + (w1)))))
 #define RECTS_INTERSECT(x, y, w, h, xx, yy, ww, hh) \




-------------------------------------------------------
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

Reply via email to