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

Albert Astals Cid aacid at kde.org
Thu Jul 2 14:01:32 PDT 2015


El Dijous, 2 de juliol de 2015, a les 21:38:28, Adam Reichold va escriure:
> 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.

Another thing i wanted to try for a while but didn't get to was killing the 
Splash XRGB8 mode (which is an extension i created) and using the plain Splash 
RGB8 mode since now QImage is smart enough to know how to use that, would you 
mind testing if that yields any benefit?

Cheers,
  Albert

> 
> 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.



More information about the poppler mailing list