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

List:       kwin
Subject:    Re: Review Request: Introduce class DecorationPaintRedirector for
From:       Thomas_Lübking <thomas.luebking () web ! de>
Date:       2011-09-14 21:32:31
Message-ID: 20110914213231.29533.1624 () vidsolbach ! de
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


> On Sept. 14, 2011, 6:23 p.m., Martin Gräßlin wrote:
> > kwin/decorationpaintredirector.cpp, line 205
> > <http://git.reviewboard.kde.org/r/102422/diff/3/?file=35737#file35737line205>
> > 
> > We need to find a better solution here. This call is really expensive and called \
> > for each window in each frame. We have to cache the information and find a way \
> > how to notify the DecorationPaintRedirector. 
> > In client the borders used to be cached and there are not so many places where \
> > the border (and padding) gets updated. So maybe just two signals will do: \
> > decorationBorderChanged(int left, int top, int bottom, int right) \
> > decorationPaddingChanged(int left, int top, int bottom, int right)
> 
> Thomas Lübking wrote:
> Why do you think KDecoration::borders() is expensive?
> 
> Martin Gräßlin wrote:
> Because it calls KCommonDecoration::updateLayout(). One call is not that expensive, \
> but calling it for each frame and each window...

Ahhh, sorry.

kcommondecoration.cpp
"updateLayout(); // TODO!! don't call every time we are in ::borders"

... not expensive "here" at all, so i just wondered ;-P


- Thomas


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


On Sept. 9, 2011, 5:20 p.m., Arthur Arlt wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://git.reviewboard.kde.org/r/102422/
> -----------------------------------------------------------
> 
> (Updated Sept. 9, 2011, 5:20 p.m.)
> 
> 
> Review request for kwin.
> 
> 
> Summary
> -------
> 
> This patch introduces the new class DecorationPaintRedirector. It inherits from \
> PaintRedirector and covers the functionality for decoration handling when \
> compositing is active. This functionality was moved from Client to this new class. \
> The reason for doing this is to get rid of the Client dependency in class Scene. \
> This is an initial review request. There are still some Client dependencies left. \
> But it works so far except for changing the decoration in composited mode or \
> removing no border. Doing this does not lead to a crash but the decorations are not \
> updated. Newly added clients are displayed correctly with the new decoration. \
> Should be not that hard to fix it; will be done the next days ;) 
> 
> Diffs
> -----
> 
> kwin/CMakeLists.txt bde6626 
> kwin/client.h 66b9c46 
> kwin/client.cpp a6f0618 
> kwin/composite.cpp a8bb42e 
> kwin/decorationpaintredirector.h PRE-CREATION 
> kwin/decorationpaintredirector.cpp PRE-CREATION 
> kwin/deleted.cpp f465159 
> kwin/paintredirector.h bb5d67c 
> kwin/paintredirector.cpp 7ed4d6f 
> kwin/scene.h b9ba85a 
> kwin/scene.cpp 3406259 
> kwin/scene_opengl.cpp 47015b3 
> kwin/scene_xrender.cpp fc08289 
> 
> Diff: http://git.reviewboard.kde.org/r/102422/diff
> 
> 
> Testing
> -------
> 
> Works for both OpenGL and XRender on my system. However, as told in the \
> description, changing the decoration (in composited mode)does not lead to a crash, \
> but does not update the decorations for existing clients. Feel free to tell me the \
> solution if it is obvious to you. 
> 
> 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/102422/">http://git.reviewboard.kde.org/r/102422/</a>
  </td>
    </tr>
   </table>
   <br />








<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: \
10px;">  <p style="margin-top: 0;">On September 14th, 2011, 6:23 p.m., <b>Martin \
Gräßlin</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/102422/diff/3/?file=35737#file35737line205" \
style="color: black; font-weight: bold; text-decoration: \
underline;">kwin/decorationpaintredirector.cpp</a>  <span style="font-weight: \
normal;">

     (Diff revision 3)

    </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 DecorationPaintRedirector::layoutRects(QRect&amp; left, QRect&amp; top, \
QRect&amp; right, QRect&amp; bottom, CoordinateMode mode)</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">205</font></th>  <td bgcolor="#c5ffc4" \
width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">    <span \
class="n">m_decoration</span><span class="o">-&gt;</span><span \
class="n">borders</span><span class="p">(</span><span \
class="n">borderLeft</span><span class="p">,</span> <span \
class="n">borderRight</span><span class="p">,</span> <span \
class="n">borderTop</span><span class="p">,</span> <span \
class="n">borderBottom</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;">We need to find a better \
solution here. This call is really expensive and called for each window in each \
frame. We have to cache the information and find a way how to notify the \
DecorationPaintRedirector.

In client the borders used to be cached and there are not so many places where the \
border (and padding) gets updated. So maybe just two signals will do: \
decorationBorderChanged(int left, int top, int bottom, int right) \
decorationPaddingChanged(int left, int top, int bottom, int right)</pre>  \
</blockquote>



 <p>On September 14th, 2011, 7:38 p.m., <b>Thomas Lübking</b> wrote:</p>
 <blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: \
10px;">  <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: \
-pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Why do you think \
KDecoration::borders() is expensive?</pre>  </blockquote>





 <p>On September 14th, 2011, 8:47 p.m., <b>Martin Gräßlin</b> wrote:</p>
 <blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: \
10px;">  <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: \
-pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Because it calls \
KCommonDecoration::updateLayout(). One call is not that expensive, but calling it for \
each frame and each window...</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;">Ahhh, \
sorry.

kcommondecoration.cpp
&quot;updateLayout(); // TODO!! don&#39;t call every time we are in ::borders&quot;

... not expensive &quot;here&quot; at all, so i just wondered ;-P</pre>
<br />




<p>- Thomas</p>


<br />
<p>On September 9th, 2011, 5:20 p.m., Arthur Arlt 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 kwin.</div>
<div>By Arthur Arlt.</div>


<p style="color: grey;"><i>Updated Sept. 9, 2011, 5:20 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 introduces the new class DecorationPaintRedirector. It \
inherits from PaintRedirector and covers the functionality for decoration handling \
when compositing is active. This functionality was moved from Client to this new \
class. The reason for doing this is to get rid of the Client dependency in class \
Scene. This is an initial review request. There are still some Client dependencies \
left. But it works so far except for changing the decoration in composited mode or \
removing no border. Doing this does not lead to a crash but the decorations are not \
updated. Newly added clients are displayed correctly with the new decoration. Should \
be not that hard to fix it; will be done the next days ;)</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;">Works for both OpenGL and XRender on my system. However, as told in the \
description, changing the decoration (in composited mode)does not lead to a crash, \
but does not update the decorations for existing clients. Feel free to tell me the \
solution if it is obvious to you.</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">(bde6626)</span></li>

 <li>kwin/client.h <span style="color: grey">(66b9c46)</span></li>

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

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

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

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

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

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

 <li>kwin/paintredirector.cpp <span style="color: grey">(7ed4d6f)</span></li>

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

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

 <li>kwin/scene_opengl.cpp <span style="color: grey">(47015b3)</span></li>

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

</ul>

<p><a href="http://git.reviewboard.kde.org/r/102422/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