mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-24 05:11:16 +00:00
Bug 1370412 - Part 0. Add imgIContainer::GetNativeSizesLength to determine a ceiling on the maximum number of expected, unique surfaces. r=tnikkel
This commit is contained in:
parent
9b8908c88e
commit
480d81cc52
@ -134,6 +134,12 @@ DynamicImage::GetNativeSizes(nsTArray<IntSize>& aNativeSizes) const
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
size_t
|
||||
DynamicImage::GetNativeSizesLength() const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
DynamicImage::GetIntrinsicSize(nsSize* aSize)
|
||||
{
|
||||
|
@ -32,6 +32,7 @@ public:
|
||||
|
||||
// Inherited methods from Image.
|
||||
nsresult GetNativeSizes(nsTArray<gfx::IntSize>& aNativeSizes) const override;
|
||||
size_t GetNativeSizesLength() const override;
|
||||
virtual already_AddRefed<ProgressTracker> GetProgressTracker() override;
|
||||
virtual size_t SizeOfSourceWithComputedFallback(
|
||||
SizeOfState& aState) const override;
|
||||
|
@ -145,6 +145,12 @@ ImageWrapper::GetNativeSizes(nsTArray<IntSize>& aNativeSizes) const
|
||||
return mInnerImage->GetNativeSizes(aNativeSizes);
|
||||
}
|
||||
|
||||
size_t
|
||||
ImageWrapper::GetNativeSizesLength() const
|
||||
{
|
||||
return mInnerImage->GetNativeSizesLength();
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
ImageWrapper::GetIntrinsicSize(nsSize* aSize)
|
||||
{
|
||||
|
@ -23,6 +23,7 @@ public:
|
||||
|
||||
// Inherited methods from Image.
|
||||
nsresult GetNativeSizes(nsTArray<gfx::IntSize>& aNativeSizes) const override;
|
||||
size_t GetNativeSizesLength() const override;
|
||||
virtual already_AddRefed<ProgressTracker> GetProgressTracker() override;
|
||||
|
||||
virtual size_t
|
||||
|
@ -241,6 +241,21 @@ RasterImage::GetNativeSizes(nsTArray<IntSize>& aNativeSizes) const
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
//******************************************************************************
|
||||
size_t
|
||||
RasterImage::GetNativeSizesLength() const
|
||||
{
|
||||
if (mError || !mHasSize) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (mNativeSizes.IsEmpty()) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
return mNativeSizes.Length();
|
||||
}
|
||||
|
||||
//******************************************************************************
|
||||
NS_IMETHODIMP
|
||||
RasterImage::GetIntrinsicSize(nsSize* aSize)
|
||||
|
@ -161,6 +161,7 @@ public:
|
||||
#endif
|
||||
|
||||
nsresult GetNativeSizes(nsTArray<gfx::IntSize>& aNativeSizes) const override;
|
||||
size_t GetNativeSizesLength() const override;
|
||||
virtual nsresult StartAnimation() override;
|
||||
virtual nsresult StopAnimation() override;
|
||||
|
||||
|
@ -528,6 +528,13 @@ VectorImage::GetNativeSizes(nsTArray<IntSize>& aNativeSizes) const
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
//******************************************************************************
|
||||
size_t
|
||||
VectorImage::GetNativeSizesLength() const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
//******************************************************************************
|
||||
NS_IMETHODIMP_(void)
|
||||
VectorImage::RequestRefresh(const TimeStamp& aTime)
|
||||
|
@ -35,6 +35,7 @@ public:
|
||||
|
||||
// Methods inherited from Image
|
||||
nsresult GetNativeSizes(nsTArray<gfx::IntSize>& aNativeSizes) const override;
|
||||
size_t GetNativeSizesLength() const override;
|
||||
virtual size_t SizeOfSourceWithComputedFallback(SizeOfState& aState)
|
||||
const override;
|
||||
virtual void CollectSizeOfSurfaces(nsTArray<SurfaceMemoryCounter>& aCounters,
|
||||
|
@ -565,5 +565,7 @@ interface imgIContainer : nsISupports
|
||||
* Get the set of sizes the image can decode to natively.
|
||||
*/
|
||||
virtual nsresult GetNativeSizes(nsTArray<nsIntSize>& aNativeSizes) const = 0;
|
||||
|
||||
virtual size_t GetNativeSizesLength() const = 0;
|
||||
%}
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user