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

Side by Side 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: Count only completelly received frames. Fixes 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after
237 237
238 const bool isSingleFrame = m_actualDecoder->repetitionCount() == cAnimationN one || (m_allDataReceived && m_actualDecoder->frameCount() == 1u); 238 const bool isSingleFrame = m_actualDecoder->repetitionCount() == cAnimationN one || (m_allDataReceived && m_actualDecoder->frameCount() == 1u);
239 const SkISize decodedSize = SkISize::Make(m_actualDecoder->decodedSize().wid th(), m_actualDecoder->decodedSize().height()); 239 const SkISize decodedSize = SkISize::Make(m_actualDecoder->decodedSize().wid th(), m_actualDecoder->decodedSize().height());
240 m_frameGenerator = ImageFrameGenerator::create(decodedSize, !isSingleFrame); 240 m_frameGenerator = ImageFrameGenerator::create(decodedSize, !isSingleFrame);
241 } 241 }
242 242
243 void DeferredImageDecoder::prepareLazyDecodedFrames() 243 void DeferredImageDecoder::prepareLazyDecodedFrames()
244 { 244 {
245 if (!s_enabled 245 if (!s_enabled
246 || !m_actualDecoder 246 || !m_actualDecoder
247 || !m_actualDecoder->isSizeAvailable() 247 || !m_actualDecoder->isSizeAvailable())
248 || m_actualDecoder->filenameExtension() == "ico")
249 return; 248 return;
250 249
251 activateLazyDecoding(); 250 activateLazyDecoding();
252 251
253 const size_t previousSize = m_frameData.size(); 252 const size_t previousSize = m_frameData.size();
254 m_frameData.resize(m_actualDecoder->frameCount()); 253 m_frameData.resize(m_actualDecoder->frameCount());
255 254
256 // We have encountered a broken image file. Simply bail. 255 // We have encountered a broken image file. Simply bail.
257 if (m_frameData.size() < previousSize) 256 if (m_frameData.size() < previousSize)
258 return; 257 return;
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
301 return image.release(); 300 return image.release();
302 } 301 }
303 302
304 bool DeferredImageDecoder::hotSpot(IntPoint& hotSpot) const 303 bool DeferredImageDecoder::hotSpot(IntPoint& hotSpot) const
305 { 304 {
306 // TODO: Implement. 305 // TODO: Implement.
307 return m_actualDecoder ? m_actualDecoder->hotSpot(hotSpot) : false; 306 return m_actualDecoder ? m_actualDecoder->hotSpot(hotSpot) : false;
308 } 307 }
309 308
310 } // namespace blink 309 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698