[poppler] [PATCH] Arthur backend fixes; poppler-qt4 direct rendering

Albert Astals Cid aacid at kde.org
Mon Nov 1 12:21:26 PDT 2010


A Dilluns, 1 de novembre de 2010, Matthias Fauconneau va escriure:
> Hi,

Hi

> I'm currently using Poppler for a score player application, and since
> the synthesizer is already using all my memory and CPU, I wanted to
> render the PDF using the GPU.
> 
> I wonder why it seems nobody cares about the Arthur backend ?

Because the Splash backend works well enough and there is quite a lot to do to 
get the Arthur backend up to standards.

> The first patch contains two easy fixes for Arthur :
> - font rendering (transforming the glyph path and not only the glyph
> origin). - image rendering (alpha was set to zero).

Please don't leave commented code behind, like
//state->transform(x, y, &x1, &y1);
If we don't need it, just remove it.

Also you seem to not use buffer anymore but didn't remove the declaration

> 
> The second patch expose the QPainter interface directly through a
> renderToPainter method which use an existing painter instead of
> creating an image.
> This allows to directly render the PDF using OpenGL, and since the
> painting is fast, there is no need to cache prerendered pages. so it's
> using less CPU and less memory.

You must be the only person in the world with a working Qt OpenGL 
painterengine :D Now, seriously, each time i tried it it showed that OpenGl 
was not meant for making things correct, just for making things paint fast and 
left quite a lot to desire in terms of rendering precision.

Anyhow there are some things in the patch that i want changed/fixed:

+ \warning This method is only supported for Arthur and Cairo Qt backends
+
+ \since 0.6

There is no Cairo Qt backend and poppler 0.6 was released 3 years ago ;-)

Also i please do not to copy code from renderToImage to renderToQPainter, 
copying code is bad. Another nice thing would be if the new method returned a 
bool so that if you actually try to use it with a Splash backend you return 
false.

Thanks for the work.

Albert

> 
> in case you want to try the QGraphicsView OpenGL PDF renderer:
> http://gitorious.org/qt-pdfviewer (only needs Qt and Poppler, the
> other deps are optionnal)


More information about the poppler mailing list