[Mono-winforms-list] Alpha blending in libgdiplus (call for testers)

Alex Shulgin alexander.shulgin at yessoftware.com
Fri May 22 12:05:16 EDT 2009


Hi,

Recently a whole set of issues in libgdiplus related to alpha blending 
was discovered.  They are summarized in this bug report: 
https://bugzilla.novell.com/show_bug.cgi?id=495516

Some important information can be found in the original mailing list 
thread[1].  In particular, motivation behind the changes is described[2] 
in detail there.

In short: libgdiplus uses cairo to do drawing; cairo uses special PARGB 
format for pixels representation; libgdiplus tries to hide this fact 
from clients; this doesn't work out.

There's currently a patch to solve the issues, but it didn't see much 
testing.

If you are an active mono user (think System.Windows.Forms, 
System.Drawing) or you are porting existing code to mono, or you just 
feel adventurous then you can help by trying libgdiplus from SVN (or 
latest released tarball[3]) with the patch.

Please, if you wish for a brighter future for mono and have some spare 
time, try the following (instructions for Ubuntu):

# Install libs & tools needed to compile libgdiplus.
$ sudo apt-get build-dep libgdiplus

# Bootstrap build environment.  Add --prefix=/usr to replace version
# from package upon install (not needed if you use mono and class
# libraries from SVN, like me.)
~/src/mono/trunk/libgdiplus$ sh autogen.sh

# Apply the patch, download it first from bug report above.
$ patch -p0 <libgdiplus-pargb.patch

$ make
$ sudo make install

Now you can run System.Drawing tests if you have the class libraries 
sources, like this:

~/src/mono/trunk/mcs/class/System.Drawing$ make run-test PROFILE=net_2_0

As mentioned in the bugzilla entry, the patch as is breaks a few tests 
of icon to bitmap conversion.  You can silence them (not recommended) by 
applying this patch: https://bugzilla.novell.com/attachment.cgi?id=291608

It is generally wise to run the tests before and after applying the 
patch to see if there's any difference (you can always use patch -R to 
revert it).

If tests are looking good, please try do you daily stuff with mono and 
report any problems you think were introduced by the patch.  If you have 
some unit tests in your apps--please run them as well.

With your help I hope we can catch potential problems with the patch 
before the next mono release.

--
Happy hacking!
Alex

[1] http://go-mono.com/forums/#nabble-to22931264
[2] http://go-mono.com/forums/#nabble-p23232056
[3] http://ftp.novell.com/pub/mono/sources/libgdiplus/libgdiplus-2.4.tar.bz2


More information about the Mono-winforms-list mailing list