[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-26 15:34:06
Message-ID: 20140226153406.18188.4424 () probe ! kde ! org
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


> On Feb. 25, 2014, 11:10 a.m., David Edmundson wrote:
> > src/plasma/svg.cpp, line 132
> > <https://git.reviewboard.kde.org/r/116027/diff/1/?file=245901#file245901line132>
> > 
> > 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?
> 
> Marco Martin wrote:
> the only problem is that when the svg is not scaled, instead of the actual size, \
> "Native" gets in the id instead. now i don't remember the reason anymore, but it \
> breaks in that case 
> Marco Martin wrote:
> (/me digs down in git history)
> at that point you don't know yet what is the size of the element (or the whole svg \
> for what matters), because the renderer doesn't exist yet (and one of the points of \
> the cache is to avoid to instantiate the svg renderer altogether if possible)

OK, add that comment in the code.


- David


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


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 />










<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: \
10px;">  <p style="margin-top: 0;">On February 25th, 2014, 11:10 a.m. UTC, <b>David \
Edmundson</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="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="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>  </blockquote>



 <p>On February 25th, 2014, 5:08 p.m. UTC, <b>Marco Martin</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;">the only problem is that \
when the svg is not scaled, instead of the actual size, &quot;Native&quot; gets in \
the id instead. now i don&#39;t remember the reason anymore, but it breaks in that \
case</pre>  </blockquote>





 <p>On February 25th, 2014, 7:10 p.m. UTC, <b>Marco Martin</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;">(/me digs down in git \
history) at that point you don&#39;t know yet what is the size of the element (or the \
whole svg for what matters), because the renderer doesn&#39;t exist yet (and one of \
the points of the cache is to avoid to instantiate the svg renderer altogether if \
possible)</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;">OK, add \
that comment in the code.</pre> <br />




<p>- David</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