[Poppler-bugs] [Bug 103795] New: [PATCH] Implement ArthurOutputDev::axialShadedFill

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Fri Nov 17 16:09:46 UTC 2017


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

            Bug ID: 103795
           Summary: [PATCH] Implement ArthurOutputDev::axialShadedFill
           Product: poppler
           Version: unspecified
          Hardware: Other
                OS: All
            Status: NEW
          Severity: normal
          Priority: medium
         Component: qt frontend
          Assignee: poppler-bugs at lists.freedesktop.org
          Reporter: oliver.sander at tu-dresden.de

Created attachment 135558
  --> https://bugs.freedesktop.org/attachment.cgi?id=135558&action=edit
Patch implementing ArthurOutputDev::axialShadedFill

The attached patch implements ArthurOutputDev::axialShadedFill. This does not
improve the rendering quality much, because the fall-back approximation code in
Gfx does a pretty good job at it.  However, the new code

- Should be faster
- Does improve rendering a little bit: Previously, axial gradients showed
spurious thin white lines when rendered with the arthur backend
- Is a warm-up exercise for radial gradients, which do look strange when
rendered with Arthur.

Unfortunately I only have a few documents with axial gradients.  Some extra
testing would be appreciated!

Unlike CairoOutputDev the Arthur implementation does not use the
updateFillColorStop mechanism, but rather implements the entire QLinearGradient
setup and painting in the axialShadedFill method.  This makes the code a bit
longer, but:

- It avoids having to add additional internal state to the
  ArthurOutputDev class. This makes debugging easier.
- Besides computing color stops, the method Gfx::doAxialShFill
  (which is the one that calls updateFillColorStop) does many
  other things that are not actually needed when using Qt for
  painting the gradient.  In particular, it constructs a sequence
  of small rectangles to approximate the gradient, which are
  then never used.
- Gfx::doAxialShFill assumes that the output devices can only paint
  polygons with a single color.  Therefore it needs to construct
  lots of such polygons to approximate a smooth gradient.
  However, QPainter can do linear interpolation of colors
  itself.  The new bisection implementation in Arthur::axialShadedFill
  takes this into account, and therefore produces a much smaller
  number of color stops in many cases.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/poppler-bugs/attachments/20171117/a5b42d39/attachment.html>


More information about the Poppler-bugs mailing list