[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kwin
Subject:    Re: Review Request: Refactor outline code
From:       Thomas_Lübking <thomas.luebking () web ! de>
Date:       2011-03-15 20:34:13
Message-ID: 20110315203413.32746.72223 () vidsolbach ! de
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


> On March 13, 2011, 1:29 p.m., Thomas Lübking wrote:
> > kwin/outline.cpp, line 133
> > <http://git.reviewboard.kde.org/r/100848/diff/1/?file=11230#file11230line133>
> > 
> > since it's just a vertical reflection, you could just keep the above pixmap in \
> > context and 
> > for (int i = 0; i<4; ++i)
> > p.drawPixmap(0,i, topPix, 0,3-i, topPix.width(), 1);
> > 
> > you can also keep the painter and p.begin(&pix) instead of QPainter p(&pix) - \
> > it's only buggy in Qt if you change the renderengine (ie. use it on an image and \
> > then on a pixmap)

fixing myself: 2+2=5...
for (int i = 0; i<5; ++i)
   p.drawPixmap(0,i, topPix, 0,4-i, topPix.width(), 1);

if you want to spare allocating the "large" pixmap twice in a block you could also \
just mirror the corners in one 5x5 tmp pixmap


- Thomas


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/100848/#review1930
-----------------------------------------------------------


On March 13, 2011, 12:37 p.m., Arthur Arlt wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://git.reviewboard.kde.org/r/100848/
> -----------------------------------------------------------
> 
> (Updated March 13, 2011, 12:37 p.m.)
> 
> 
> Review request for kwin.
> 
> 
> Summary
> -------
> 
> This patch refactors the code for outlining geometries to an own class Outline. It \
> is used by tabbox and quick tiling. There were two similar implementations for both \
> functionalities which are now refactored to a new class Outline. This class \
> provides the X implementation for showing and hiding an outline of a given \
> geometry. For the future this functionality could be replaced by an effect.
> 
> 
> Diffs
> -----
> 
> kwin/CMakeLists.txt 976c831 
> kwin/geometry.cpp 88719bf 
> kwin/outline.h PRE-CREATION 
> kwin/outline.cpp PRE-CREATION 
> kwin/tabbox.h 1f02b1f 
> kwin/tabbox.cpp e2d07fe 
> kwin/tabbox/tabboxhandler.h 96a1fc6 
> kwin/tabbox/tabboxhandler.cpp b178efe 
> kwin/workspace.h fe97c77 
> kwin/workspace.cpp 43e3e8c 
> 
> Diff: http://git.reviewboard.kde.org/r/100848/diff
> 
> 
> Testing
> -------
> 
> Quick Tiling and tabbox works with this implementation.
> 
> 
> Thanks,
> 
> Arthur
> 
> 


[Attachment #5 (text/html)]

<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/100848/">http://git.reviewboard.kde.org/r/100848/</a>
  </td>
    </tr>
   </table>
   <br />








<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: \
10px;">  <p style="margin-top: 0;">On March 13th, 2011, 1:29 p.m., <b>Thomas \
Lübking</b> wrote:</p>  <blockquote style="margin-left: 1em; border-left: 2px solid \
#d0d0d0; padding-left: 10px;">  



<table width="100%" border="0" bgcolor="white" style="border: 1px solid #C0C0C0; \
border-collapse: collapse; margin: 2px padding: 2px;">  <thead>
  <tr>
   <th colspan="4" bgcolor="#F0F0F0" style="border-bottom: 1px solid #C0C0C0; \
font-size: 9pt; padding: 4px 8px; text-align: left;">  <a \
href="http://git.reviewboard.kde.org/r/100848/diff/1/?file=11230#file11230line133" \
style="color: black; font-weight: bold; text-decoration: \
underline;">kwin/outline.cpp</a>  <span style="font-weight: normal;">

     (Diff revision 1)

    </span>
   </th>
  </tr>
 </thead>

 <tbody style="background-color: #e4d9cb; padding: 4px 8px; text-align: center;">
  <tr>

   <td colspan="2"><pre style="font-size: 8pt; line-height: 140%; margin: 0; \
"></pre></td>  <td colspan="2"><pre style="font-size: 8pt; line-height: 140%; margin: \
0; ">void Outline::showXOutline()</pre></td>

  </tr>
 </tbody>




 
 



 <tbody>

  <tr>
    <th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" \
align="right"><font size="2"></font></th>  <td bgcolor="#c5ffc4" width="50%"><pre \
style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>  <th \
bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid \
#C0C0C0;" align="right"><font size="2">133</font></th>  <td bgcolor="#c5ffc4" \
width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">        <span \
class="n">QPixmap</span> <span class="n">pix</span><span class="p">(</span><span \
class="n">m_outlineGeometry</span><span class="p">.</span><span \
class="n">width</span><span class="p">(),</span> <span class="mi">5</span><span \
class="p">);</span></pre></td>  </tr>

 </tbody>

</table>

  <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: \
-pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">since it&#39;s just a \
vertical reflection, you could just keep the above pixmap in context and

for (int i = 0; i&lt;4; ++i)
   p.drawPixmap(0,i, topPix, 0,3-i, topPix.width(), 1);

you can also keep the painter and p.begin(&amp;pix) instead of QPainter p(&amp;pix) - \
it&#39;s only buggy in Qt if you change the renderengine (ie. use it on an image and \
then on a pixmap)</pre>  </blockquote>





</blockquote>
<pre style="margin-left: 1em; white-space: pre-wrap; white-space: -moz-pre-wrap; \
white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">fixing \
myself: 2+2=5... for (int i = 0; i&lt;5; ++i)
   p.drawPixmap(0,i, topPix, 0,4-i, topPix.width(), 1);

if you want to spare allocating the &quot;large&quot; pixmap twice in a block you \
could also just mirror the corners in one 5x5 tmp pixmap</pre> <br />




<p>- Thomas</p>


<br />
<p>On March 13th, 2011, 12:37 p.m., Arthur Arlt wrote:</p>






<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="8" \
style="background-image: \
url('http://git.reviewboard.kde.orgrb/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 kwin.</div>
<div>By Arthur Arlt.</div>


<p style="color: grey;"><i>Updated March 13, 2011, 12:37 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;">This patch refactors the code for outlining geometries to an own class \
Outline. It is used by tabbox and quick tiling. There were two similar \
implementations for both functionalities which are now refactored to a new class \
Outline. This class provides the X implementation for showing and hiding an outline \
of a given geometry. For the future this functionality could be replaced by an \
effect.</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;">Quick Tiling and tabbox works with this implementation.</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>kwin/CMakeLists.txt <span style="color: grey">(976c831)</span></li>

 <li>kwin/geometry.cpp <span style="color: grey">(88719bf)</span></li>

 <li>kwin/outline.h <span style="color: grey">(PRE-CREATION)</span></li>

 <li>kwin/outline.cpp <span style="color: grey">(PRE-CREATION)</span></li>

 <li>kwin/tabbox.h <span style="color: grey">(1f02b1f)</span></li>

 <li>kwin/tabbox.cpp <span style="color: grey">(e2d07fe)</span></li>

 <li>kwin/tabbox/tabboxhandler.h <span style="color: grey">(96a1fc6)</span></li>

 <li>kwin/tabbox/tabboxhandler.cpp <span style="color: grey">(b178efe)</span></li>

 <li>kwin/workspace.h <span style="color: grey">(fe97c77)</span></li>

 <li>kwin/workspace.cpp <span style="color: grey">(43e3e8c)</span></li>

</ul>

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




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








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



_______________________________________________
kwin mailing list
kwin@kde.org
https://mail.kde.org/mailman/listinfo/kwin


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic