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

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

Issue 352873002: [wip] image color correction (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 6 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: Source/platform/graphics/DeferredImageDecoder.cpp
diff --git a/Source/platform/graphics/DeferredImageDecoder.cpp b/Source/platform/graphics/DeferredImageDecoder.cpp
index 4f3822ee4e45856193d1fd68afefb19e605bda06..fd35350ef113eeffaf0133705625126ad7da6d77 100644
--- a/Source/platform/graphics/DeferredImageDecoder.cpp
+++ b/Source/platform/graphics/DeferredImageDecoder.cpp
@@ -126,8 +126,8 @@ void DeferredImageDecoder::setData(SharedBuffer& data, bool allDataReceived)
bool DeferredImageDecoder::isSizeAvailable()
{
- // m_actualDecoder is 0 only if image decoding is deferred and that
- // means image header decoded successfully and size is available.
+ // m_actualDecoder is 0 only if image decoding is deferred and that means the
+ // image header decoded successfully and the size is available.
return m_actualDecoder ? m_actualDecoder->isSizeAvailable() : true;
}
@@ -136,6 +136,11 @@ bool DeferredImageDecoder::hasColorProfile() const
return m_actualDecoder ? m_actualDecoder->hasColorProfile() : m_hasColorProfile;
}
+PassRefPtr<ColorSpaceProfile> DeferredImageDecoder::colorProfile() const
+{
+ return m_actualDecoder ? m_actualDecoder->colorProfile() : m_colorProfile;
+}
+
IntSize DeferredImageDecoder::size() const
{
return m_actualDecoder ? m_actualDecoder->size() : m_size;
@@ -212,6 +217,7 @@ void DeferredImageDecoder::activateLazyDecoding()
m_orientation = m_actualDecoder->orientation();
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);
}

Powered by Google App Engine
This is Rietveld 408576698