[Webkit-unassigned] [Bug 112121] Keep a weak reference of decoded image in lazyDecodingPixelRef

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Mar 18 00:47:55 PDT 2013


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





--- Comment #9 from Hin-Chung Lam <hclam at google.com>  2013-03-18 00:50:21 PST ---
platform/chromium/virtual/deferred/fast/images/icon-decoding.html is a virtual test. You can run DRT with --enable-deferred-image-decoding and on fast/images/icon-decoding.html.

I'm not sure a weak pointer is the right approach here. A cache entry can mutate while a reference is held by LazyDecodingPixelRef. So it is totally possible one thread is reading while another thread is writing. There's why the synchronization is done through ImageFrameGenerator, such that no two threads can read and write at the same time.

There's also a problem with ImageDecodingStore pointing to LazyDecodingPixelRef. I can only imagine this is not thread safe, one thread is evicting the cache while the other thread is reading.

My guess (I haven't tried it on the test page yet) is that the problem is we're generating too many LazyDecodingPixelRef in DeferredImageDecoder. The code now generates a new LazyDecodingPixelRef for each draw, but this can be cached and reused. If that's the case multiple draws sharing the same bitmap will go through the same LazyDecodingPixel and onLockPixels() will be called once. We should see if this can cut down cache lookup.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


More information about the webkit-unassigned mailing list