[webkit-dev] Status of multithreaded image decoding
hclam at chromium.org
Thu Aug 9 17:10:44 PDT 2012
A few weeks ago some folks from company100.net have started a thread of
multithreaded (parallel) image decoding in WebKit. We have worked together
since then to get a better idea how to complete this feature. I would like
to report on the progress and our plan.
(The goal for Chromium is slightly different but it will reuse most of the
architecture discussed here.)
Master bug: https://bugs.webkit.org/show_bug.cgi?id=90375
In WebKit today image rendering is progressive, meaning that image is
rendered as bytes are received from the network. This is done through
Multithreaded image decoding uses the same notification architecture,
clients of BitmapImage are notified when a new region is decoded and
available for painting.
Today image decoding happens synchronously when a BitmapImage is drawn into
a GraphicsContext. We plan to use the draw operation as a trigger to start
image decoding asynchronously. Which means the first draw of BitmapImage
will get a transparent image, subsequent draws will have the most recently
This architecture will take several steps:
This modifies ImageSource to be asynchronous. ImageSource is used as the
public interface for decoding images. By making this interface asynchronous
individual port can implement parallel image decoding or a similar
architecture. This change is ready for review. I would like to get more
feedback on the interface since this touches all ports.
Progressive painting of an image may not be possible everywhere. For
example <canvas> and accelerated-composited <img> requires synchronous
decoding. We plan to keep synchronous decoding the default case. This
change identifies code location where asynchronous decoding is possible and
tell BitmapImage asynchronous image decoding is requested.
After these two changes we will be able to implement multithreaded image
decoder inside BitmapImage and ImageSource. I will report on the progress
once we get to this point.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the webkit-dev