D6268: HiDPI Support for Okular

David Edmundson noreply at phabricator.kde.org
Mon Jul 3 15:42:00 UTC 2017


davidedmundson added a comment.


  qApp->DPR can change within the lifespan of the app; for example plugging in a new monitor can change things.  
  This does mean it's very important to keep the metadata of the pixmap's dpr with the pixmap. It ends up simpler and safer overall.
  
  Doesn't mean we need to break ABI though.
  
  ---
  
  @hetzenecker
  
  There are two breaks RequestPixmap::RequestPixmap and Page::_o_nearest
  
  ---
  
  For requestPixmap we're sure to not process any screen events in the meantime, so you can use qApp->devicePixelRatio() in the two places in document and in the line in generator.
  
  For use of Page::_o_nearest you can't.
  However, there is an easy way to keep ABI for this sort of thing.
  
  If you have
  someMethod(int a) and want to change it to someMethod(int a, qreal dpr)
  
  keep both, but make the first method simply call the second with a default parameter.
  
  -----

INLINE COMMENTS

> generator.cpp:106
> +    QPixmap *p = new QPixmap( QPixmap::fromImage( img ) );
> +    p->setDevicePixelRatio( p->devicePixelRatioF() );
> +    request->page()->setPixmap( request->observer(), p, request->normalizedRect() );

sure about this one?

REPOSITORY
  R223 Okular

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

To: hetzenecker, davidedmundson, aacid
Cc: sander, anthonyfieroni, #okular, aacid
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/okular-devel/attachments/20170703/be8fb24a/attachment.html>


More information about the Okular-devel mailing list