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

Unified Diff: Source/core/platform/graphics/chromium/test/MockImageDecoder.h

Issue 17999003: Deferred image decoding to support animated GIFs (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: done Created 7 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/platform/graphics/chromium/LazyDecodingPixelRef.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/platform/graphics/chromium/test/MockImageDecoder.h
diff --git a/Source/core/platform/graphics/chromium/test/MockImageDecoder.h b/Source/core/platform/graphics/chromium/test/MockImageDecoder.h
index c72b46466d681e08b7a2a1add83a85c5be671493..c0d453b58333e172a74963c64ed1b89c5754b42a 100644
--- a/Source/core/platform/graphics/chromium/test/MockImageDecoder.h
+++ b/Source/core/platform/graphics/chromium/test/MockImageDecoder.h
@@ -35,6 +35,9 @@ public:
virtual void decoderBeingDestroyed() = 0;
virtual void frameBufferRequested() = 0;
virtual ImageFrame::FrameStatus frameStatus() = 0;
+ virtual size_t frameCount() = 0;
+ virtual int repetitionCount() const = 0;
+ virtual float frameDuration() const = 0;
};
class MockImageDecoder : public ImageDecoder {
@@ -43,7 +46,6 @@ public:
MockImageDecoder(MockImageDecoderClient* client)
: ImageDecoder(ImageSource::AlphaPremultiplied, ImageSource::GammaAndColorProfileApplied)
- , m_frameBufferRequestCount(0)
, m_client(client)
{ }
@@ -62,19 +64,35 @@ public:
virtual void setFrameHasAlpha(bool hasAlpha) { m_frameBufferCache[0].setHasAlpha(hasAlpha); }
+ virtual size_t frameCount()
+ {
+ return m_client->frameCount();
+ }
+
+ virtual int repetitionCount() const
+ {
+ return m_client->repetitionCount();
+ }
+
virtual ImageFrame* frameBufferAtIndex(size_t)
{
- ++m_frameBufferRequestCount;
m_client->frameBufferRequested();
m_frameBufferCache[0].setStatus(m_client->frameStatus());
return &m_frameBufferCache[0];
}
- int frameBufferRequestCount() const { return m_frameBufferRequestCount; }
+ virtual bool frameIsCompleteAtIndex(size_t) const
+ {
+ return m_client->frameStatus() == ImageFrame::FrameComplete;
+ }
+
+ virtual float frameDurationAtIndex(size_t) const
+ {
+ return m_client->frameDuration();
+ }
private:
- int m_frameBufferRequestCount;
MockImageDecoderClient* m_client;
};
« no previous file with comments | « Source/core/platform/graphics/chromium/LazyDecodingPixelRef.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698