Jack,

It sounds like you are running into the normal issue of classic blending.  
Classic blending assumes that there is nothing behind the destination but 
infinite blackness.  The solution is to use pre-multiplied alpha surfaces and 
the appropriate Porter-Duff rule.  Might I recommend DSPD_SRC_OVER.  It will 
take some work to ensure that everything is pre-multiplied alpha.  The image 
provider, if I remember correctly, will pre-multiply the colors if the surface 
cap is set to DSCAPS_PREMULTIPLIED.  Also, the fonts I believe are 
pre-multiplied.  

Quick Porter-Duff primer:  
Normal blending of semi-transparent colors results in "alpha holes" punched 
through opaque destination colors. (Suddenly I can see through the opaque wall! 
 Or in your case, I see the video in the plane behind this one.)  For 
Porter-Duff to work, all colors need to be pre-multiplied and the appropriate 
src/dst blend functions set.  DirectFB provides a shortcut called SetPorterDuff 
that sets both at the same time.  If you don't have pre-multiplied colors (and 
your graphics driver supports it), set DSBLIT_SRC_PREMULTIPLY to have the 
blender pre-multiply your source colors.  Set DSBLIT_DST_PREMULTIPLY to 
pre-multiply your dest colors.  And remember that the result of a Porter-Duff 
blend is also pre-multiplied, set DSBLIT_DEMULTIPLY if your destination isn't 
pre-multiplied.  That should do it! 

Good luck!

Bryce Poole
Intel Corporation

-----Original Message-----
From: directfb-dev-boun...@directfb.org 
[mailto:directfb-dev-boun...@directfb.org] On Behalf Of MrPeach
Sent: Thursday, April 02, 2009 1:34 PM
To: directfb-dev@directfb.org
Subject: [directfb-dev] df_andi and surface alpha

Hi,

Now that I have my DFB driver fully functional, our client is seeing
things they don't like and are asking for us to resolve them. :/

When running df_andi, the status text is displayed in a rectangle in
the upper left of the screen, and that rectangle is filled with a
color which includes an alpha factor. That alpha value is being used
not only for blending the RGB values (the background and the
penguins), but the alpha values as well, which leaves the surface
alpha not == 0xff.

They have video running on another plane, and in this rectangle they
are seeing video blending. They don't like this. Can you suggest
changes to df_andi that will result in no non-0xff alpha values in the
display surface?

Thanks!

-Jack
_______________________________________________
directfb-dev mailing list
directfb-dev@directfb.org
http://mail.directfb.org/cgi-bin/mailman/listinfo/directfb-dev
_______________________________________________
directfb-dev mailing list
directfb-dev@directfb.org
http://mail.directfb.org/cgi-bin/mailman/listinfo/directfb-dev

Reply via email to