| 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 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 275 | 275 |
| 276 const unsigned char* localColormap(const GIFFrameContext* frame) const | 276 const unsigned char* localColormap(const GIFFrameContext* frame) const |
| 277 { | 277 { |
| 278 return frame->isLocalColormapDefined ? data(frame->localColormapPosition
) : 0; | 278 return frame->isLocalColormapDefined ? data(frame->localColormapPosition
) : 0; |
| 279 } | 279 } |
| 280 int localColormapSize(const GIFFrameContext* frame) const | 280 int localColormapSize(const GIFFrameContext* frame) const |
| 281 { | 281 { |
| 282 return frame->isLocalColormapDefined ? frame->localColormapSize : 0; | 282 return frame->isLocalColormapDefined ? frame->localColormapSize : 0; |
| 283 } | 283 } |
| 284 | 284 |
| 285 const GIFFrameContext* frameContext() const | 285 const GIFFrameContext* frameContext(size_t index) const |
| 286 { | 286 { |
| 287 return m_currentDecodingFrame < m_frames.size() ? m_frames[m_currentDeco
dingFrame].get() : 0; | 287 return index < m_frames.size() ? m_frames[index].get() : 0; |
| 288 } | 288 } |
| 289 | 289 |
| 290 bool parseCompleted() const { return m_parseCompleted; } |
| 291 |
| 290 private: | 292 private: |
| 291 bool parse(size_t dataPosition, size_t len, bool parseSizeOnly); | 293 bool parse(size_t dataPosition, size_t len, bool parseSizeOnly); |
| 292 void setRemainingBytes(size_t); | 294 void setRemainingBytes(size_t); |
| 293 | 295 |
| 294 const unsigned char* data(size_t dataPosition) const | 296 const unsigned char* data(size_t dataPosition) const |
| 295 { | 297 { |
| 296 return reinterpret_cast<const unsigned char*>(m_data->data()) + dataPosi
tion; | 298 return reinterpret_cast<const unsigned char*>(m_data->data()) + dataPosi
tion; |
| 297 } | 299 } |
| 298 | 300 |
| 299 void addFrameIfNecessary(); | 301 void addFrameIfNecessary(); |
| (...skipping 20 matching lines...) Expand all Loading... |
| 320 int m_loopCount; // Netscape specific extension block to control the number
of animation loops a GIF renders. | 322 int m_loopCount; // Netscape specific extension block to control the number
of animation loops a GIF renders. |
| 321 | 323 |
| 322 Vector<OwnPtr<GIFFrameContext> > m_frames; | 324 Vector<OwnPtr<GIFFrameContext> > m_frames; |
| 323 size_t m_currentDecodingFrame; | 325 size_t m_currentDecodingFrame; |
| 324 | 326 |
| 325 RefPtr<WebCore::SharedBuffer> m_data; | 327 RefPtr<WebCore::SharedBuffer> m_data; |
| 326 bool m_parseCompleted; | 328 bool m_parseCompleted; |
| 327 }; | 329 }; |
| 328 | 330 |
| 329 #endif | 331 #endif |
| OLD | NEW |