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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 | 59 |
60 virtual unsigned frameDurationAtIndex(size_t index) { return 0; } | 60 virtual unsigned frameDurationAtIndex(size_t index) { return 0; } |
61 | 61 |
62 enum GIFQuery { GIFFullQuery, GIFSizeQuery, GIFFrameCountQuery }; | 62 enum GIFQuery { GIFFullQuery, GIFSizeQuery, GIFFrameCountQuery }; |
63 | 63 |
64 void decode(GIFQuery, unsigned haltAtFrame); | 64 void decode(GIFQuery, unsigned haltAtFrame); |
65 | 65 |
66 // Callbacks from the GIF reader. | 66 // Callbacks from the GIF reader. |
67 bool sizeNowAvailable(unsigned width, unsigned height); | 67 bool sizeNowAvailable(unsigned width, unsigned height); |
68 void decodingHalted(unsigned bytesLeft); | 68 void decodingHalted(unsigned bytesLeft); |
69 void haveDecodedRow(unsigned frameIndex, unsigned char* rowBuffer, unsig
ned char* rowEnd, unsigned rowNumber, | 69 bool haveDecodedRow(unsigned frameIndex, unsigned char* rowBuffer, unsig
ned char* rowEnd, unsigned rowNumber, |
70 unsigned repeatCount, bool writeTransparentPixels); | 70 unsigned repeatCount, bool writeTransparentPixels); |
71 void frameComplete(unsigned frameIndex, unsigned frameDuration, RGBA32Bu
ffer::FrameDisposalMethod disposalMethod); | 71 void frameComplete(unsigned frameIndex, unsigned frameDuration, RGBA32Bu
ffer::FrameDisposalMethod disposalMethod); |
72 void gifComplete(); | 72 void gifComplete(); |
73 | 73 |
74 private: | 74 private: |
75 // Called to initialize the frame buffer with the given index, based on
the | 75 // Called to initialize the frame buffer with the given index, based on
the |
76 // previous frame's disposal method. Returns true on success. On failure
, | 76 // previous frame's disposal method. Returns true on success. On failure
, |
77 // this will mark the image as failed. | 77 // this will mark the image as failed. |
78 bool initFrameBuffer(unsigned frameIndex); | 78 bool initFrameBuffer(unsigned frameIndex); |
79 | 79 |
80 bool m_frameCountValid; | 80 bool m_frameCountValid; |
81 bool m_currentBufferSawAlpha; | 81 bool m_currentBufferSawAlpha; |
82 mutable int m_repetitionCount; | 82 mutable int m_repetitionCount; |
83 GIFImageDecoderPrivate* m_reader; | 83 GIFImageDecoderPrivate* m_reader; |
84 }; | 84 }; |
85 | 85 |
86 } // namespace WebCore | 86 } // namespace WebCore |
87 | 87 |
88 #endif | 88 #endif |
OLD | NEW |