Bug 1368776 - Part 1. Move RasterImage's ImageContainer state to ImageResource. r=tnikkel

This state will eventually be used by VectorImage when it supports image
containers. For now, it is harmless beyond using slightly more memory
for SVGs.
This commit is contained in:
Andrew Osmond 2017-11-17 06:45:23 -05:00
Родитель 37395798ee
Коммит b43a2010d4
4 изменённых файлов: 16 добавлений и 16 удалений

Просмотреть файл

@ -58,7 +58,10 @@ ImageResource::ImageResource(ImageURL* aURI) :
mAnimationMode(kNormalAnimMode),
mInitialized(false),
mAnimating(false),
mError(false)
mError(false),
mImageProducerID(ImageContainer::AllocateProducerID()),
mLastFrameID(0),
mLastImageContainerDrawResult(DrawResult::NOT_READY)
{ }
ImageResource::~ImageResource()

Просмотреть файл

@ -11,6 +11,7 @@
#include "gfx2DGlue.h"
#include "imgIContainer.h"
#include "ImageURL.h"
#include "ImageContainer.h"
#include "nsStringFwd.h"
#include "ProgressTracker.h"
#include "SurfaceCache.h"
@ -333,6 +334,17 @@ protected:
bool mInitialized:1; // Have we been initalized?
bool mAnimating:1; // Are we currently animating?
bool mError:1; // Error handling
// A weak pointer to our ImageContainer, which stays alive only as long as
// the layer system needs it.
WeakPtr<layers::ImageContainer> mImageContainer;
layers::ImageContainer::ProducerID mImageProducerID;
layers::ImageContainer::FrameID mLastFrameID;
// If mImageContainer is non-null, this contains the DrawResult we obtained
// the last time we updated it.
DrawResult mLastImageContainerDrawResult;
};
} // namespace image

Просмотреть файл

@ -16,7 +16,6 @@
#include "prenv.h"
#include "prsystem.h"
#include "IDecodingTask.h"
#include "ImageContainer.h"
#include "ImageRegion.h"
#include "Layers.h"
#include "LookupResult.h"
@ -73,9 +72,6 @@ RasterImage::RasterImage(ImageURL* aURI /* = nullptr */) :
mSize(0,0),
mLockCount(0),
mDecodeCount(0),
mImageProducerID(ImageContainer::AllocateProducerID()),
mLastFrameID(0),
mLastImageContainerDrawResult(DrawResult::NOT_READY),
#ifdef DEBUG
mFramesNotified(0),
#endif

Просмотреть файл

@ -400,17 +400,6 @@ private: // data
// This is currently only used for statistics
int32_t mDecodeCount;
// A weak pointer to our ImageContainer, which stays alive only as long as
// the layer system needs it.
WeakPtr<layers::ImageContainer> mImageContainer;
layers::ImageContainer::ProducerID mImageProducerID;
layers::ImageContainer::FrameID mLastFrameID;
// If mImageContainer is non-null, this contains the DrawResult we obtained
// the last time we updated it.
DrawResult mLastImageContainerDrawResult;
#ifdef DEBUG
uint32_t mFramesNotified;
#endif