[Webkit-unassigned] [Bug 106842] adding support for DiscardablePixelRef for caching lazily decoded images

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Jan 18 15:28:31 PST 2013


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





--- Comment #32 from Min Qin <qinmin at chromium.org>  2013-01-18 15:30:18 PST ---
(From update of attachment 183223)
View in context: https://bugs.webkit.org/attachment.cgi?id=183223&action=review

>>> Source/WebCore/platform/graphics/chromium/DiscardablePixelRef.cpp:45
>>> +    dst->lockPixels();
>> 
>> I think this lockPixels() is not balanced by any unlockPixels().
>> 
>> I need to think about how to count all lock/unlock for ASSERT.
> 
> Removed the lockPixels() call here. We don't need this for DiscardablePixelRef, the memory should be pinned after allocDiscardableMemory(). 
> I think there are some confusion hereļ¼š lock the pixelref and pin the memory. The pixelref doesn't needs to be locked, but the memory needs to be pinned so imagede coders can write to it. Later on, the first lockPixels() call will always succeed and pin the memory, and the unlockPixels() call will unlock and unpin the memory.

I am wrong on this. We need this lockPixels() or otherwise it is not safe. 
When imagedecoder calls setSize(), skia uses a SkAutoLockPixels to lock and unlock the pixelRef. And after the pixelRef become unlocked, imagedecoder cannot access the memory again.

-- 
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