[cairo] Thoughts on plans for 1.6
Carl Worth
cworth at cworth.org
Thu Sep 6 10:38:50 PDT 2007
On Thu, 06 Sep 2007 10:37:24 +0100, Bill Spitzak wrote:
> I feel that the fixed result is actually the desired result in *all*
> cases. The default behavior sould be like EXTEND_PAD with the clipping
> quadralateral as shown in the above code. The EXTEND_PAD control itself
> would disable the clipping rectangle.
I sympathize with the desire to make this case easier to hit. I
definitely agree that it's very common to want to draw an image this
way, and it would indeed be nice if a simple cairo_paint would be
enough to get this behavior, (instead of using EXTEND_PAD,
cairo_rectangle, and cairo_fill).
However, I've still never seen any sane description of how to achieve
that. Are you proposing strictly an alternate extend mode?
CAIRO_EXTEND_DO_WHAT_WANT? If so, what are the exact semantics of it?
In IRC recently, Vladimir proposed some semantics for a
CAIRO_EXTEND_DO_WHAT_I_WANT and Owen Taylor pointed out that it would
result in non-antialiased edges for rotated images---definitely not
good.
Or are you proposing something much more magic than a new extend mode
such as "if the source pattern is an surface pattern with the default
extend mode, then implicitly add a rectangular clip before any drawing
operation". If that's the proposal, then I really don't like it for
contorting cairo's model so badly.
> However if forcing people to produce correct graphics was a goal, then it should
> have used EXTEND_PAD with no clipping as the default, because it then
> would be obvious that you need to do something to add an edge to the image.
In hindsight, that really might have been the best
solution---encouraging people to use cairo_rectangle;cairo_fill from
the beginning and having EXTEND_PAD as the default extend mode for
surface patterns, (it already is the default for gradient patterns,
for example).
So, if I had a time machine, I'd probably do that. As is though, it's
too late to change that semantic, (since it _would_ break a lot of
applications).
So I still think that teaching the EXTEND_PAD;cairo_rectangle;
cairo_fill idiom is our best plan going forward.
-Carl
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.cairographics.org/archives/cairo/attachments/20070906/ffa9bad0/attachment.pgp
More information about the cairo
mailing list