Comment 41 for bug 168610

Revision history for this message
In , Adrian Johnson (ajohnson-redneon) wrote :

(In reply to comment #16)
> (In reply to comment #15)
> > Created an attachment (id=26402) [details] [details]
> > Implement axialShadedFill() in cairo backend using cairo linear gradient
> > patterns
> >
> > poppler/CairoOutputDev.cc | 297 +++++++++++++++++++++++++++++++++++++++++++++
> > poppler/CairoOutputDev.h | 6 +
> > 2 files changed, 303 insertions(+), 0 deletions(-)
> >
> > This patch implements linear gradients in cairo backend. I'm not a cairo guru
> > so I'm not sure it's completely right, it fixes the problem with the first
> > attachment.
> >
>
> The use of cairo looks fine. Would it be better to avoid duplicating the
> bisection code from Gfx and instead add a new axial shading OutputDev function
> that provides the coordinates of each stop?
>

On closer inspection the use of cairo is less than ideal. It would be better to use the actual stops in the shading in the case of linear interpolation (Type 2 Exponential functions with N=1) and fallback to bisection for other cases. This would allow cairo to do the linear interpolation where possible.