[Mono-osx] Alpha blending in libgdiplus (call for testers)
alexander.shulgin at yessoftware.com
Fri May 22 12:05:16 EDT 2009
Recently a whole set of issues in libgdiplus related to alpha blending
was discovered. They are summarized in this bug report:
Some important information can be found in the original mailing list
thread. In particular, motivation behind the changes is described
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
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) 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
$ 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
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.
More information about the Mono-osx