[cairo] Redoing SOURCE and CLEAR
Keith Packard
keithp at keithp.com
Wed Aug 17 10:59:02 PDT 2005
Cworth and I were chatting last night about this issue, and he explained
the three proposed functions for various operators:
1) (source IN shape IN clip) OP dest
2) clip ? (source IN shape OP dest) ? dest
3) (shape IN clip) ? (source OP dest) ? dest
I've placed these in the order they were developed.
Given that we developed 2) in response to the fact that 1) affects areas
beyond the clip for some operators, and that we developed 3) in response
to the fact that some operators appear to ignore shape, I'm wondering if
we shouldn't simplify our lives and reduce the explanation of the
operator (which seems important to me) to:
"Apply the source using OP to the destination, restricted to the area
inside the clip and shape."
This seems easy to explain (a big plus), and results in a single
function (3) used for all operators. Is there some fundemental operation
which is difficult or impossible to perform with this model?
One thing which is now 'harder' is constructing a mask from a shape,
before you'd just use SOURCE which would clear areas inside the clip but
outside the shape. Now, you'd first clear the destination, then draw the
shape and OVER (or SOURCE) the shape. I think any time we can encourage
people to use OVER is a good thing as it's the easiest operator to
explain, so in some ways this is a "good thing", although it does take
another step.
-keith
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://lists.freedesktop.org/archives/cairo/attachments/20050817/90daa5b1/attachment-0001.pgp
More information about the cairo
mailing list