Bug 695763 (Part 1) - Add imgIContainer::IsDecoded. r=joe sr=bz

This commit is contained in:
Seth Fowler 2013-05-22 17:27:02 +08:00
Родитель 1c1aafd579
Коммит 8252e3fa97
4 изменённых файлов: 25 добавлений и 1 удалений

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

@ -57,7 +57,7 @@ native nsSize(nsSize);
*
* Internally, imgIContainer also manages animation of images.
*/
[scriptable, builtinclass, uuid(b56906e9-830c-45f4-b572-8c71e7619dad)]
[scriptable, builtinclass, uuid(f9029a03-758c-4047-a1f3-4b2e51e47363)]
interface imgIContainer : nsISupports
{
/**
@ -232,6 +232,14 @@ interface imgIContainer : nsISupports
*/
[noscript] void startDecoding();
/*
* Returns true if no more decoding can be performed on this image. Images
* with errors return true since they cannot be decoded any further. Note that
* because decoded images may be discarded, isDecoded() may return false even
* if it has returned true in the past.
*/
[noscript, notxpcom, nostdcall] bool isDecoded();
/**
* Increments the lock count on the image. An image will not be discarded
* as long as the lock count is nonzero. Note that it is still possible for

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

@ -231,6 +231,12 @@ ImageWrapper::StartDecoding()
return mInnerImage->StartDecoding();
}
bool
ImageWrapper::IsDecoded()
{
return mInnerImage->IsDecoded();
}
NS_IMETHODIMP
ImageWrapper::LockImage()
{

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

@ -2319,6 +2319,11 @@ RasterImage::StartDecoding()
return RequestDecodeCore(SYNCHRONOUS_NOTIFY_AND_SOME_DECODE);
}
bool
RasterImage::IsDecoded()
{
return mDecoded || mError;
}
NS_IMETHODIMP
RasterImage::RequestDecodeCore(RequestDecodeType aDecodeType)

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

@ -762,6 +762,11 @@ VectorImage::StartDecoding()
return NS_OK;
}
bool
VectorImage::IsDecoded()
{
return mIsFullyLoaded || mError;
}
//******************************************************************************
/* void lockImage() */