Bug 865993. For layerized images GetImageContainer has the same meaning as Draw()'ing the image, and Draw will not be called on the image, so send the unlocked draw notification there too. r=joedrew

This commit is contained in:
Timothy Nikkel 2013-04-26 14:58:17 -05:00
parent 6542a83d06
commit fe2b9609be
2 changed files with 13 additions and 7 deletions

View File

@ -1105,6 +1105,10 @@ RasterImage::GetImageContainer(LayerManager* aManager, ImageContainer **_retval)
return NS_OK;
}
if (IsUnlocked() && mStatusTracker) {
mStatusTracker->OnUnlockedDraw();
}
if (mImageContainer) {
*_retval = mImageContainer;
NS_ADDREF(*_retval);
@ -3136,12 +3140,8 @@ RasterImage::Draw(gfxContext *aContext,
DiscardTracker::Reset(&mDiscardTrackerNode);
}
// We would like to just check if we have a zero lock count, but we can't do
// that for animated images because in EnsureAnimExists we lock the image and
// never unlock so that animated images always have their lock count >= 1. In
// that case we use our animation consumers count as a proxy for lock count.
if (mLockCount == 0 || (mAnim && mAnimationConsumers == 0)) {
if (mStatusTracker)
if (IsUnlocked() && mStatusTracker) {
mStatusTracker->OnUnlockedDraw();
}

View File

@ -716,6 +716,12 @@ private:
};
NS_IMETHOD RequestDecodeCore(RequestDecodeType aDecodeType);
// We would like to just check if we have a zero lock count, but we can't do
// that for animated images because in EnsureAnimExists we lock the image and
// never unlock so that animated images always have their lock count >= 1. In
// that case we use our animation consumers count as a proxy for lock count.
bool IsUnlocked() { return (mLockCount == 0 || (mAnim && mAnimationConsumers == 0)); }
private: // data
nsIntSize mSize;