<html>
 <body>
  <div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
   <table bgcolor="#f9f3c9" width="100%" cellpadding="8" style="border: 1px #c9c399 solid;">
    <tr>
     <td>
      This is an automatically generated e-mail. To reply, visit:
      <a href="http://git.reviewboard.kde.org/r/102780/">http://git.reviewboard.kde.org/r/102780/</a>
     </td>
    </tr>
   </table>
   <br />



 <p>Ship it!</p>



 <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Ship It!</pre>
 <br />







<p>- Thorsten</p>


<br />
<p>On October 10th, 2011, 1:24 p.m., Lukáš Tvrdý wrote:</p>






<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="8" style="background-image: url('http://git.reviewboard.kde.org/media/rb/images/review_request_box_top_bg.png'); background-position: left top; background-repeat: repeat-x; border: 1px black solid;">
 <tr>
  <td>

<div>Review request for Calligra, Jan Hambrecht and Thorsten Zachmann.</div>
<div>By Lukáš Tvrdý.</div>


<p style="color: grey;"><i>Updated Oct. 10, 2011, 1:24 p.m.</i></p>






<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Description </h1>
 <table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
 <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Bugs: displays gradient of shapes from bug https://bugs.kde.org/show_bug.cgi?id=274909
Ellipsoid gradient is missing so far.

This patch adds support for ODF gradient style rectangular and square.

First I was trying to integrate gradients into KoGradientBackground, but shortly I noticed
that it is crashing as the editing tools require QGradient and are tied to it. So some abstraction
and re-factoring will be needed to support of creation and editing of the constructed ODF gradients.

Then I decided to introduce new class KoOdfGradientBackground which is not editable and integrate nicely.

Saving and loading of gradients work.

The gradients have many options like position, rotation, border. So far square gradients support 
all of them, though rotation of gradient is showing some artifacts, small pixels, I was not able to fix them. 
Rectangular type does not support rotation. 

Rotation would probably require to compute the gradient per pixel, which might be slow. I was trying to use QPainter and combination of QGradient and 
clipping to create the gradients effectively. I found inspiration here http://ariya.ofilabs.com/2011/06/rectangular-gradient.html
for square gradient.Rectangular gradient was done in similar way.

There was some problem with alias when rendering the gradients. First I was trying to solve it by supersampling,
then I wanted to use the exact size of the shape in pixels (without zooming). Then I ended up to compute
the pixel size of the shape on the canvas. 

There are two possibilities: to add new parameter KoViewConverter to paint method of the KoShapeBackground,
in the patch you can see it is not that much effort. Zagge was in a favor to not to add that parameter and 
he was suggesting to use QPainter's matrix as that one already includes the zooming information.

The patch includes the changes needed to include KoViewConverter, I will drop them if the preferred 
way is to use paint's QPainter matrix, which so far works as needed.

Square gradients in words
http://wstaw.org/m/2011/10/05/plasma-desktopoo2237.jpg

Rectangular gradients in words
http://wstaw.org/m/2011/10/05/plasma-desktopLg2237.jpg
</pre>
  </td>
 </tr>
</table>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Testing </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
 <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">I'm going to test it with cstester, I don't expect any regressions as the code handles previously non-handled ODF gradients.</pre>
  </td>
 </tr>
</table>




<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> </h1>
<ul style="margin-left: 3em; padding-left: 0;">

 <li>libs/flake/CMakeLists.txt <span style="color: grey">(dad0c9a)</span></li>

 <li>libs/flake/KoOdfGradientBackground.h <span style="color: grey">(PRE-CREATION)</span></li>

 <li>libs/flake/KoOdfGradientBackground.cpp <span style="color: grey">(PRE-CREATION)</span></li>

 <li>libs/flake/KoShape.cpp <span style="color: grey">(6b07e7c)</span></li>

</ul>

<p><a href="http://git.reviewboard.kde.org/r/102780/diff/" style="margin-left: 3em;">View Diff</a></p>




  </td>
 </tr>
</table>








  </div>
 </body>
</html>