| Index: Source/core/platform/image-decoders/ImageDecoder.h
|
| diff --git a/Source/core/platform/image-decoders/ImageDecoder.h b/Source/core/platform/image-decoders/ImageDecoder.h
|
| index 83dbdc070a653ec942c629b7e635ae8c4f37560e..1ad13f7820441d17a52618b7775f0b0225f48a09 100644
|
| --- a/Source/core/platform/image-decoders/ImageDecoder.h
|
| +++ b/Source/core/platform/image-decoders/ImageDecoder.h
|
| @@ -117,6 +117,7 @@ namespace WebCore {
|
| FrameDisposalMethod disposalMethod() const { return m_disposalMethod; }
|
| bool premultiplyAlpha() const { return m_premultiplyAlpha; }
|
| void reportMemoryUsage(MemoryObjectInfo*) const;
|
| + size_t requiredPreviousFrameIndex() const { return m_requiredPreviousFrameIndex; }
|
|
|
| void setHasAlpha(bool alpha);
|
| void setOriginalFrameRect(const IntRect& r) { m_originalFrameRect = r; }
|
| @@ -124,6 +125,7 @@ namespace WebCore {
|
| void setDuration(unsigned duration) { m_duration = duration; }
|
| void setDisposalMethod(FrameDisposalMethod method) { m_disposalMethod = method; }
|
| void setPremultiplyAlpha(bool premultiplyAlpha) { m_premultiplyAlpha = premultiplyAlpha; }
|
| + void setRequiredPreviousFrameIndex(size_t previousFrameIndex) { m_requiredPreviousFrameIndex = previousFrameIndex; }
|
|
|
| inline void setRGBA(int x, int y, unsigned r, unsigned g, unsigned b, unsigned a)
|
| {
|
| @@ -202,6 +204,10 @@ namespace WebCore {
|
| unsigned m_duration;
|
| FrameDisposalMethod m_disposalMethod;
|
| bool m_premultiplyAlpha;
|
| +
|
| + // The frame that must be decoded before this frame can be decoded.
|
| + // |notFound| if this frame doesn't require any previous frame.
|
| + size_t m_requiredPreviousFrameIndex;
|
| };
|
|
|
| // ImageDecoder is a base for all format-specific decoders
|
| @@ -371,10 +377,10 @@ namespace WebCore {
|
|
|
| bool failed() const { return m_failed; }
|
|
|
| - // Clears decoded pixel data from before the provided frame unless that
|
| + // Clears decoded pixel data except the provided frame unless that
|
| // data may be needed to decode future frames (e.g. due to GIF frame
|
| // compositing).
|
| - virtual void clearFrameBufferCache(size_t) { }
|
| + void clearFrameBufferCache(size_t clearExceptFrame);
|
|
|
| #if ENABLE(IMAGE_DECODER_DOWN_SAMPLING)
|
| void setMaxNumPixels(int m) { m_maxNumPixels = m; }
|
| @@ -395,6 +401,12 @@ namespace WebCore {
|
| }
|
|
|
| protected:
|
| + // Finds the previous required frame for decoding the given frame.
|
| + // Returns notFound if this frame doesn't require any previous frame.
|
| + // Subclasses should call this function and cache the result by calling
|
| + // ImageFrame::setRequiredPreviousFrame() when a new frame is created.
|
| + size_t findRequiredPreviousFrame(size_t frameIndex);
|
| +
|
| void prepareScaleDataIfNecessary();
|
| int upperBoundScaledX(int origX, int searchStart = 0);
|
| int lowerBoundScaledX(int origX, int searchStart = 0);
|
|
|