Bug 4184

Summary: Wrong interpretation of FILTER for gradients
Product: cairo Reporter: Owen Taylor <otaylor>
Component: generalAssignee: Carl Worth <cworth>
Status: RESOLVED FIXED QA Contact: cairo-bugs mailing list <cairo-bugs>
Severity: normal    
Priority: high CC: jwatt
Version: 0.9.3   
Hardware: x86 (IA32)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:

Description Owen Taylor 2005-08-22 09:19:45 UTC
The gradient code in cairo-pattern.c does really funky things with
the "filter" setting of the pattern. It uses it to influence
how we interpolate between the color stops. For a gradient
from 0 to 1 you can get colors looking like:

       +-------
       |          (NEAREST)
       |
 ------+

    /
   /        (GOOD, BEST, BILINEAR)
  /
 /

     .-'''''
    /           (GAUSSIAN)
   /             
 ..

This is clearly wrong ... the color values should always
be the second image. Filtering is somewhat meaningful for
gradients that change very rapidly - imagine zooming out
to infinity on a white-black gradient with EXTEND_REPEAT -
we should get uniform gray, not white and black aliasing
artififacts. But that's subtle, and entirely different
from what is implemented currently.
Comment 1 Carl Worth 2005-08-22 17:14:06 UTC
Move bugs against "cvs" version to "0.9.3" so we can remove the "cvs" version.
Comment 2 Owen Taylor 2005-08-23 14:53:24 UTC
2005-08-23  Owen Taylor  <otaylor@redhat.com>

        * src/cairo-pattern.c (_cairo_pattern_calc_color_at_pixel):
        Rip out all the code for doing anything other than linear
        interpolation between color stops, instead of doing different
        funky things based on pattern->filter. (#4184)

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.