----- Original Message -----
From: "Carsten Haitzler (The Rasterman)" <[EMAIL PROTECTED]>
> really? evas doesn't use premul-alpha in its software or gl engines, and
> the
> xrender engine converts to premul to keep xrender happy. (nb - this is on
> the
> todo list to change to premul internally).
Here is the relevent code segment from evas_engine_directfb_image_draw
{
int r, g, b, a;
int mulr, mulg, mulb, mula;
int flags;
if (im->flags & RGBA_IMAGE_HAS_ALPHA)
flags = DSBLIT_BLEND_COLORALPHA | DSBLIT_BLEND_ALPHACHANNEL;
else
flags = DSBLIT_NOFX;
evas_engine_directfb_context_color_get(data, context, &r, &g, &b, &a);
if (evas_engine_directfb_context_multiplier_get
(data, context, &mulr, &mulg, &mulb, &mula))
{
re->backbuf->SetColor(re->backbuf, mulr, mulg, mulb, mula);
flags |= DSBLIT_COLORIZE;
}
else
{
re->backbuf->SetColor(re->backbuf, r, g, b, a);
}
re->backbuf->SetSrcBlendFunction(re->backbuf, DSBF_SRCALPHA);
img->SetSrcBlendFunction(img, DSBF_INVSRCALPHA);
re->backbuf->SetBlittingFlags(re->backbuf, flags);
re->backbuf->StretchBlit(re->backbuf, img, &inrect, &outrect);
}
As the code doesn't specify DSBLIT_SRC_PREMULTIPLY then
the expectation is that the source image is already premultiplied. Evas
images are always 32bit ARGB. Images loaded from sources without an
alpha channel get converted from the image provider and therefore get
an alpha of 1.0f (i.e. 255). So these are technically correctly
pre-multiplied.
For images with alpha then I guess it is up to the image creater to get
this right if they want correct blending.
The question of exactly what the combination of color alpha and alpha
channel
does still stands, the question of what Evas is trying to achieve is another
matter and I guess not of much interest to this list.
Regards,
-stephen
_______________________________________________
directfb-dev mailing list
[email protected]
http://mail.directfb.org/cgi-bin/mailman/listinfo/directfb-dev