Bug 909589 - Ensure FrameAnimator is created with the correct animation mode. r=seth
authorRobert Lickenbrock <rclickenbrock@gmail.com>
Fri, 25 Apr 2014 16:33:00 -0400
changeset 198933 88f7fddea8058512b7652451adb972c2b41b55c3
parent 198932 9baacd7d775fb7d973781b0943ffdb00cc3a358a
child 198934 766648238bd3c6bbdce631ac93ecc2678b1c61be
push id3624
push userasasaki@mozilla.com
push dateMon, 09 Jun 2014 21:49:01 +0000
treeherdermozilla-beta@b1a5da15899a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersseth
bugs909589
milestone31.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 909589 - Ensure FrameAnimator is created with the correct animation mode. r=seth
image/src/FrameAnimator.cpp
image/src/FrameAnimator.h
image/src/RasterImage.cpp
--- a/image/src/FrameAnimator.cpp
+++ b/image/src/FrameAnimator.cpp
@@ -6,21 +6,22 @@
 #include "FrameAnimator.h"
 #include "FrameBlender.h"
 
 #include "imgIContainer.h"
 
 using namespace mozilla::image;
 using namespace mozilla;
 
-FrameAnimator::FrameAnimator(FrameBlender& aFrameBlender)
+FrameAnimator::FrameAnimator(FrameBlender& aFrameBlender,
+                             uint16_t aAnimationMode)
   : mCurrentAnimationFrameIndex(0)
   , mLoopCounter(-1)
   , mFrameBlender(aFrameBlender)
-  , mAnimationMode(imgIContainer::kNormalAnimMode)
+  , mAnimationMode(aAnimationMode)
   , mDoneDecoding(false)
 {
 }
 
 int32_t
 FrameAnimator::GetSingleLoopTime() const
 {
   // If we aren't done decoding, we don't know the image's full play time.
--- a/image/src/FrameAnimator.h
+++ b/image/src/FrameAnimator.h
@@ -13,17 +13,17 @@
 namespace mozilla {
 namespace image {
 
 class FrameBlender;
 
 class FrameAnimator
 {
 public:
-  FrameAnimator(FrameBlender& aBlender);
+  FrameAnimator(FrameBlender& aBlender, uint16_t aAnimationMode);
 
   /**
    * Return value from RequestRefresh. Tells callers what happened in that call
    * to RequestRefresh.
    */
   struct RefreshResult
   {
     // The dirty rectangle to be re-drawn after this RequestRefresh().
--- a/image/src/RasterImage.cpp
+++ b/image/src/RasterImage.cpp
@@ -1122,17 +1122,17 @@ RasterImage::OutOfProcessSizeOfDecoded()
 }
 
 void
 RasterImage::EnsureAnimExists()
 {
   if (!mAnim) {
 
     // Create the animation context
-    mAnim = new FrameAnimator(mFrameBlender);
+    mAnim = new FrameAnimator(mFrameBlender, mAnimationMode);
 
     // We don't support discarding animated images (See bug 414259).
     // Lock the image and throw away the key.
     //
     // Note that this is inefficient, since we could get rid of the source
     // data too. However, doing this is actually hard, because we're probably
     // calling ensureAnimExists mid-decode, and thus we're decoding out of
     // the source buffer. Since we're going to fix this anyway later, and