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

Side by Side Diff: Source/core/platform/image-decoders/gif/GIFImageDecoder.cpp

Issue 13980003: Add animation support for WebP images (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Debug fix Created 7 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) 2006 Apple Computer, Inc. All rights reserved. 2 * Copyright (C) 2006 Apple Computer, 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 287 matching lines...) Expand 10 before | Expand all | Expand 10 after
298 if (failed()) 298 if (failed())
299 return; 299 return;
300 300
301 Vector<size_t> framesToDecode; 301 Vector<size_t> framesToDecode;
302 size_t frameToDecode = frameIndex; 302 size_t frameToDecode = frameIndex;
303 do { 303 do {
304 framesToDecode.append(frameToDecode); 304 framesToDecode.append(frameToDecode);
305 frameToDecode = m_frameBufferCache[frameToDecode].requiredPreviousFrameI ndex(); 305 frameToDecode = m_frameBufferCache[frameToDecode].requiredPreviousFrameI ndex();
306 } while (frameToDecode != notFound && m_frameBufferCache[frameToDecode].stat us() != ImageFrame::FrameComplete); 306 } while (frameToDecode != notFound && m_frameBufferCache[frameToDecode].stat us() != ImageFrame::FrameComplete);
307 307
308 // The |rend| variable is needed by some compilers that can't correctly 308 for (size_t i = framesToDecode.size(); i > 0; --i) {
309 // select from const and non-const versions of overloaded functions. 309 size_t frameIndex = framesToDecode[i - 1];
310 // Can remove the variable if Android compiler can compile
311 // 'iter != framesToDecode.rend()'.
312 Vector<size_t>::const_reverse_iterator rend = framesToDecode.rend();
313 for (Vector<size_t>::const_reverse_iterator iter = framesToDecode.rbegin(); iter != rend; ++iter) {
314 size_t frameIndex = *iter;
315 if (!m_reader->decode(frameIndex)) { 310 if (!m_reader->decode(frameIndex)) {
316 setFailed(); 311 setFailed();
317 return; 312 return;
318 } 313 }
319 314
320 // We need more data to continue decoding. 315 // We need more data to continue decoding.
321 if (m_frameBufferCache[frameIndex].status() != ImageFrame::FrameComplete ) 316 if (m_frameBufferCache[frameIndex].status() != ImageFrame::FrameComplete )
322 break; 317 break;
323 } 318 }
324 319
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
363 358
364 // Update our status to be partially complete. 359 // Update our status to be partially complete.
365 buffer->setStatus(ImageFrame::FramePartial); 360 buffer->setStatus(ImageFrame::FramePartial);
366 361
367 // Reset the alpha pixel tracker for this frame. 362 // Reset the alpha pixel tracker for this frame.
368 m_currentBufferSawAlpha = false; 363 m_currentBufferSawAlpha = false;
369 return true; 364 return true;
370 } 365 }
371 366
372 } // namespace WebCore 367 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698