summaryrefslogtreecommitdiff
path: root/image/AnimationSurfaceProvider.h
diff options
context:
space:
mode:
Diffstat (limited to 'image/AnimationSurfaceProvider.h')
-rw-r--r--image/AnimationSurfaceProvider.h17
1 files changed, 13 insertions, 4 deletions
diff --git a/image/AnimationSurfaceProvider.h b/image/AnimationSurfaceProvider.h
index bf87f37ac4..720cae57e7 100644
--- a/image/AnimationSurfaceProvider.h
+++ b/image/AnimationSurfaceProvider.h
@@ -13,6 +13,7 @@
#include "FrameAnimator.h"
#include "IDecodingTask.h"
#include "ISurfaceProvider.h"
+#include "AnimationFrameBuffer.h"
namespace mozilla {
namespace image {
@@ -31,7 +32,8 @@ public:
AnimationSurfaceProvider(NotNull<RasterImage*> aImage,
const SurfaceKey& aSurfaceKey,
- NotNull<Decoder*> aDecoder);
+ NotNull<Decoder*> aDecoder,
+ size_t aCurrentFrame);
//////////////////////////////////////////////////////////////////////////////
@@ -44,10 +46,13 @@ public:
DrawableSurface Surface() override { return DrawableSurface(WrapNotNull(this)); }
bool IsFinished() const override;
+ bool IsFullyDecoded() const override;
size_t LogicalSizeInBytes() const override;
void AddSizeOfExcludingThis(MallocSizeOf aMallocSizeOf,
size_t& aHeapSizeOut,
size_t& aNonHeapSizeOut) override;
+ void Reset() override;
+ void Advance(size_t aFrame) override;
protected:
DrawableFrameRef DrawableRef(size_t aFrame) override;
@@ -77,11 +82,15 @@ private:
virtual ~AnimationSurfaceProvider();
void DropImageReference();
- void CheckForNewFrameAtYield();
- void CheckForNewFrameAtTerminalState();
void AnnounceSurfaceAvailable();
void FinishDecoding();
+ // @returns Whether or not we should continue decoding.
+ bool CheckForNewFrameAtYield();
+
+ // @returns Whether or not we should restart decoding.
+ bool CheckForNewFrameAtTerminalState();
+
/// The image associated with our decoder.
RefPtr<RasterImage> mImage;
@@ -95,7 +104,7 @@ private:
mutable Mutex mFramesMutex;
/// The frames of this animation, in order.
- nsTArray<RawAccessFrameRef> mFrames;
+ AnimationFrameBuffer mFrames;
};
} // namespace image