зеркало из https://github.com/mozilla/gecko-dev.git
check to see if numframes > 1
This commit is contained in:
Родитель
147e289d6f
Коммит
7ecc928aa6
|
@ -100,7 +100,7 @@ nsresult imgRequest::AddObserver(imgIDecoderObserver *observer)
|
||||||
if (mObservers.Count() == 1) {
|
if (mObservers.Count() == 1) {
|
||||||
PRUint32 nframes;
|
PRUint32 nframes;
|
||||||
mImage->GetNumFrames(&nframes);
|
mImage->GetNumFrames(&nframes);
|
||||||
if (nframes > 0) {
|
if (nframes > 1) {
|
||||||
PR_LOG(gImgLog, PR_LOG_DEBUG,
|
PR_LOG(gImgLog, PR_LOG_DEBUG,
|
||||||
("[this=%p] imgRequest::AddObserver -- starting animation\n", this));
|
("[this=%p] imgRequest::AddObserver -- starting animation\n", this));
|
||||||
|
|
||||||
|
@ -121,7 +121,7 @@ nsresult imgRequest::RemoveObserver(imgIDecoderObserver *observer, nsresult stat
|
||||||
if (mImage) {
|
if (mImage) {
|
||||||
PRUint32 nframes;
|
PRUint32 nframes;
|
||||||
mImage->GetNumFrames(&nframes);
|
mImage->GetNumFrames(&nframes);
|
||||||
if (nframes > 0) {
|
if (nframes > 1) {
|
||||||
PR_LOG(gImgLog, PR_LOG_DEBUG,
|
PR_LOG(gImgLog, PR_LOG_DEBUG,
|
||||||
("[this=%p] imgRequest::RemoveObserver -- stopping animation\n", this));
|
("[this=%p] imgRequest::RemoveObserver -- stopping animation\n", this));
|
||||||
|
|
||||||
|
@ -164,6 +164,17 @@ NS_IMETHODIMP imgRequest::Cancel(nsresult status)
|
||||||
|
|
||||||
ImageCache::Remove(mURI);
|
ImageCache::Remove(mURI);
|
||||||
|
|
||||||
|
if (mImage) {
|
||||||
|
PRUint32 nframes;
|
||||||
|
mImage->GetNumFrames(&nframes);
|
||||||
|
if (nframes > 1) {
|
||||||
|
PR_LOG(gImgLog, PR_LOG_DEBUG,
|
||||||
|
("[this=%p] imgRequest::RemoveObserver -- stopping animation\n", this));
|
||||||
|
|
||||||
|
mImage->StopAnimation();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (mChannel && mProcessing)
|
if (mChannel && mProcessing)
|
||||||
return mChannel->Cancel(status);
|
return mChannel->Cancel(status);
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче