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

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

Issue 14317005: Checking if frame is complete and access duration doesn't need a decode (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: fixed nits Created 7 years, 8 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
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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 enum GIFQuery { GIFFullQuery, GIFSizeQuery, GIFFrameCountQuery }; 42 enum GIFQuery { GIFFullQuery, GIFSizeQuery, GIFFrameCountQuery };
43 43
44 // ImageDecoder 44 // ImageDecoder
45 virtual String filenameExtension() const { return "gif"; } 45 virtual String filenameExtension() const { return "gif"; }
46 virtual void setData(SharedBuffer* data, bool allDataReceived); 46 virtual void setData(SharedBuffer* data, bool allDataReceived);
47 virtual bool isSizeAvailable(); 47 virtual bool isSizeAvailable();
48 virtual bool setSize(unsigned width, unsigned height); 48 virtual bool setSize(unsigned width, unsigned height);
49 virtual size_t frameCount(); 49 virtual size_t frameCount();
50 virtual int repetitionCount() const; 50 virtual int repetitionCount() const;
51 virtual ImageFrame* frameBufferAtIndex(size_t index); 51 virtual ImageFrame* frameBufferAtIndex(size_t index);
52 virtual bool frameIsCompleteAtIndex(size_t) const;
53 virtual float frameDurationAtIndex(size_t) const;
Alpha Left Google 2013/04/26 20:43:36 Done. Now it has a default implementation.
52 // CAUTION: setFailed() deletes |m_reader|. Be careful to avoid 54 // CAUTION: setFailed() deletes |m_reader|. Be careful to avoid
53 // accessing deleted memory, especially when calling this from inside 55 // accessing deleted memory, especially when calling this from inside
54 // GIFImageReader! 56 // GIFImageReader!
55 virtual bool setFailed(); 57 virtual bool setFailed();
56 virtual void clearFrameBufferCache(size_t clearBeforeFrame); 58 virtual void clearFrameBufferCache(size_t clearBeforeFrame);
57 59
58 // Callbacks from the GIF reader. 60 // Callbacks from the GIF reader.
59 bool haveDecodedRow(unsigned frameIndex, const Vector<unsigned char>& ro wBuffer, size_t width, size_t rowNumber, unsigned repeatCount, bool writeTranspa rentPixels); 61 bool haveDecodedRow(unsigned frameIndex, const Vector<unsigned char>& ro wBuffer, size_t width, size_t rowNumber, unsigned repeatCount, bool writeTranspa rentPixels);
60 bool frameComplete(unsigned frameIndex, unsigned frameDuration, ImageFra me::FrameDisposalMethod disposalMethod); 62 bool frameComplete(unsigned frameIndex, unsigned frameDuration, ImageFra me::FrameDisposalMethod disposalMethod);
61 void gifComplete(); 63 void gifComplete();
(...skipping 11 matching lines...) Expand all
73 bool initFrameBuffer(unsigned frameIndex); 75 bool initFrameBuffer(unsigned frameIndex);
74 76
75 bool m_currentBufferSawAlpha; 77 bool m_currentBufferSawAlpha;
76 mutable int m_repetitionCount; 78 mutable int m_repetitionCount;
77 OwnPtr<GIFImageReader> m_reader; 79 OwnPtr<GIFImageReader> m_reader;
78 }; 80 };
79 81
80 } // namespace WebCore 82 } // namespace WebCore
81 83
82 #endif 84 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698