Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 75 void clearFrameBuffer(size_t frameIndex) override; | 75 void clearFrameBuffer(size_t frameIndex) override; |
| 76 virtual void decodeSize() { parse(GIFSizeQuery); } | 76 virtual void decodeSize() { parse(GIFSizeQuery); } |
| 77 size_t decodeFrameCount() override; | 77 size_t decodeFrameCount() override; |
| 78 void initializeNewFrame(size_t) override; | 78 void initializeNewFrame(size_t) override; |
| 79 void decode(size_t) override; | 79 void decode(size_t) override; |
| 80 | 80 |
| 81 // Parses as much as is needed to answer the query, ignoring bitmap | 81 // Parses as much as is needed to answer the query, ignoring bitmap |
| 82 // data. If parsing fails, sets the "decode failure" flag. | 82 // data. If parsing fails, sets the "decode failure" flag. |
| 83 void parse(GIFParseQuery); | 83 void parse(GIFParseQuery); |
| 84 | 84 |
| 85 // Called to initialize the frame buffer with the given index, based on | 85 // In addition to ImageDecoder::initFrameBuffer, also reset the alpha tracker |
| 86 // the previous frame's disposal method. Returns true on success. On | 86 // for this frame. Before calling this method, the callee must verify that |
|
scroggo_chromium
2016/11/14 13:51:46
caller*
joostouwerling
2016/11/14 16:25:10
Done.
| |
| 87 // failure, this will mark the image as failed. | 87 // the frame exists. |
| 88 bool initFrameBuffer(size_t frameIndex); | 88 bool initFrameBuffer(size_t) override; |
| 89 | |
| 90 // When the disposal method of the frame is DisposeOverWritePrevious, the | |
| 91 // next frame will use the previous frame's buffer as its starting state, so | |
| 92 // we can't take over the data in that case. Before calling this method, the | |
| 93 // callee must verify that the frame exists. | |
|
scroggo_chromium
2016/11/14 13:51:46
caller*
joostouwerling
2016/11/14 16:25:10
Done.
| |
| 94 bool canReusePreviousFrameBuffer(size_t) const override; | |
| 89 | 95 |
| 90 // Like clearCacheExceptFrame(), but preserves two frames instead of one. | 96 // Like clearCacheExceptFrame(), but preserves two frames instead of one. |
| 91 size_t clearCacheExceptTwoFrames(size_t, size_t); | 97 size_t clearCacheExceptTwoFrames(size_t, size_t); |
| 92 | 98 |
| 93 bool m_currentBufferSawAlpha; | 99 bool m_currentBufferSawAlpha; |
| 94 mutable int m_repetitionCount; | 100 mutable int m_repetitionCount; |
| 95 std::unique_ptr<GIFImageReader> m_reader; | 101 std::unique_ptr<GIFImageReader> m_reader; |
| 96 }; | 102 }; |
| 97 | 103 |
| 98 } // namespace blink | 104 } // namespace blink |
| 99 | 105 |
| 100 #endif | 106 #endif |
| OLD | NEW |