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

Albert Astals Cid aacid at kde.org
Tue Nov 2 12:43:06 PDT 2010

A Dimarts, 2 de novembre de 2010, Matthias Fauconneau va escriure:
> > Please never answer me only, always mail the list.
> Sorry, I really shouldn't use gmail web interface.

No problem.

> > No, there is not, there are unofficial patches for it, but that's all.
> I used the official gentoo ebuild in portage and it has a qt use flag
> to enable it.
> The ebuild doesn't seem to use any patches.
> But it really doesn't matter since the rendering is worse and
> introduce an unnecessary cairo dependency.
> > It's wrong, look at how splashoutputdev does it (yes i know it sucks)
> Sorry, I only quickly valgrinded the app and added the matching delete
> for the new.
> so if I understand it right, I have to use unref() instead even if I
> directly allocated

Yep, the API sucks.

> > No way we can tell without having the files, probably Arthur is doing
> > antialias and Splash is not.
> Do you want the link to my test files ?
> As you can see in the screenshot, Splash output is antialised. but
> there are minor differences in the pathes.

I don't really think it's worth investigating unless someone is very bored.

About the patch,

+    m_image = new QImage(width, height, QImage::Format_RGB32);
     for (y = 0; y < height; y++) {
-      dest = (unsigned int *) (buffer + y * 4 * width);
-      pix = imgStr->getLine();
-      colorMap->getRGBLine (pix, dest, width);
+        dest = (unsigned int *)m_image->scanLine(y);
+        colorMap->getRGBLine (imgStr->getLine(), dest, width);
+        for (x = 0; x < width; x++) { *dest = *dest | 0xff000000; dest++; }
-    m_image = new QImage(buffer, width, height, QImage::Format_RGB32);

Are you sure you need the 
for (x = 0; x < width; x++) { *dest = *dest | 0xff000000; dest++; }

The format you are using is Format_RGB32 so in my understanding you can having 
any garbage you want in the first byte that should not affect rendering.


More information about the poppler mailing list