[cairo] Clearing up misconceptions

Donn donn.ingle at gmail.com
Thu Dec 13 02:56:31 PST 2007


Okay,
 I made notes from all the suggestions about my diagram and I thought I had it 
in hand, but as I was drawing the next version I realized that I am still 
unsure about some basics. Please bear with me. Expect contradictions :)

Here are my assumptions:

Preparations and Actions:
I'll use Behdad's terms and avoid the horrible noun/verb thing.
Preparations are mostly path building commands. They also include clip. 
Others?
Actions are those commands that commit the "ink" (the source) to the 
Destination surface, like fill() and paint() etc.

The Cycle:
~> means "leads to"
Preparations ~> Path on a Mask ~> Actions (*) ~> Surface
(* Group Actions) ~> Pattern ~> Preparations 

The relationship between Pattern and Mask is unclear -- right now I think of 
them as synonyms, they are the same thing.

I have not tested anything to do with glyph array, where does it fit in?

Source:
1. Can be a pixel source
2. Can be a vector source

Source --> becomes a --> Pattern/Mask

Does a Pattern keep the basic nature of the original source; so PDF source --> 
PDF pattern is *still* vectors, while rgba source --> rgba pattern is still 
pixels?

Ink:
A rather vague term because Pattern is still confusing me. I think of it, 
right now, as either raw pixels or some kind of meta vector string.

Context:
I have shifted my thinking and I now place the context conceptually around 
the "mask" which, in my mind, is a kind of surface that the "operations" 
*actually* draw upon. It's only when an action (like fill) happens that the 
ink is moved to the final surface, via the mask.

Mask:
I really don't like the word 'mask'. I prefer a silkscreen analogy. The 
silkscreen is held by a metal frame (the context) and one draws shapes onto 
it (the "preparation") in a gooey paint that dries to form the final mask. 

It is the "mask" (or silkscreen) that can be transformed by matrix operations, 
thus setting it up at a particular aspect above the final Surface.

When one uses "groups", the Action does not commit to the Surface, but to a 
Pattern in memory. Again, the confusion between vector/pixmap nature of what 
that Pattern actually holds.

When one pops groups, a new source is made -- this is the same thing as having 
a new silkscreen and Actions then commit ink to the Surface.

Right, that should do for a start.
\d


More information about the cairo mailing list