| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |