Bug 1291045 (Part 3) - Handle interactions with the SurfaceCache in DecodingTask. r=dholbert,edwin

This commit is contained in:
Seth Fowler
2016-08-04 18:59:10 -07:00
parent 35e9d64ec9
commit 2c64c4a4f9
5 changed files with 110 additions and 28 deletions

View File

@@ -14,12 +14,14 @@
#include "mozilla/NotNull.h"
#include "mozilla/RefPtr.h"
#include "imgFrame.h"
#include "SourceBuffer.h"
namespace mozilla {
namespace image {
class Decoder;
class RasterImage;
/// A priority hint that DecodePool can use when scheduling an IDecodingTask.
enum class TaskPriority : uint8_t
@@ -63,7 +65,8 @@ class DecodingTask final : public IDecodingTask
public:
NS_INLINE_DECL_THREADSAFE_REFCOUNTING(DecodingTask, override)
explicit DecodingTask(NotNull<Decoder*> aDecoder);
DecodingTask(NotNull<RasterImage*> aImage,
NotNull<Decoder*> aDecoder);
void Run() override;
bool ShouldPreferSyncRun() const override;
@@ -75,9 +78,11 @@ public:
NotNull<Decoder*> GetDecoder() const override { return mDecoder; }
private:
virtual ~DecodingTask() { }
virtual ~DecodingTask();
NotNull<RefPtr<RasterImage>> mImage;
NotNull<RefPtr<Decoder>> mDecoder;
RefPtr<imgFrame> mSurface;
};