Passing alpha to DeferredImageDecoder once decoding completes
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 14 Feb 2013 18:49:27 +0000 (18:49 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 14 Feb 2013 18:49:27 +0000 (18:49 +0000)
commitce34eb7d7c9b5bed2f06a91e7fbbdfe10975f375
tree70bb2326c05f88c742a121c35ac7034c84ba46d5
parentffa673152ca9ffecef3051f592afe8e86a46180b
Passing alpha to DeferredImageDecoder once decoding completes
https://bugs.webkit.org/show_bug.cgi?id=108892

Patch by Min Qin <qinmin@chromium.org> on 2013-02-14
Reviewed by Stephen White.

Source/WebCore:

We should pass hasAlpha value back to the DeferredImageDecoder once decoding is completed
Added unit tests in ImageFrameGeneratorTest.

* platform/graphics/chromium/DeferredImageDecoder.cpp:
(WebCore::DeferredImageDecoder::frameHasAlphaAtIndex):
* platform/graphics/chromium/ImageFrameGenerator.cpp:
(WebCore::ImageFrameGenerator::tryToScale):
(WebCore::ImageFrameGenerator::decode):
* platform/graphics/chromium/LazyDecodingPixelRef.cpp:
(WebCore::LazyDecodingPixelRef::LazyDecodingPixelRef):
(WebCore::LazyDecodingPixelRef::onUnlockPixels):
* platform/graphics/chromium/LazyDecodingPixelRef.h:
(WebCore::LazyDecodingPixelRef::hasAlpha):
(LazyDecodingPixelRef):
* platform/graphics/chromium/ScaledImageFragment.cpp:
(WebCore::ScaledImageFragment::ScaledImageFragment):
* platform/graphics/chromium/ScaledImageFragment.h:
(WebCore::ScaledImageFragment::create):
(ScaledImageFragment):
(WebCore::ScaledImageFragment::hasAlpha):

Source/WebKit/chromium:

Add test to check that alpha value is passed from the decoder to ImageFrameGenerator.

* tests/ImageFrameGeneratorTest.cpp:
(WebCore::MockImageDecoderFactory::create):
(WebCore::TEST_F):
* tests/MockImageDecoder.h:
(WebCore::MockImageDecoder::MockImageDecoder):
(WebCore::MockImageDecoder::setFrameHasAlpha):
(MockImageDecoder):
(WebCore::MockImageDecoder::frameHasAlphaAtIndex):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@142891 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/chromium/DeferredImageDecoder.cpp
Source/WebCore/platform/graphics/chromium/ImageFrameGenerator.cpp
Source/WebCore/platform/graphics/chromium/ImageFrameGenerator.h
Source/WebKit/chromium/ChangeLog
Source/WebKit/chromium/tests/ImageFrameGeneratorTest.cpp
Source/WebKit/chromium/tests/MockImageDecoder.h