[cairo] Thoughts on plans for 1.6

Bill Spitzak spitzak at thefoundry.co.uk
Thu Sep 6 11:57:44 PDT 2007

Carl Worth wrote:

> 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.

I think this is what I was proposing. I didn't see it as being too 
complicated, though. As I saw it, all the graphics act just like the 
current version with EXTEND_PAD turned on (the current results when 
EXTEND_PAD is turned off would no longer be producable). The EXTEND_PAD 
control is changed so that when it is on, it acts like now, and when it 
is off, it adds this rectangular clip (actually an arbitrary 
quadralateral, depending on the source image's transform).

The edges would be antialiased. If the image was a solid white image, it 
would be exactly the same as painting the rectangle in source 
coordinates with the paint.

The biggest problem I see is that if in fact the user clipped to a 
matching rectangle, the edges would get double-premultiplied. For 
instance if they tried to tile an area with rectangles with pictures on 
them, they would get darker lines between them than they would otherwise.

>> 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.

Fine with me.

More information about the cairo mailing list