Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(519)

Unified Diff: third_party/WebKit/Source/platform/graphics/DeferredImageDecoder.cpp

Issue 1331533002: [poc] curve-filter Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fix CanvasRenderingContext2D::createPattern crash for #40 Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/platform/graphics/DeferredImageDecoder.cpp
diff --git a/third_party/WebKit/Source/platform/graphics/DeferredImageDecoder.cpp b/third_party/WebKit/Source/platform/graphics/DeferredImageDecoder.cpp
index 1411c494248a4a21170f245dc5e8aaa5899035ae..45597121c20fcd02d42f9007b7f04a334b9f1f54 100644
--- a/third_party/WebKit/Source/platform/graphics/DeferredImageDecoder.cpp
+++ b/third_party/WebKit/Source/platform/graphics/DeferredImageDecoder.cpp
@@ -26,6 +26,7 @@
#include "platform/graphics/DeferredImageDecoder.h"
#include "platform/RuntimeEnabledFeatures.h"
+#include "platform/graphics/ColorSpaceFilter.h"
#include "platform/graphics/DecodingImageGenerator.h"
#include "platform/graphics/FrameData.h"
#include "platform/graphics/ImageDecodingStore.h"
@@ -57,8 +58,8 @@ DeferredImageDecoder::DeferredImageDecoder(PassOwnPtr<ImageDecoder> actualDecode
, m_lastDataSize(0)
, m_actualDecoder(std::move(actualDecoder))
, m_repetitionCount(cAnimationNone)
- , m_hasColorProfile(false)
, m_canYUVDecode(false)
+ , m_hasColorProfile(false)
{
}
@@ -134,6 +135,14 @@ bool DeferredImageDecoder::hasColorProfile() const
return m_actualDecoder ? m_actualDecoder->hasColorProfile() : m_hasColorProfile;
}
+PassRefPtr<ColorSpaceProfile> DeferredImageDecoder::colorProfile() const
+{
+ if (m_actualDecoder)
+ return m_actualDecoder->colorProfile();
+
+ return m_colorProfile;
+}
+
IntSize DeferredImageDecoder::size() const
{
return m_actualDecoder ? m_actualDecoder->size() : m_size;
@@ -225,6 +234,7 @@ void DeferredImageDecoder::activateLazyDecoding()
// JPEG images support YUV decoding: other decoders do not, WEBP could in future.
m_canYUVDecode = RuntimeEnabledFeatures::decodeToYUVEnabled() && (m_filenameExtension == "jpg");
m_hasColorProfile = m_actualDecoder->hasColorProfile();
+ m_colorProfile = m_hasColorProfile ? m_actualDecoder->colorProfile() : nullptr;
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);

Powered by Google App Engine
This is Rietveld 408576698