[Webkit-unassigned] [Bug 108892] Passing alpha to DeferredImageDecoder once decoding completes

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Feb 12 10:50:33 PST 2013


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





--- Comment #9 from Min Qin <qinmin at chromium.org>  2013-02-12 10:52:47 PST ---
(From update of attachment 186672)
View in context: https://bugs.webkit.org/attachment.cgi?id=186672&action=review

>> Source/WebCore/platform/graphics/chromium/DeferredImageDecoder.cpp:185
>> +        LazyDecodingPixelRef* pixelRef = static_cast<LazyDecodingPixelRef*>(m_lazyDecodedFrame.getSkBitmap().pixelRef());
> 
> alpha state should be saved in ImageFrameGenerator.
> 
> ImageFrameGenerator corresponds to one image file. It exists regardless whether or not an image is cached or not. So in the case of ScaledImageFragment being evicted the code can return the correct alpha state regardless of whether it is cached or not.

Done.

>>>>>> Source/WebCore/platform/graphics/chromium/ImageFrameGenerator.cpp:213
>>>>>> +    bool hasAlpha = (*decoder)->frameHasAlphaAtIndex(0);
>>>>> 
>>>>> Do something like:
>>>>> 
>>>>> m_hasAlpha = isComplete && !fullSizeBitmap.isOpaque();
>>>> 
>>>> hmm.... if isComplete is false, shouldn't we return true there to force image decoding?
>>> 
>>> I don't know what you mean.
>>> 
>>> Actually now I think about it again you can just do !fullSizeBitmap.isOpaque(). Don't call frameHasAlphaAtIndex(0) it might have side effect.
>> 
>> Yes, I think !fullSizeBitmap.isOpaque() should be correct.
>> hasAlpha should be defaulted to true. So if isComplete is false, we should use true so that there are no optimization happening elsewhere.
> 
> isOpaque() is default to false, it is set to true only if decoder tells it to. So it's more accurate than mixing it with isComplete. For example progressive JPEG, an image can be partially decoded (i.e. isComplete == false) but it is opaque.

Done.

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