[Okular-devel] Page scaling filters

Albert Astals Cid aacid at kde.org
Mon Mar 21 22:33:19 UTC 2016


El dilluns, 14 de març de 2016, a les 14:58:14 CET, Nicolas F. va escriure:
> Hi,

Hi

> I've noticed that Okular seems to do page scaling using something bad
> like bilinear. I'm interested in improving this by providing the option
> to choose (slower) high-quality filters. I'm starting with re-examining
> the current page drawing code and determining how to re-factor it to
> account for this, and have a few questions.
> 
> 1. What does PagePainter::scalePixmapOnImage do, and why? It seems to
> just copy data from a pixmap to an image. Is this function even relevant?

        // create an image taking the 'cropRect' portion of an image scaled
        // to 'scaledWidth' by 'scaledHeight' pixels. cropRect must be inside
        // the QRect(0,0, scaledWidth,scaledHeight)

as documented in the header. Did that help?

> 2. PagePainter::paintCroppedPageOnPainter has a lot of code paths for
> what one would assume should be a fairly simple operation. Is there a
> historical reason for its complexity? I see it reimplements the entire
> thing at least once for when it's not using a backbuffer.

How would you simplify it?

> 3. PagePainter::paintCroppedPageOnPainter paints on QImage objects which
> means the software rasteriser will be used. Since presumably nothing is
> done with those images other than then being displayed, wouldn't it be
> better to use a QOpenGLPaintDevice?

There's no QOpenGLPaintDevice in Qt4.

Cheers,
  Albert

> 
> Thanks for any answers.
> _______________________________________________
> Okular-devel mailing list
> Okular-devel at kde.org
> https://mail.kde.org/mailman/listinfo/okular-devel




More information about the Okular-devel mailing list