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

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

Issue 1962563002: Fix ImageDecoder::frameIsCompleteAtIndex - fully received instead of decoded. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: extending the scope with naming suggested by @scroggo Created 4 years, 7 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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 // stream. In these cases we should just loop once. 76 // stream. In these cases we should just loop once.
77 if (isAllDataReceived() && parseCompleted() && m_reader->imagesCount() == 1) 77 if (isAllDataReceived() && parseCompleted() && m_reader->imagesCount() == 1)
78 m_repetitionCount = cAnimationNone; 78 m_repetitionCount = cAnimationNone;
79 else if (failed() || (m_reader && (!m_reader->imagesCount()))) 79 else if (failed() || (m_reader && (!m_reader->imagesCount())))
80 m_repetitionCount = cAnimationLoopOnce; 80 m_repetitionCount = cAnimationLoopOnce;
81 else if (m_reader && m_reader->loopCount() != cLoopCountNotSeen) 81 else if (m_reader && m_reader->loopCount() != cLoopCountNotSeen)
82 m_repetitionCount = m_reader->loopCount(); 82 m_repetitionCount = m_reader->loopCount();
83 return m_repetitionCount; 83 return m_repetitionCount;
84 } 84 }
85 85
86 bool GIFImageDecoder::frameIsCompleteAtIndex(size_t index) const 86 bool GIFImageDecoder::frameIsFullyReceivedAtIndex(size_t index) const
87 { 87 {
88 return m_reader && (index < m_reader->imagesCount()) && m_reader->frameConte xt(index)->isComplete(); 88 return m_reader && (index < m_reader->imagesCount()) && m_reader->frameConte xt(index)->isComplete();
Peter Kasting 2016/05/10 00:00:13 Hmm. This will always return false if decoding fa
aleksandar.stojiljkovic 2016/05/10 21:59:31 What would be the usage of returning "frame is ful
Peter Kasting 2016/05/11 00:33:02 We know we're not going to do any further updating
aleksandar.stojiljkovic 2016/05/11 11:05:15 The usage of this is in [1] - GraphicsContext::com
scroggo_chromium 2016/05/11 15:17:34 But it also will be used in crrev.com/1925533003 t
Peter Kasting 2016/05/11 18:29:34 The only reason we ever use low-quality filtering
aleksandar.stojiljkovic 2016/05/16 13:09:49 Done. Clear now; failed() added to "fully received
89 } 89 }
90 90
91 float GIFImageDecoder::frameDurationAtIndex(size_t index) const 91 float GIFImageDecoder::frameDurationAtIndex(size_t index) const
92 { 92 {
93 return (m_reader && (index < m_reader->imagesCount()) && 93 return (m_reader && (index < m_reader->imagesCount()) &&
94 m_reader->frameContext(index)->isHeaderDefined()) ? 94 m_reader->frameContext(index)->isHeaderDefined()) ?
95 m_reader->frameContext(index)->delayTime() : 0; 95 m_reader->frameContext(index)->delayTime() : 0;
96 } 96 }
97 97
98 bool GIFImageDecoder::setFailed() 98 bool GIFImageDecoder::setFailed()
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after
368 368
369 // Update our status to be partially complete. 369 // Update our status to be partially complete.
370 buffer->setStatus(ImageFrame::FramePartial); 370 buffer->setStatus(ImageFrame::FramePartial);
371 371
372 // Reset the alpha pixel tracker for this frame. 372 // Reset the alpha pixel tracker for this frame.
373 m_currentBufferSawAlpha = false; 373 m_currentBufferSawAlpha = false;
374 return true; 374 return true;
375 } 375 }
376 376
377 } // namespace blink 377 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698