Bug 1159409 - (Part 1-) - Remove Init() from the Image interface. r=tn

This commit is contained in:
Seth Fowler 2015-04-28 16:07:24 -07:00
parent 4f252fcf6a
commit bf46701f2d
7 changed files with 4 additions and 31 deletions

View File

@ -24,12 +24,6 @@ namespace image {
// Inherited methods from Image.
nsresult
DynamicImage::Init(const char* aMimeType, uint32_t aFlags)
{
return NS_OK;
}
already_AddRefed<ProgressTracker>
DynamicImage::GetProgressTracker()
{

View File

@ -31,8 +31,6 @@ public:
}
// Inherited methods from Image.
virtual nsresult Init(const char* aMimeType, uint32_t aFlags) override;
virtual already_AddRefed<ProgressTracker> GetProgressTracker() override;
virtual size_t SizeOfSourceWithComputedFallback(
MallocSizeOf aMallocSizeOf) const override;

View File

@ -173,15 +173,6 @@ public:
static const uint32_t INIT_FLAG_TRANSIENT = 0x8;
static const uint32_t INIT_FLAG_DOWNSCALE_DURING_DECODE = 0x10;
/**
* Creates a new image container.
*
* @param aMimeType The mimetype of the image.
* @param aFlags Initialization flags of the INIT_FLAG_* variety.
*/
virtual nsresult Init(const char* aMimeType,
uint32_t aFlags) = 0;
virtual already_AddRefed<ProgressTracker> GetProgressTracker() = 0;
virtual void SetProgressTracker(ProgressTracker* aProgressTracker) {}

View File

@ -21,12 +21,6 @@ namespace image {
// Inherited methods from Image.
nsresult
ImageWrapper::Init(const char* aMimeType, uint32_t aFlags)
{
return mInnerImage->Init(aMimeType, aFlags);
}
already_AddRefed<ProgressTracker>
ImageWrapper::GetProgressTracker()
{

View File

@ -22,8 +22,6 @@ public:
NS_DECL_IMGICONTAINER
// Inherited methods from Image.
virtual nsresult Init(const char* aMimeType, uint32_t aFlags) override;
virtual already_AddRefed<ProgressTracker> GetProgressTracker() override;
virtual size_t

View File

@ -166,9 +166,6 @@ public:
virtual nsresult StopAnimation() override;
// Methods inherited from Image
nsresult Init(const char* aMimeType,
uint32_t aFlags) override;
virtual void OnSurfaceDiscarded() override;
// Raster-specific methods
@ -288,6 +285,8 @@ public:
}
private:
nsresult Init(const char* aMimeType, uint32_t aFlags);
DrawResult DrawWithPreDownscaleIfNeeded(DrawableFrameRef&& aFrameRef,
gfxContext* aContext,
const nsIntSize& aSize,

View File

@ -34,9 +34,6 @@ public:
// (no public constructor - use ImageFactory)
// Methods inherited from Image
nsresult Init(const char* aMimeType,
uint32_t aFlags) override;
virtual size_t SizeOfSourceWithComputedFallback(MallocSizeOf aMallocSizeOf)
const override;
virtual void CollectSizeOfSurfaces(nsTArray<SurfaceMemoryCounter>& aCounters,
@ -84,6 +81,8 @@ protected:
void Show(gfxDrawable* aDrawable, const SVGDrawingParameters& aParams);
private:
nsresult Init(const char* aMimeType, uint32_t aFlags);
/**
* In catastrophic circumstances like a GPU driver crash, we may lose our
* surfaces even if they're locked. RecoverFromLossOfSurfaces discards all