Bug 413324 - "Not all image decoders call 'DecodingComplete', so for these the image is not 'optimized'" (Make the decoders all (except JPEG) use DecodingComplete) [p=alfredkayser@gmail.com (Alfred Kayser) r=stuart a=blocking1.9+]

git-svn-id: svn://10.0.0.236/trunk@245585 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
reed%reedloden.com 2008-02-13 10:54:39 +00:00
parent a523d30bfd
commit 10f2776e2b
4 changed files with 9 additions and 3 deletions

View File

@ -103,6 +103,8 @@ NS_IMETHODIMP nsBMPDecoder::Init(imgILoad *aLoad)
NS_IMETHODIMP nsBMPDecoder::Close()
{
PR_LOG(gBMPLog, PR_LOG_DEBUG, ("nsBMPDecoder::Close()\n"));
mImage->DecodingComplete();
if (mObserver) {
mObserver->OnStopFrame(nsnull, mFrame);
mObserver->OnStopContainer(nsnull, mImage);
@ -116,7 +118,6 @@ NS_IMETHODIMP nsBMPDecoder::Close()
NS_IMETHODIMP nsBMPDecoder::Flush()
{
mFrame->SetMutable(PR_FALSE);
return NS_OK;
}

View File

@ -113,6 +113,8 @@ NS_IMETHODIMP nsICODecoder::Close()
if (img)
img->ImageUpdated(nsnull, nsImageUpdateFlags_kBitsChanged, &r);
mImage->DecodingComplete();
if (mObserver) {
mObserver->OnDataAvailable(nsnull, mFrame, &r);
mObserver->OnStopFrame(nsnull, mFrame);

View File

@ -84,6 +84,8 @@ NS_IMETHODIMP nsIconDecoder::Init(imgILoad *aLoad)
NS_IMETHODIMP nsIconDecoder::Close()
{
mImage->DecodingComplete();
if (mObserver)
{
mObserver->OnStopFrame(nsnull, mFrame);
@ -96,7 +98,7 @@ NS_IMETHODIMP nsIconDecoder::Close()
NS_IMETHODIMP nsIconDecoder::Flush()
{
return NS_ERROR_NOT_IMPLEMENTED;
return NS_OK;
}
NS_IMETHODIMP nsIconDecoder::WriteFrom(nsIInputStream *inStr, PRUint32 count, PRUint32 *_retval)

View File

@ -100,6 +100,8 @@ NS_IMETHODIMP nsXBMDecoder::Init(imgILoad *aLoad)
NS_IMETHODIMP nsXBMDecoder::Close()
{
mImage->DecodingComplete();
mObserver->OnStopContainer(nsnull, mImage);
mObserver->OnStopDecode(nsnull, NS_OK, nsnull);
mObserver = nsnull;
@ -112,7 +114,6 @@ NS_IMETHODIMP nsXBMDecoder::Close()
NS_IMETHODIMP nsXBMDecoder::Flush()
{
mFrame->SetMutable(PR_FALSE);
return NS_OK;
}