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

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

Issue 1309393007: [poc] redecode Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: resetColorProfileForTesting rename Created 5 years, 1 month 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 a9621b5a1058f9cd5e2404cb48dfd82615ab593d..c70914cd7fcd947db070db0eb49ba09e3fe7fe3a 100644
--- a/third_party/WebKit/Source/platform/graphics/DeferredImageDecoder.cpp
+++ b/third_party/WebKit/Source/platform/graphics/DeferredImageDecoder.cpp
@@ -100,6 +100,7 @@ PassRefPtr<SkImage> DeferredImageDecoder::createFrameAtIndex(size_t index)
void DeferredImageDecoder::setData(SharedBuffer& data, bool allDataReceived)
{
if (m_actualDecoder) {
+ fprintf(stderr, "DeferredImageDecoder %p setData decoder %p\n", this, m_actualDecoder.get());
m_data = RefPtr<SharedBuffer>(data);
m_lastDataSize = data.size();
m_allDataReceived = allDataReceived;
@@ -123,6 +124,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;
@@ -204,15 +213,31 @@ ImageOrientation DeferredImageDecoder::orientationAtIndex(size_t index) const
return DefaultImageOrientation;
}
+void DeferredImageDecoder::setDeviceProfile(ColorSpaceProfile* profile)
+{
+ m_deviceProfile = profile;
+
+ if (m_actualDecoder)
+ m_actualDecoder->setDeviceProfile(profile);
+
+ if (m_frameGenerator)
+ m_frameGenerator->setDeviceProfile(profile);
+}
+
void DeferredImageDecoder::activateLazyDecoding()
{
if (m_frameGenerator)
return;
+
+ fprintf(stderr, "DeferredImageDecoder %p activateLazyDecoding\n", this);
+
m_size = m_actualDecoder->size();
m_filenameExtension = m_actualDecoder->filenameExtension();
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);
+ m_frameGenerator->setDeviceProfile(m_deviceProfile.get());
}
void DeferredImageDecoder::prepareLazyDecodedFrames()

Powered by Google App Engine
This is Rietveld 408576698