| OLD | NEW |
| 1 /* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ | 1 /* -*- Mode: C; tab-width: 2; 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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 CompuServe Incorporated maintains a mailing list with all those individuals and | 69 CompuServe Incorporated maintains a mailing list with all those individuals and |
| 70 organizations who wish to receive copies of this document when it is corrected | 70 organizations who wish to receive copies of this document when it is corrected |
| 71 or revised. This service is offered free of charge; please provide us with your | 71 or revised. This service is offered free of charge; please provide us with your |
| 72 mailing address. | 72 mailing address. |
| 73 */ | 73 */ |
| 74 | 74 |
| 75 #include "config.h" | 75 #include "config.h" |
| 76 #include "platform/image-decoders/gif/GIFImageReader.h" | 76 #include "platform/image-decoders/gif/GIFImageReader.h" |
| 77 | 77 |
| 78 #include <string.h> | 78 #include <string.h> |
| 79 #include "platform/graphics/ImageSource.h" | |
| 80 | 79 |
| 81 using blink::GIFImageDecoder; | 80 using blink::GIFImageDecoder; |
| 82 | 81 |
| 83 // GETN(n, s) requests at least 'n' bytes available from 'q', at start of state
's'. | 82 // GETN(n, s) requests at least 'n' bytes available from 'q', at start of state
's'. |
| 84 // | 83 // |
| 85 // Note, the hold will never need to be bigger than 256 bytes to gather up in th
e hold, | 84 // Note, the hold will never need to be bigger than 256 bytes to gather up in th
e hold, |
| 86 // as each GIF block (except colormaps) can never be bigger than 256 bytes. | 85 // as each GIF block (except colormaps) can never be bigger than 256 bytes. |
| 87 // Colormaps are directly copied in the resp. global_colormap or dynamically all
ocated local_colormap. | 86 // Colormaps are directly copied in the resp. global_colormap or dynamically all
ocated local_colormap. |
| 88 // So a fixed buffer in GIFImageReader is good enough. | 87 // So a fixed buffer in GIFImageReader is good enough. |
| 89 // This buffer is only needed to copy left-over data from one GifWrite call to t
he next | 88 // This buffer is only needed to copy left-over data from one GifWrite call to t
he next |
| (...skipping 752 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 842 rowIter = rowBuffer.begin(); | 841 rowIter = rowBuffer.begin(); |
| 843 rowsRemaining = m_frameContext->height(); | 842 rowsRemaining = m_frameContext->height(); |
| 844 | 843 |
| 845 // Clearing the whole suffix table lets us be more tolerant of bad data. | 844 // Clearing the whole suffix table lets us be more tolerant of bad data. |
| 846 for (int i = 0; i < clearCode; ++i) { | 845 for (int i = 0; i < clearCode; ++i) { |
| 847 suffix[i] = i; | 846 suffix[i] = i; |
| 848 suffixLength[i] = 1; | 847 suffixLength[i] = 1; |
| 849 } | 848 } |
| 850 return true; | 849 return true; |
| 851 } | 850 } |
| OLD | NEW |