[cairo] Creating a pattern

Carl Worth cworth at east.isi.edu
Thu Mar 25 08:11:18 PST 2004

On Mar 19, Ravindra wrote:
 > This code draws vertical lines those look almost fine. But there are two
 > problems with this approach. 
 > a) When we rotate the surface, all small parts that make surface get
 > rotated and all lines get broken. and 

Right. Drawing to a surface and the using that surface as a pattern
means that rasterization is performed prior to any transformation of
the pattern. Early rasterization like this leads to ugly artefacts
which you are seeing.

The fix would be to implement support for some sort of procedural
pattern that can accept cairo drawing operators. PostScript has a
function-based pattern, and we may be able to make a callback-based
pattern interface. I had played with this idea a little sometime ago,
but never finished it.

I'm hopeful that when David's new gradient pattern support gets
included, it might be easier to make an efficient implementation of
something like this.


More information about the cairo mailing list