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

List:       kde-panel-devel
Subject:    Re: Review Request 116027: High dpi support for Svg
From:       "David Edmundson" <david () davidedmundson ! co ! uk>
Date:       2014-02-25 11:10:38
Message-ID: 20140225111038.20335.83955 () probe ! kde ! org
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/116027/#review50794
-----------------------------------------------------------


I only have a lowly normal monitor, I haven't tested this visually.


src/plasma/framesvg.h
<https://git.reviewboard.kde.org/r/116027/#comment35671>

    willreturn -> will return



src/plasma/svg.cpp
<https://git.reviewboard.kde.org/r/116027/#comment35673>

    Do we want to have size and devicePixelRatio separate in the cache ID?
    
    It means if I request 20x20 at ratio 1.0, it will have a different ID to 40x40 at \
ratio 2.0 despite being (as I understand it) visually identical?



src/plasma/svg.cpp
<https://git.reviewboard.kde.org/r/116027/#comment35675>

    Don't explain the rationale in the review request and not in the code. People \
won't be able to find it, and this will end up being code that is confusing.  
    Add your comment
    //it needs to be integer to have lines contained inside a svg piece to keep being \
pixel aligned  
    here.


- David Edmundson


On Feb. 24, 2014, 5:30 p.m., Marco Martin wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/116027/
> -----------------------------------------------------------
> 
> (Updated Feb. 24, 2014, 5:30 p.m.)
> 
> 
> Review request for Plasma.
> 
> 
> Repository: plasma-framework
> 
> 
> Description
> -------
> 
> This gives support in Svg for devicePixelRatio, just exposed in the api from Svg \
> side. 
> 
> on the component side, it sets the devicepixelratio of the svg and framesvg with \
> units. devicepixelratio is always set integer in the svg, so needs at least 192dpi \
> to double up. (it needs to be integer to have lines contained inside a svg piece to \
> keep being pixel aligned) 
> 
> Diffs
> -----
> 
> src/declarativeimports/core/framesvgitem.h e348c4c 
> src/declarativeimports/core/framesvgitem.cpp 1826d88 
> src/declarativeimports/core/svgitem.h c8be7cc 
> src/declarativeimports/core/svgitem.cpp e90751a 
> src/declarativeimports/plasmacomponents/qml/ToolButton.qml 2319879 
> src/plasma/framesvg.h 482956d 
> src/plasma/framesvg.cpp 9e1a53e 
> src/plasma/private/framesvg_p.h 1bbc744 
> src/plasma/private/svg_p.h 332efda 
> src/plasma/svg.h 01d98f8 
> src/plasma/svg.cpp 9ec2aa5 
> 
> Diff: https://git.reviewboard.kde.org/r/116027/diff/
> 
> 
> Testing
> -------
> 
> unfortunately i can only test by hardcoding different values and check if the \
> layout of the widgets stays correct, and is fine, it would be needed somebody with \
> a retina screen to see it really in action 
> 
> Thanks,
> 
> Marco Martin
> 
> 


[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="https://git.reviewboard.kde.org/r/116027/">https://git.reviewboard.kde.org/r/116027/</a>
  </td>
    </tr>
   </table>
   <br />





 <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: \
-pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">I only have a lowly \
normal monitor, I haven&#39;t tested this visually.</pre>  <br />







<div>




<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="https://git.reviewboard.kde.org/r/116027/diff/1/?file=245896#file245896line140" \
style="color: black; font-weight: bold; text-decoration: \
underline;">src/plasma/framesvg.h</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="4"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">class \
PLASMA_EXPORT FrameSvg : public Svg</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">140</font></th>  <td bgcolor="#c5ffc4" \
width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "><span \
class="cm">         * If the given margin is disabled, it willreturn \
0.</span></pre></td>  </tr>

 </tbody>

</table>

<pre style="margin-left: 2em; white-space: pre-wrap; white-space: -moz-pre-wrap; \
white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">willreturn \
-&gt; will return</pre> </div>
<br />

<div>




<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="https://git.reviewboard.kde.org/r/116027/diff/1/?file=245901#file245901line132" \
style="color: black; font-weight: bold; text-decoration: \
underline;">src/plasma/svg.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="4"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">bool \
SharedSvgRenderer::load(</pre></td>

  </tr>
 </tbody>



 
 

 <tbody>

  <tr>
    <th bgcolor="#e9eaa8" style="border-right: 1px solid #C0C0C0;" \
align="right"><font size="2">132</font></th>  <td bgcolor="#fdfebc" width="50%"><pre \
style="font-size: 8pt; line-height: 140%; margin: 0; "><span class="cp">#define \
CACHE_ID_WITH_SIZE(size, id) QString::number(int(size.width())) % QLSEP % \
QString::number(int(size.height())) % QLSEP % id</span></pre></td>  <th \
bgcolor="#e9eaa8" style="border-left: 1px solid #C0C0C0; border-right: 1px solid \
#C0C0C0;" align="right"><font size="2">132</font></th>  <td bgcolor="#fdfebc" \
width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "><span \
class="cp">#define CACHE_ID_WITH_SIZE(size, id<span class="hl">, \
devicePixelRatio</span>) QString::number(int(size.width())) % QLSEP % \
QString::number(int(size.height())) % QLSEP % id<span class="hl"> % QLSEP % \
QString::number(int(devicePixelRatio))</span></span></pre></td>  </tr>

 </tbody>

</table>

<pre style="margin-left: 2em; white-space: pre-wrap; white-space: -moz-pre-wrap; \
white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Do we want \
to have size and devicePixelRatio separate in the cache ID?

It means if I request 20x20 at ratio 1.0, it will have a different ID to 40x40 at \
ratio 2.0 despite being (as I understand it) visually identical?</pre> </div>
<br />

<div>




<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="https://git.reviewboard.kde.org/r/116027/diff/1/?file=245901#file245901line665" \
style="color: black; font-weight: bold; text-decoration: \
underline;">src/plasma/svg.cpp</a>  <span style="font-weight: normal;">

     (Diff revision 1)

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



 
 

 <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">665</font></th>  <td bgcolor="#c5ffc4" \
width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">    <span \
class="c1">//be completely integer for now</span></pre></td>  </tr>

 </tbody>

</table>

<pre style="margin-left: 2em; white-space: pre-wrap; white-space: -moz-pre-wrap; \
white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Don&#39;t \
explain the rationale in the review request and not in the code. People won&#39;t be \
able to find it, and this will end up being code that is confusing.

Add your comment
//it needs to be integer to have lines contained inside a svg piece to keep being \
pixel aligned

here.</pre>
</div>
<br />



<p>- David Edmundson</p>


<br />
<p>On February 24th, 2014, 5:30 p.m. UTC, Marco Martin wrote:</p>








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

<div>Review request for Plasma.</div>
<div>By Marco Martin.</div>


<p style="color: grey;"><i>Updated Feb. 24, 2014, 5:30 p.m.</i></p>









<div style="margin-top: 1.5em;">
 <b style="color: #575012; font-size: 10pt;">Repository: </b>
plasma-framework
</div>


<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 gives support in Svg for devicePixelRatio, just exposed in the api \
from Svg side.


on the component side, it sets the devicepixelratio of the svg and framesvg with \
units. devicepixelratio is always set integer in the svg, so needs at least 192dpi to \
double up. (it needs to be integer to have lines contained inside a svg piece to keep \
being pixel aligned)</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;">unfortunately i can only test by hardcoding different values and check \
if the layout of the widgets stays correct, and is fine, it would be needed somebody \
with a retina screen to see it really in action</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>src/declarativeimports/core/framesvgitem.h <span style="color: \
grey">(e348c4c)</span></li>

 <li>src/declarativeimports/core/framesvgitem.cpp <span style="color: \
grey">(1826d88)</span></li>

 <li>src/declarativeimports/core/svgitem.h <span style="color: \
grey">(c8be7cc)</span></li>

 <li>src/declarativeimports/core/svgitem.cpp <span style="color: \
grey">(e90751a)</span></li>

 <li>src/declarativeimports/plasmacomponents/qml/ToolButton.qml <span style="color: \
grey">(2319879)</span></li>

 <li>src/plasma/framesvg.h <span style="color: grey">(482956d)</span></li>

 <li>src/plasma/framesvg.cpp <span style="color: grey">(9e1a53e)</span></li>

 <li>src/plasma/private/framesvg_p.h <span style="color: grey">(1bbc744)</span></li>

 <li>src/plasma/private/svg_p.h <span style="color: grey">(332efda)</span></li>

 <li>src/plasma/svg.h <span style="color: grey">(01d98f8)</span></li>

 <li>src/plasma/svg.cpp <span style="color: grey">(9ec2aa5)</span></li>

</ul>

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







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








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



_______________________________________________
Plasma-devel mailing list
Plasma-devel@kde.org
https://mail.kde.org/mailman/listinfo/plasma-devel


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

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