X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2Fthird_party%2FWebKit%2FSource%2Fplatform%2Fgraphics%2FDeferredImageDecoder.cpp;h=abc9f8d929ae10bc1dfe637dd903060f0d4f809e;hb=004985e17e624662a4c85c76a7654039dc83f028;hp=f6bb64f4da2b4521a0e0cf245298d8d1348e777f;hpb=2f108dbacb161091e42a3479f4e171339b7e7623;p=platform%2Fframework%2Fweb%2Fcrosswalk.git diff --git a/src/third_party/WebKit/Source/platform/graphics/DeferredImageDecoder.cpp b/src/third_party/WebKit/Source/platform/graphics/DeferredImageDecoder.cpp index f6bb64f..abc9f8d 100644 --- a/src/third_party/WebKit/Source/platform/graphics/DeferredImageDecoder.cpp +++ b/src/third_party/WebKit/Source/platform/graphics/DeferredImageDecoder.cpp @@ -54,6 +54,7 @@ DeferredImageDecoder::DeferredImageDecoder(PassOwnPtr actualDecode , m_actualDecoder(actualDecoder) , m_orientation(DefaultImageOrientation) , m_repetitionCount(cAnimationNone) + , m_hasColorProfile(false) { } @@ -93,6 +94,11 @@ void DeferredImageDecoder::setEnabled(bool enabled) #endif } +bool DeferredImageDecoder::enabled() +{ + return s_enabled; +} + String DeferredImageDecoder::filenameExtension() const { return m_actualDecoder ? m_actualDecoder->filenameExtension() : m_filenameExtension; @@ -112,21 +118,21 @@ ImageFrame* DeferredImageDecoder::frameBufferAtIndex(size_t index) return 0; } -void DeferredImageDecoder::setData(SharedBuffer* data, bool allDataReceived) +void DeferredImageDecoder::setData(SharedBuffer& data, bool allDataReceived) { if (m_actualDecoder) { - const bool firstData = !m_data && data; - const bool moreData = data && data->size() > m_lastDataSize; + const bool firstData = !m_data; + const bool moreData = data.size() > m_lastDataSize; m_dataChanged = firstData || moreData; - m_data = data; - m_lastDataSize = data->size(); + m_data = RefPtr(data); + m_lastDataSize = data.size(); m_allDataReceived = allDataReceived; - m_actualDecoder->setData(data, allDataReceived); + m_actualDecoder->setData(&data, allDataReceived); prepareLazyDecodedFrames(); } if (m_frameGenerator) - m_frameGenerator->setData(data, allDataReceived); + m_frameGenerator->setData(&data, allDataReceived); } bool DeferredImageDecoder::isSizeAvailable() @@ -136,6 +142,11 @@ bool DeferredImageDecoder::isSizeAvailable() return m_actualDecoder ? m_actualDecoder->isSizeAvailable() : true; } +bool DeferredImageDecoder::hasColorProfile() const +{ + return m_actualDecoder ? m_actualDecoder->hasColorProfile() : m_hasColorProfile; +} + IntSize DeferredImageDecoder::size() const { return m_actualDecoder ? m_actualDecoder->size() : m_size; @@ -211,6 +222,7 @@ void DeferredImageDecoder::activateLazyDecoding() m_size = m_actualDecoder->size(); m_orientation = m_actualDecoder->orientation(); m_filenameExtension = m_actualDecoder->filenameExtension(); + m_hasColorProfile = m_actualDecoder->hasColorProfile(); const bool isSingleFrame = m_actualDecoder->repetitionCount() == cAnimationNone || (m_allDataReceived && m_actualDecoder->frameCount() == 1u); m_frameGenerator = ImageFrameGenerator::create(SkISize::Make(m_actualDecoder->decodedSize().width(), m_actualDecoder->decodedSize().height()), m_data, m_allDataReceived, !isSingleFrame); }