зеркало из https://github.com/mozilla/gecko-dev.git
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:
Родитель
9b8908c88e
Коммит
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;
|
||||
%}
|
||||
};
|
||||
|
|
Загрузка…
Ссылка в новой задаче