On Wed, 17 Mar 2004 02:51:15 -0500 Jose O Gonzalez <[EMAIL PROTECTED]> babbled:
>
> 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.
i tried this and tested it - it is, in fact, wrong :( sorry - the math doesn't
work you as you want it to - i actually tested it and the results were - well
catastrophically bad in terms of rendering display :( i can't put this in :(
thus i've had to go over the patches you have and look at them in detail and see
what ideas there are.
> 2) Add tests, where appropiate, for the blending alpha
> value cases 0 and 255, and replace the latter with simpler 'copy'
> type equations.
in fact I already did this - i did this with switch statements :) i did this as
part of going over your patches - i originally avoided the tests to avoid an
extra compare/branch cycle - but i never was sure if the extra compares and
branches were less overhead than the speed gain - so i never did it - they prove
on average to be at least the same speed, or a little faster, so it's in! :) but
i did it with switch statements instead :)
> 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; \
> }
hmm - this will definitely degrade performance - compare 3 ops on the old to 6
in the new. i'm not sure this is good - even with slightly improved accuracy. :(
> 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.
:) thanks for the patches! the special alpha 0/255/everything else definitely
helps. :) it's in (in concept) :)
> 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
--
------------- Codito, ergo sum - "I code, therefore I am" --------------
The Rasterman (Carsten Haitzler) [EMAIL PROTECTED]
熊耳 - 車君 (数田) [EMAIL PROTECTED]
Tokyo, Japan (東京 日本)
-------------------------------------------------------
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