Tuesday, December 6, 2011

Linux & Cairo

In Real Studio 2011 Release 4 we upgraded our Graphics drawing on Linux to use Cairo instead of the antiquated GDK drawing system. For those unfamiliar with Linux, Cairo is akin to GDI+ on Windows, or CoreGraphics on OS X.

The main benefits to switching to Cairo include: smoother drawing because of anti-aliasing, translucency support and hardware accelerated drawing. See figure below for a comparison of Cairo drawing (top) and GDK drawing (bottom)

Another important reason for switching to Cairo is because 2011 Release 4 introduces alpha channel support for Pictures. This would have been excruciatingly painful to do in GDK (and GDI on Windows for that matter), so the upgrade to Cairo was a necessity.

An additional gain from this upgrade is improved printing support on Linux. Although we resolved the issue with only being able to print at 72 DPI in a previous release, the fact that we created an offscreen picture and scaled the text was a show stopper for many. Now that our printing API uses Cairo and our Graphics drawing is also using Cairo, this transitory picture we had to keep around before is essentially out of the picture now, pardon the pun.

1 comment:

dur.jes said...

Thank you for the Graphics improvements. I'm noticing benefits on OS X too. Cocoa is pretty stable now and I'm seeing that it's massively faster than Carbon when drawing pictures containing masks, as well as pictures in which Picture.Transparent=1. Other graphics operations are faster in Cocoa too, though the difference is more modest.