Review Request 123137: High DPI pixmap support in Dolphin

David Edmundson david at davidedmundson.co.uk
Thu Mar 26 22:43:09 GMT 2015



> On March 26, 2015, 10:11 p.m., Emmanuel Pescosta wrote:
> > src/kitemviews/kstandarditemlistwidget.cpp, line 961
> > <https://git.reviewboard.kde.org/r/123137/diff/1/?file=356715#file356715line961>
> >
> >     use the dpr from the pixmap?

Good spot, that one is potentially a big error.


> On March 26, 2015, 10:11 p.m., Emmanuel Pescosta wrote:
> > src/kitemviews/private/kpixmapmodifier.h, lines 33-51
> > <https://git.reviewboard.kde.org/r/123137/diff/1/?file=356716#file356716line33>
> >
> >     What if we use the dpr from the given pixmap and let the size be unscaled?

yeah, I wasn't sure about this either.

anything dealing with QPixmaps should be device-pixels:
for example QPixmap::scale(10,10) will always make it 10,10 pixels no matter what dpr is set. 

everything else should be device independent pixles
for example QIcon::fromTheme().pixmap(10,10) potentially returns a pixmap which is 20,20

So the question becomes:
What does KPixmapModifier count as?

an extention of QPixmap or a something else?


Given we can now kill KPixmapModifier::scale (from that other patch), we can call this class something different and then maybe avoid the confusion.


> On March 26, 2015, 10:11 p.m., Emmanuel Pescosta wrote:
> > src/kitemviews/kstandarditemlistwidget.cpp, line 1444
> > <https://git.reviewboard.kde.org/r/123137/diff/1/?file=356715#file356715line1444>
> >
> >     Remove this and use requestedSize * dpr instead?!
> >     
> >     Because this approach will lead to different requestedSize <-> size proportions for different dpr values.
> 
> Emmanuel Pescosta wrote:
>     proportions -> distribution

I don't think I can.
As I understand it the code is as follows:

load a pixmap at one of the known sizes (16,22,32,64,128) at the same size or larger than requested
scale it down to be exactly what we asked for.

If I scale after this switch statement if I potentially try and request a pixmap at 44,44 which doesn't exist and will return a centered 32x32 pixmaps.


- David


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


On March 26, 2015, 3:51 p.m., David Edmundson wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/123137/
> -----------------------------------------------------------
> 
> (Updated March 26, 2015, 3:51 p.m.)
> 
> 
> Review request for Dolphin, Christoph Feck and Marco Martin.
> 
> 
> Repository: dolphin
> 
> 
> Description
> -------
> 
> Quite a lot of changes, Dolphin does a /lot/ of special pixmap caching and manipulating.
> 
> Changes are in branch davidedmundson/highdpi
> 
> ----
> 
> 
> Make KPixmapModifier::applyFrame handle high DPI images
> 
> 
> Paint icons at the correct size
> 
> 
> squash me with a some other commit in kitemlistwidgetinformant
> 
> 
> Copy device pixel ratio from original pixmap inside KPixmapModifier::scale
> 
> 
> Create drag pixmaps which match the device pixel ratio
> 
> 
> Provide scaled pixmaps in the main file model
> 
> 
> Enable high DPI pixmaps in Dolphin
> 
> 
> Center align pixmaps in a high DPR friendly way
> 
> 
> Diffs
> -----
> 
>   src/kitemviews/kfileitemlistview.cpp d249bef 
>   src/kitemviews/kfileitemmodelrolesupdater.cpp c18d658 
>   src/kitemviews/kitemlistcontroller.cpp a9ebf97 
>   src/kitemviews/kitemlistwidget.cpp 3eb6b1d 
>   src/kitemviews/kstandarditemlistwidget.h 8264522 
>   src/kitemviews/kstandarditemlistwidget.cpp f663b87 
>   src/kitemviews/private/kpixmapmodifier.h e8ca11a 
>   src/kitemviews/private/kpixmapmodifier.cpp c564ecc 
>   src/main.cpp e8d6c2d 
>   src/panels/information/pixmapviewer.cpp 0053e43 
> 
> Diff: https://git.reviewboard.kde.org/r/123137/diff/
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> David Edmundson
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.kde.org/mailman/private/kfm-devel/attachments/20150326/c1243348/attachment.htm>


More information about the kfm-devel mailing list