[cairo] upcoming changes to glitz and cairo

David Reveman c99drn at cs.umu.se
Thu Jun 10 13:30:58 PDT 2004


I've got a bunch of updates for glitz that haven't been committed yet.
Many of the updates are code cleanups and restructuring but there's also
a few bug fixes and a new alternative anti-aliasing method in there. All
changes are kind of related and that's why I haven't committed any of
them yet.

The new anti-aliasing method I've implemented is software
multi-sampling. It only requires a stencil buffer, so it should work
fine on most hardware. Hardware multi-sampling is still used by default
when available as it's generally much faster. However, there are
actually some advantages of using software multi-sampling:

Software multi-sampling is dynamic, hardware multi-sampling is generally
not. This means that with software multi-sampling, glitz will only turn
on multi-sampling when drawing polygons and not when doing normal image
compositing. So, for applications that use a lot of image compositing
and not so much polygon drawing, software multi-sampling will probably
be faster then hardware multi-sampling.

Right now only 4x software multi-sampling is supported and I'm not sure
about the sampling positions I currently use but with some tweaking we
should be able to get quite nice output. I can very easily add 8x or
even 16x multi-sampling for higher quality output.

cairo then,
I've made the changes needed for correct handling of the new
anti-aliasing method. I've also added image caching to the OpenGL
backend and it makes offscreen drawing a lot faster than before when
pbuffers are not available.

I've also fixed a problem with cairo's gradient patterns; instead of
pre-multiplying the color of gradient stops when stops are created, I've
made so that colors are pre-multiplied after interpolation. This should
make translucent gradients rendered more correctly.

I'll try to get all this committed in a day or two, I just want to make
sure that nothing serious is broken first. The new image cache in the
OpenGL backend seem to be working fine but there's one thing I'm a bit
concerned about; currently when image caching is used for an OpenGL
surface the set_image function will only take a reference to the image,
no actual copying. Is this a problem? I can't see a case where this will
be a problem but feels a bit dangerous and the image backend doesn't do
this so maybe it would be more safe to create real copy of the image.

The patches are too large for this mailing list, so you'll have to get
them from here:
http://www.cs.umu.se/~c99drn/

I've also put a new version of cairogears there. This new version allows
you to specify which anti-aliasing method you like to use. And here's a
screenshot from using software multi-sampling:
http://www.cs.umu.se/~c99drn/pics/cairogears-sw-ms.png
 
-David





More information about the cairo mailing list