D19920: Add High DPI support

David Edmundson noreply at phabricator.kde.org
Thu Mar 21 00:24:27 GMT 2019


davidedmundson added inline comments.

INLINE COMMENTS

> kcardthemewidget.cpp:85
> +        const auto dpr = qApp->devicePixelRatio();
> +        QImage img( d->previewSize * dpr, QImage::Format_ARGB32 );
>          img.fill( Qt::transparent );

this image doesn't have the DPR set

> kcardthemewidget.cpp:104
>              {
> -                renderer.render( &p, card, QRectF( QPointF( xPos, yPos ), size ) );
> +                renderer.render( &p, card, QRectF( QPointF( xPos, yPos ) * dpr, size * dpr ) );
>                  xPos += 0.3 * spacingWidth;

Any patch that has code to render bigger is normally a bad sign.

We should only be resizing the backing stores and having the DPR set on that backing store.

The rest will implicitly "just work".

> kcardthemewidget.cpp:206
>      QPixmap * pix = new QPixmap( QPixmap::fromImage( image ) );
> +    pix->setDevicePixelRatio( qApp->devicePixelRatio() );
>      delete m_previews.value( theme.displayName(), 0 );

why?

The image coming in should have a DPR set.

REPOSITORY
  R410 KPatience

REVISION DETAIL
  https://phabricator.kde.org/D19920

To: volkov, #kde_games
Cc: apol, aacid, davidedmundson, kde-games-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-games-devel/attachments/20190321/8550fc52/attachment.html>


More information about the kde-games-devel mailing list