Bug 673535 - RasterImage::Anim::ensureAnimExists() should be cleaned up.

This commit is contained in:
Scott Johnson 2011-07-23 14:49:00 -04:00
Родитель 4662ff33aa
Коммит a9ccd51c46
2 изменённых файлов: 3 добавлений и 6 удалений

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

@ -842,8 +842,7 @@ RasterImage::InternalAddFrame(PRUint32 framenum,
if (mFrames.Length() == 1) {
// Since we're about to add our second frame, initialize animation stuff
if (!ensureAnimExists())
return NS_ERROR_OUT_OF_MEMORY;
EnsureAnimExists();
// If we dispose of the first frame by clearing it, then the
// First Frame's refresh area is all of itself.
@ -1113,8 +1112,7 @@ RasterImage::StartAnimation()
NS_ABORT_IF_FALSE(ShouldAnimate(), "Should not animate!");
if (!ensureAnimExists())
return NS_ERROR_OUT_OF_MEMORY;
EnsureAnimExists();
NS_ABORT_IF_FALSE(mAnim && !mAnim->timer, "Anim must exist and not have a timer yet");

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

@ -382,7 +382,7 @@ private:
imgFrame* GetCurrentDrawableImgFrame();
PRUint32 GetCurrentImgFrameIndex() const;
inline Anim* ensureAnimExists()
inline void EnsureAnimExists()
{
if (!mAnim) {
@ -400,7 +400,6 @@ private:
// is acceptable for the moment.
LockImage();
}
return mAnim;
}
/** Function for doing the frame compositing of animations