[webkit-dev] Status of multithreaded image decoding

Alpha Lam hclam at chromium.org
Thu Aug 9 17:10:44 PDT 2012


Hi everyone!

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
ImageObserver<http://trac.webkit.org/browser/trunk/Source/WebCore/platform/graphics/ImageObserver.h>
 and CachedImageClient<http://trac.webkit.org/browser/trunk/Source/WebCore/loader/cache/CachedImageClient.h>
interfaces.
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
decoded bitmap.

This architecture will take several steps:

https://bugs.webkit.org/show_bug.cgi?id=93467

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.

https://bugs.webkit.org/show_bug.cgi?id=93590

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.

Alpha
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-dev/attachments/20120809/051abffb/attachment.html>


More information about the webkit-dev mailing list