Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(266)

Side by Side Diff: WebCore/platform/image-decoders/gif/GIFImageDecoder.h

Issue 521039: Merge 52833 - Public GIF decoder should stop decoding when allocation fails... (Closed) Base URL: svn://chrome-svn/chrome/branches/WebKit/249/
Patch Set: Created 10 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « WebCore/ChangeLog ('k') | WebCore/platform/image-decoders/gif/GIFImageDecoder.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « WebCore/ChangeLog ('k') | WebCore/platform/image-decoders/gif/GIFImageDecoder.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698