<html>
    <head>
      <base href="https://bugs.freedesktop.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - [PATCH] Implement ArthurOutputDev::axialShadedFill"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=103795">103795</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>[PATCH] Implement ArthurOutputDev::axialShadedFill
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>poppler
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>Other
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>medium
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>qt frontend
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>poppler-bugs@lists.freedesktop.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>oliver.sander@tu-dresden.de
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=135558" name="attach_135558" title="Patch implementing ArthurOutputDev::axialShadedFill">attachment 135558</a> <a href="attachment.cgi?id=135558&action=edit" title="Patch implementing ArthurOutputDev::axialShadedFill">[details]</a></span> <a href='page.cgi?id=splinter.html&bug=103795&attachment=135558'>[review]</a>
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.</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>