[cairo] [RFC] cairo_path_extents()

Baz brian.ewins at gmail.com
Sat Jan 19 19:36:44 PST 2008


On Jan 19, 2008 12:13 AM, Carl Worth <cworth at cworth.org> wrote:
> On Thu, 22 Nov 2007 17:32:24 +0000, Baz wrote:
> > > > > Behdad suggested adding a cairo_path_extents() call to meet their
> > > > > need; to me this sounds like a better option than special-casing
> > > > > stroke_extents or fill_extents for hairlines. The proposed api is:
> > > > >
> > > > > void        cairo_path_extents (cairo_t *cr,
> > > > >                                              double *x1,
> > > > >                                              double *y1,
> > > > >                                              double *x2,
> > > > >                                              double *y2);
>
> Hi Baz,
>
> I like this, and I want to get this into 1.6, (sorry I've been so slow
> to get around to reviewing it). I'm happy with the API above and its
> documentations.
>
> > 'obviously wrong' in the bug. Reading back I havent made it clear that
> > the first of these patches changes the behaviour of
> > _cairo_analysis_surface_intersect_clip_path and _cairo_path_bounds to
> > use the tight bounds instead of the control box, which will make that
> > code slower.
>
> Looking through the implementation, I'd like this change to be
> separated from the addition of the _cairo_path_fixed_interpret_flat
> commit. That kind of mixing of unrelated changes sounds like just
> setting ourselves up for some trouble later.
>
> Also, we should switch existing code that also does its own
> flattening, (like _cairo_path_count and _cairo_path_populate), over to
> use the new function. But that could even be a new change on top of
> the existing stuff.
>
> If you'd like to work on splitting this stuff up, I'd be happy to take
> it from there. Otherwise, I'll try to get around to doing that when I
> can.

How's this?
http://gitweb.freedesktop.org/?p=users/brianewins/cairo;a=shortlog;h=path-extents1

Brought up to date, split the first patch into two and had a stab at
_cairo_path_count/_cairo_path_populate too.  Unfortunately my head's
spinning with a cold right now, can't really do much more with this
until I'm coherent again. Feel free to cherry pick if you want, I
expect I'm just going to lie in my bed tomorrow :(

>
> Thanks again for your contributions,
>
> -Carl
>


More information about the cairo mailing list