I’m always after good and clever tricks to improve the visual quality of rendered graphics (without hogging the CPU/GPU if possible). One of those tricks I demonstrate in gl-cairo-aatrick. It’s only for a limited number of use-cases I admit, but still of value for some bits in e.g. the newer cairo-clock, some CoverFlow-like plugin for rhythmbox or banshee and things like that.
The main idea behind it is to leverage the texture-filtering hardware of OpenGL-cards and “abuse” it for edge anti-aliasing of single quads or rectangles. Slightly trim the texture-image via cairo before uploading it to the OpenGL-card as a texture-object. You can easily cut out a fine thin line around the edges of a texture-image and at the same time - since using cairo - add some nicely rounded corners to it. How much to cut out can be controlled via a few parameters (see the use of cairo_draw_round_rect() in cairo_trim_image()). The names for those custom functions are not the wisest, as they imply to be part of the cairo-API, which they are not. But for the purpose of demonstration the chosen names are good enough.
To emphasize the visual impact of the trick here’s a close look at the edges of an image trimmed in gimp and applied as a texture, an image trimmed via cairo and applied as texture and finally an unaltered image applied as texture.

(click for full-size image)
|
The benefit of the improved quality is very obvious. Here’s a quick screencast too…

(click to play back, ogg/theora, ~1.4 MBytes) |

(click to play back, ogg/theora, ~3.9 MBytes) |
Sorry for the dropped frames in the screencast. I was in a hurry and didn’t pay much attention to the recording.
You can grab and read (again) about the new examples here. Since I’m able to host my git repositories now at freedesktop you can check them via gitweb there. Over time all my stuff will show up there, also cairo-clock and lowfat.