[cairo] Optimize horizontal/vertical gradients
David Reveman
davidr at novell.com
Tue Mar 8 05:53:17 PST 2005
On Sun, 2005-03-06 at 15:24 -0500, Owen Taylor wrote:
> David Reveman wrote:
>
> >>It probably would make sense to rename various variables to match
> >>the comment and the current logic, but I haven't yet done so
> >>so as to keep the patch more reviewable.
> >
> >
> > Yes, do that before committing it.
>
> Done.
>
> >>I couldn't figure out a good way to share the gradient computation
> >>logic between _cairo_linear_pattern_classify _and
> >>cairo_image_data_set_linear so it's just duplicated.
> >
> >
> > That's OK for now. We probably like to restructure some of these
> > gradient functions a bit when we change so that the pattern filter is no longer
> > used for interpolation between color stops. We might be able to make these
> > gradient computations shareable at the same time but I think we should
> > wait until after the upcoming snapshot release before we do any of
> > this.
>
> Shouldn't we just always be doing linear interpolation? The guassian
> interpolation you have (is that for highlights
> with radial gradients?) seems like it should just be handled by
> adding more stops to the gradient. And nearest neighbour interpolation
> is going to look pretty horrible.
Yes, we should just throw away gaussian and nearest neighbor
interpolation between color stops. I think the pattern filter should be
used the same way as for surface patterns, bilinear being kind of a
special case, which would produce smooth edges between color stops
without being too inefficient.
-David
More information about the cairo
mailing list