[cairo] Serious concerns about cairo

Carl Worth cworth at cworth.org
Wed Sep 27 09:40:17 PDT 2006


On Wed, 27 Sep 2006 10:34:02 -0400, Behdad Esfahbod wrote:
> On Wed, 2006-09-27 at 04:10 -0400, Bertram Felgenhauer wrote:
> > > The biggest problem I have with Cairo is the fact that the pen and font
> > > is changed by the current transform
...
> That will keep working.  We are talking about these sequences:
>
>   cairo_set_pen_size
>   cairo_scale
>   cairo_stroke

So there's an interesting new use case that has just been proposed for
this.

Namely, within the mozilla project there is a desired to retrieve
device-space extents for fills and strokes, (where the
cairo_fill_extents and cairo_stroke_extents functions are defined as
returning user-space extents).

In the case of fill, the desired result can be achieved currently by
setting the CTM to an identity matrix, (that is making user space
identical to device space) and then calling cairo_fill_extents.

However, the same technique does not work for stroke extents since
changing the CTM also changes the stroke's line width. So I think
we've got a nice new argument here that the line width's CTM really
should be "locked" at the time of cairo_set_line_width.

Some time ago I made a very detailed proposal for this change, (and I
think the code I proposed is sitting on the line-width-scale branch in
my personal repository). If I remember correctly, the only cases not
handled by the patch I had at the time were things like SVG, PDF, and
PostScript stroking with a CTM different from the CTM used at the time
of cairo_set_line_width.

It really shouldn't be too difficult to have cairo detect those cases
and make it do a stroke-to-path then fill instead of a native stroke.

The other potential concern with the patch was inadvertent breakage of
existing applications. So if we're going to make this change, I'd
really like to get it into a snapshot right away, (along with things
like the new tessellator that people will be interested in testing),
so we can get some good testing before a release to see how badly some
applications might break (if at all) and give application authors some
time to adapt their programs before any release that includes the
change.

I'll also want to see my last message on this topic dug up to see if
there are any other issues I haven't raised again here.

If anyone wants to take a stab at this stuff before I get around to
it, that would be great.

-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.freedesktop.org/archives/cairo/attachments/20060927/54e711d9/attachment.pgp


More information about the cairo mailing list