| OLD | NEW |
| 1 /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ | 1 /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
| 2 /* ***** BEGIN LICENSE BLOCK ***** | 2 /* ***** BEGIN LICENSE BLOCK ***** |
| 3 * Version: MPL 1.1/GPL 2.0/LGPL 2.1 | 3 * Version: MPL 1.1/GPL 2.0/LGPL 2.1 |
| 4 * | 4 * |
| 5 * The contents of this file are subject to the Mozilla Public License Version | 5 * The contents of this file are subject to the Mozilla Public License Version |
| 6 * 1.1 (the "License"); you may not use this file except in compliance with | 6 * 1.1 (the "License"); you may not use this file except in compliance with |
| 7 * the License. You may obtain a copy of the License at | 7 * the License. You may obtain a copy of the License at |
| 8 * http://www.mozilla.org/MPL/ | 8 * http://www.mozilla.org/MPL/ |
| 9 * | 9 * |
| 10 * Software distributed under the License is distributed on an "AS IS" basis, | 10 * Software distributed under the License is distributed on an "AS IS" basis, |
| (...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 303 bool decode(size_t frameIndex); | 303 bool decode(size_t frameIndex); |
| 304 | 304 |
| 305 size_t imagesCount() const { | 305 size_t imagesCount() const { |
| 306 if (m_frames.isEmpty()) | 306 if (m_frames.isEmpty()) |
| 307 return 0; | 307 return 0; |
| 308 | 308 |
| 309 // This avoids counting an empty frame when the file is truncated right | 309 // This avoids counting an empty frame when the file is truncated right |
| 310 // after GIFControlExtension but before GIFImageHeader. | 310 // after GIFControlExtension but before GIFImageHeader. |
| 311 // FIXME: This extra complexity is not necessary and we should just report | 311 // FIXME: This extra complexity is not necessary and we should just report |
| 312 // m_frames.size(). | 312 // m_frames.size(). |
| 313 return m_frames.last()->isHeaderDefined() ? m_frames.size() | 313 return m_frames.back()->isHeaderDefined() ? m_frames.size() |
| 314 : m_frames.size() - 1; | 314 : m_frames.size() - 1; |
| 315 } | 315 } |
| 316 int loopCount() const { return m_loopCount; } | 316 int loopCount() const { return m_loopCount; } |
| 317 | 317 |
| 318 const GIFColorMap& globalColorMap() const { return m_globalColorMap; } | 318 const GIFColorMap& globalColorMap() const { return m_globalColorMap; } |
| 319 | 319 |
| 320 const GIFFrameContext* frameContext(size_t index) const { | 320 const GIFFrameContext* frameContext(size_t index) const { |
| 321 return index < m_frames.size() ? m_frames[index].get() : 0; | 321 return index < m_frames.size() ? m_frames[index].get() : 0; |
| 322 } | 322 } |
| 323 | 323 |
| (...skipping 30 matching lines...) Expand all Loading... |
| 354 int m_loopCount; // Netscape specific extension block to control the number | 354 int m_loopCount; // Netscape specific extension block to control the number |
| 355 // of animation loops a GIF renders. | 355 // of animation loops a GIF renders. |
| 356 | 356 |
| 357 Vector<std::unique_ptr<GIFFrameContext>> m_frames; | 357 Vector<std::unique_ptr<GIFFrameContext>> m_frames; |
| 358 | 358 |
| 359 RefPtr<blink::SegmentReader> m_data; | 359 RefPtr<blink::SegmentReader> m_data; |
| 360 bool m_parseCompleted; | 360 bool m_parseCompleted; |
| 361 }; | 361 }; |
| 362 | 362 |
| 363 #endif | 363 #endif |
| OLD | NEW |