<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#ffffff">
    Am 24.01.2011 14:17, schrieb Carlos Garcia Campos:
    <blockquote cite="mid:1295874590-sup-2553@charizard" type="cite">
      <pre wrap="">Cairo 1.11.2 has a new mesh pattern that can be used to implement 6/7
type gradients. Adrian has an updated poppler branch that implements
mesh gradients in cairo backend:

<a class="moz-txt-link-freetext" href="http://cgit.freedesktop.org/~ajohnson/poppler/log/?h=mesh">http://cgit.freedesktop.org/~ajohnson/poppler/log/?h=mesh</a>

I've tried it and it works great, it fixes bugs #28836 and #32791 (and
maybe others). I haven't pushed the patch yet becuase it contains
minimal changes in Gfx.cc. If nobody objects I'll push it to master
branch only.
</pre>
    </blockquote>
    I had a quick look at what Adrian has done in Gfc.cc, and think,
    that is a little bit misusing of out-&gt;gouraudTriangleShadedFill(
    state, shading) and out-&gt;patchMeshShadedFill( state, shading):<br>
    <br>
    When these functions returns gTrue, this indicates that all work has
    already be done in the output device. How Adrian implements it is
    very special to Cairo. But it is quite ease to change it:<br>
    Just move the lines <br>
    <br>
    <div class="add">+ double xMin, yMin, xMax, yMax;</div>
    <div class="add">+</div>
    <div class="add">+ // get the clip region bbox</div>
    <div class="add">+ state-&gt;getUserClipBBox(&amp;xMin, &amp;yMin,
      &amp;xMax, &amp;yMax);</div>
    <div class="add">+ state-&gt;moveTo(xMin, yMin);</div>
    <div class="add">+ state-&gt;lineTo(xMin, yMax);</div>
    <div class="add">+ state-&gt;lineTo(xMax, yMax);</div>
    <div class="add">+ state-&gt;lineTo(xMax, yMin);</div>
    <div class="add">+ state-&gt;closePath();</div>
    <div class="add">+ if (!contentIsHidden())</div>
    <div class="add">+ out-&gt;fill(state);</div>
    <div class="add">+ state-&gt;clearPath();<br>
      <br>
      to CairoOutputDev::gouraudTriangleShadedFill respectively to
      CairoOutputDev::patchMeshShadedFill, i.e. if the actual
      implementation of gouraudTriangleShadedFill in CairoUtputDev would
      be renamed to formerGouraudTriangleShadedFill then do it like<br>
      <br>
      GBool CairoOutputDev::gouraudTriangleShadedFill(GfxState *state,
      GfxGouraudTriangleShading *shading) {<br>
              if (formerGouraudTriangleShadedFill(state, shading)) {<br>
      <div class="add">            double xMin, yMin, xMax, yMax;</div>
      <div class="add"><br>
      </div>
      <div class="add">             // get the clip region bbox</div>
      <div class="add">             state-&gt;getUserClipBBox(&amp;xMin,
        &amp;yMin, &amp;xMax, &amp;yMax);</div>
      <div class="add">             state-&gt;moveTo(xMin, yMin);</div>
      <div class="add">             state-&gt;lineTo(xMin, yMax);</div>
      <div class="add">             state-&gt;lineTo(xMax, yMax);</div>
      <div class="add">             state-&gt;lineTo(xMax, yMin);</div>
      <div class="add">             state-&gt;closePath();<br>
                     fill(state);<br>
                     state-&gt;clearPath();<br>
                     return gTrue;<br>
      </div>
              } else<br>
                  return gFalse;<br>
      }<br>
      <br>
      patchMeshShadedFill simular. Then You don't need to change Gfx,
      and it fits to the other shading routines.<br>
      <br>
      <br>
      Thomas<br>
      <br>
    </div>
    <br>
    <blockquote cite="mid:1295874590-sup-2553@charizard" type="cite">
      <pre wrap="">
Regards,

</pre>
      <pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
poppler mailing list
<a class="moz-txt-link-abbreviated" href="mailto:poppler@lists.freedesktop.org">poppler@lists.freedesktop.org</a>
<a class="moz-txt-link-freetext" href="http://lists.freedesktop.org/mailman/listinfo/poppler">http://lists.freedesktop.org/mailman/listinfo/poppler</a>
</pre>
    </blockquote>
    <br>
  </body>
</html>