[Poppler-bugs] [Bug 32349] Radial shading does not render correctly

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Thu Dec 16 08:18:32 PST 2010


https://bugs.freedesktop.org/show_bug.cgi?id=32349

--- Comment #2 from thomasf <Thomas.Freitag at alfa.de> 2010-12-16 08:18:33 PST ---
The problem here is that the shading is deeply non-linear, see comments in
Gfx::doRadialShFill:

        // The shading is not necessarily lineal so having two points with the
        // same color does not mean all the areas in between have the same
color too
        // Do another bisection to be a bit more sure we are not doing
something wrong

But in this case another bisection is definitely not enough. I'm not really
sure how many bisections would be enough to speed up rendering but not render
wrong, so if we comment the whole block:

/*
      if (isSameGfxColor(colorB, colorA, nComps, radialColorDelta) && ib <
radialMaxSplits) {
        // The shading is not necessarily lineal so having two points with the
        // same color does not mean all the areas in between have the same
color too
        // Do another bisection to be a bit more sure we are not doing
something wrong
        GfxColor colorC;
        int ic = (ia + ib) / 2;
        double sc = sMin + ((double)ic / (double)radialMaxSplits) * (sMax -
sMin);
        double tc = t0 + sc * (t1 - t0);
        getShadingColorRadialHelper(t0, t1, tc, shading, &colorC);
        if (isSameGfxColor(colorC, colorA, nComps, radialColorDelta)) {
          break;
        }
      }
*/

the rendering is okay. So there a lot of more circles to be paint, but because
radial shading seems to be use not much often, I assume we can live with the
lower speed!?
I tested this with the ducks & roses pdf, too, and also there the rendering
seems to be a little bit better. What Do You think about it, Albert?

-- 
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


More information about the Poppler-bugs mailing list