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

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

Issue 2044093002: Blink image-decoders: (lazy) deferred image decoding support for ICO (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Nits Created 4 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: 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 5600cc13cc12c8c73fd6a7088e16eafc53bf2852..dbee73d645c91727216e8c4b8875ce561abd39fc 100644
--- a/third_party/WebKit/Source/platform/graphics/DeferredImageDecoder.cpp
+++ b/third_party/WebKit/Source/platform/graphics/DeferredImageDecoder.cpp
@@ -76,6 +76,7 @@ DeferredImageDecoder::DeferredImageDecoder(PassOwnPtr<ImageDecoder> actualDecode
, m_repetitionCount(cAnimationNone)
, m_hasColorProfile(false)
, m_canYUVDecode(false)
+ , m_hasHotSpot(false)
{
}
@@ -235,6 +236,7 @@ void DeferredImageDecoder::activateLazyDecoding()
return;
m_size = m_actualDecoder->size();
+ m_hasHotSpot = m_actualDecoder->hotSpot(m_hotSpot);
m_filenameExtension = m_actualDecoder->filenameExtension();
// JPEG images support YUV decoding: other decoders do not, WEBP could in future.
m_canYUVDecode = RuntimeEnabledFeatures::decodeToYUVEnabled() && (m_filenameExtension == "jpg");
@@ -248,8 +250,7 @@ void DeferredImageDecoder::activateLazyDecoding()
void DeferredImageDecoder::prepareLazyDecodedFrames()
{
if (!m_actualDecoder
- || !m_actualDecoder->isSizeAvailable()
- || m_actualDecoder->filenameExtension() == "ico")
+ || !m_actualDecoder->isSizeAvailable())
return;
activateLazyDecoding();
@@ -314,8 +315,11 @@ PassRefPtr<SkImage> DeferredImageDecoder::createFrameImageAtIndex(size_t index,
bool DeferredImageDecoder::hotSpot(IntPoint& hotSpot) const
{
- // TODO: Implement.
- return m_actualDecoder ? m_actualDecoder->hotSpot(hotSpot) : false;
+ if (m_actualDecoder)
+ return m_actualDecoder->hotSpot(hotSpot);
+ if (m_hasHotSpot)
+ hotSpot = m_hotSpot;
+ return m_hasHotSpot;
}
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698