[webkit-qt] QImage vs QPixmap as native image
jocelyn.turcotte at digia.com
Fri Sep 13 04:49:57 PDT 2013
On Fri, Sep 13, 2013 at 03:12:59PM +0400, Konstantin Tokarev wrote:
> Hi all,
> There was a patch  that was later reverted because of performance degradation on DirectFB, where QPixmap is hardware accelerated.
> We use QtWebKit 2.3.3 with Qt 4.8 on embedded system. We have internally written gfxdriver for QWS which does not provide hardware acceleration for QPixmap's, but allows to create hardware accelerated QImage's (I know it's rather strange, but it's what we have right now).
> Now I'd like to provide hardware acceleration for images in QtWebKit. What route is better for me:
> 1) apply  again on top of QtWebKit 2.3 and use accelerated QImage's;
> 2) add hardware acceleration for QPixmap's (it does not seem too difficult from implementation point of view for me)?
> Are there any performance advantages from using QImage with WebKit native decoders as compared to QPixmap?
If my memory serves me right, QPixmap and QImage are the same up to the point where they are given to a paint engine through QPainter.
Since decoding in QtWebKit happens before that point, any operation on a QPixmap will just be delegated to its internal QImage.
In Qt4 the X11 paint engine is converting them to an XPixmap, which would allow hardware assisted blitting. Performances should be the same between QPixmap and QImage when using the raster paint engine.
In Qt5 linux now uses the raster paint engine as well, the only advantage of QPixmap that I'm aware of is for the image blitting special case of the DirectFB platform plugin that you mentioned.
More information about the webkit-qt