Review Request 122875: Fix KIconEngine::paint to handle different devicePixelRatios
Albert Astals Cid
aacid at kde.org
Tue Mar 10 00:47:13 UTC 2015
> On mar. 9, 2015, 6:26 p.m., Albert Astals Cid wrote:
> > makes no sense to me, you are getting a rect to
> > paint on and painting outside of it.
> >
> > what even warrants that there will be "space"
> > on the qpainter?
> >
> > should the size increase be done in upper levels?
>
> David Edmundson wrote:
> It's not painting outside it, the first argument is the target area, the pixmap is scaled to fit.
> Which is actually what's happening before this patch, scaling it upwards making it look blocky with a high QT_DEVICE_PIXEL_RATIO.
>
>
> In this case I'm making sure what I'm painting does match the painter.
>
> We know the painter's target is rect user pixels big.
> Which means in reality it is rect * devicePixelRatio real device pixels big.
>
> To draw a clean icon, we need the pixmaps with a matching size in device pixels, not a matching size in user pixels.
>
>
> Normally this does happen in an upper level. QIcon::pixmap() does this resizing, but QIcon::paint which calls this cannot.
Ok, i have no idea about this, so i guess this is a ±0 from my side
- Albert
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/122875/#review77223
-----------------------------------------------------------
On mar. 9, 2015, 5:54 p.m., David Edmundson wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/122875/
> -----------------------------------------------------------
>
> (Updated mar. 9, 2015, 5:54 p.m.)
>
>
> Review request for KDE Frameworks and Christoph Feck.
>
>
> Repository: kiconthemes
>
>
> Description
> -------
>
> This now matches the behaviour of QPixmapIconEngine::paint
>
>
> Diffs
> -----
>
> src/kiconengine.cpp 6dff533
>
> Diff: https://git.reviewboard.kde.org/r/122875/diff/
>
>
> Testing
> -------
>
> Opened configure toolbars in konversation with QT_DEVICE_PIXEL_RATIO=2
> QStyledItemDelegate calls QIcon::paint which ends up going through this code with our QPA.
>
>
> Thanks,
>
> David Edmundson
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20150310/22325c38/attachment.html>
More information about the Kde-frameworks-devel
mailing list