Review Request 123137: High DPI pixmap support in Dolphin

David Edmundson david at davidedmundson.co.uk
Thu Mar 26 22:08:46 GMT 2015



> On March 26, 2015, 6:30 p.m., Christoph Feck wrote:
> > src/kitemviews/kstandarditemlistwidget.cpp, line 44
> > <https://git.reviewboard.kde.org/r/123137/diff/1/?file=356715#file356715line44>
> >
> >     Is the scaling ratio a per-screen property? If yes, we cannot just use qApp to query it.
> 
> Marco Martin wrote:
>     it can be different on different screens, yes

>Is the scaling a per-screen property?

Yes

>...we cannot just use qApp

Actually we can. 
qApp->devicePixelRatio returns the dpr of any screen.

If we have two screens, one fancy, one normal we'll return a massive pixmap with a DPR of 2.

When we do the final rendering, we'll paint this into the widget's paint device, the widget's paintDevice will match the current screen.

If the widget is on the high res screen the DPRs match and paint at the same size

If the widget is on the low res screen QPainter::drawPixmap will realise the DPR is smaller and just scale it down. Scaling down by an integer factor is practically lossless.

Arguably it's not super super super ideal as you're potentially wasting memory but it won't do any harm like rendering huge or getting cropped. QIcon::pixmap() also uses qApp, so we already potentially have to deal with mixed dprs.


- David


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


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/24e3a63f/attachment.htm>


More information about the kfm-devel mailing list