[webkit-qt] GraphicsContext and Canvas

Ariya Hidayat ariya.hidayat at gmail.com
Thu Feb 4 08:35:49 PST 2010


>>One thing worth considering is IMO to only use a QImage to
>>render the canvas content into, and avoid any
>>caching/conversion magic between images and pixmaps. We don't
>>get any HW acceleration for drawing with this, but it might
>>still be faster and easier than doing possible conversions
>>back and forth.
>
> I don't see why we would need to convert back to an image at all if the user doesn't call getImageBuffer.
> Many times all we do with canvas is transform; drawImage; fillRect; transform; drawImage; etc.
> In that case, which is much more common than getting the image buffer or setting pixels directly, HW acceleration is crucial.

A middle ground would be: if the working paint engine is
non-accelerated,  then just fall back to pure image (raster).
Otherwise, we try to keep the conversion between pixmap and image to
minimum.

Alternatively: a compile-time setting (useful for mobile platform) or
a run-time setting (global QWebSettings?).

Note that even with the pixmap and image conversion handled smartly by
the Graphics Context, this will be much better than the current
situation where every pixel access requires a round-trip from pixmap
to image and pixmap again.

Also, auto-conversion like that does not harm raster engine (beside
the small overhead), because pixmap and image are essentially the same
there. It would however tremendously help X11 and GL.


-- 
Ariya Hidayat
http://www.linkedin.com/in/ariyahidayat


More information about the webkit-qt mailing list