[poppler] [RFC] Add option to keep alpha channel to Qt frontends

Adam Reichold adam.reichold at t-online.de
Thu Jul 2 12:38:28 PDT 2015


Hello again,

The Splash output device internally supports using a NULL paper colour
which means that it will not try to compose with that colour keeping the
original alpha channel depending on the image format used. Since alpha
blending with the paper colour is one of the single most expensive
operations when rendering using Splash and the consuming application can
often use a hardware-accelerated operation via its toolkit, removing
this has significant performance implications.

The attached patch exposes this functionality as a render hint in the
Qt4 and Qt5 frontends and extends the SplashBitmap::convertToXBGR method
to copy Splash's internal separate alpha channel into the fourth
component actually yielding Qt's ABGR32 image format. The partial
copying is still expensive, but only half as expensive as composing with
the paper colour in terms of CPU cycles. The net gain in synthetic
rendering benchmarks and timing of a GUI application was around five
percent. Also it might be desirable for an application to gain access to
the uncomposed image for further custom image composition.

The patch also removes an unnecessary copy from the Qt5 frontend as
QImage is now able to take a clean-up handler which will properly free
Splash's raw bitmap data when the Qt image is destroyed. This improves
the speed of synthetic rendering benchmarks by another four percent.

Therefore for a Qt5-using application that does alpha blending
separately should see an improvement of around eight percent for
rendering using this patch.

Best regards, Adam.

P.S.: I will get back to GooString as soon as I find the time, but as
Albert pointed out, there is just more to gain here.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: splash-no-background.patch
Type: text/x-patch
Size: 10649 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/poppler/attachments/20150702/b1893933/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: OpenPGP digital signature
URL: <http://lists.freedesktop.org/archives/poppler/attachments/20150702/b1893933/attachment.sig>


More information about the poppler mailing list