Bug 1256603. Change MultipartImage to use RequestDecode instead of GetFrame to avoid marking the frame as used. r=aosmond
authorTimothy Nikkel <tnikkel@gmail.com>
Sun, 14 Oct 2018 00:38:42 -0500
changeset 441151 ec0b10e9a616588eb248a72dd117582b00211fab
parent 441150 9343eb2d9c8203a4c85868264979c6f01c7b2bce
child 441152 d49587f5ccd37180d1f0d980c9dd076e7afa1bcb
push id34846
push usercbrindusan@mozilla.com
push dateSun, 14 Oct 2018 09:26:37 +0000
treeherdermozilla-central@d49587f5ccd3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersaosmond
bugs1256603
milestone64.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 1256603. Change MultipartImage to use RequestDecode instead of GetFrame to avoid marking the frame as used. r=aosmond
image/MultipartImage.cpp
--- a/image/MultipartImage.cpp
+++ b/image/MultipartImage.cpp
@@ -36,24 +36,26 @@ public:
     mImage = aImage;
 
     RefPtr<ProgressTracker> tracker = mImage->GetProgressTracker();
     tracker->AddObserver(this);
   }
 
   void BlockUntilDecodedAndFinishObserving()
   {
-    // Use GetFrame() to block until our image finishes decoding.
-    RefPtr<SourceSurface> surface =
-      mImage->GetFrame(imgIContainer::FRAME_CURRENT,
-                       imgIContainer::FLAG_SYNC_DECODE);
+    // Use RequestDecodeForSize() to block until our image finishes decoding.
+    // The size is ignored because we don't pass the FLAG_HIGH_QUALITY_SCALING
+    // flag.
+    mImage->RequestDecodeForSize(gfx::IntSize(0, 0),
+                                 imgIContainer::FLAG_SYNC_DECODE);
 
-    // GetFrame() should've sent synchronous notifications that would have
-    // caused us to call FinishObserving() (and null out mImage) already. If for
-    // some reason it didn't, we should do so here.
+
+    // RequestDecodeForSize() should've sent synchronous notifications that
+    // would have caused us to call FinishObserving() (and null out mImage)
+    // already. If for some reason it didn't, we should do so here.
     if (mImage) {
       FinishObserving();
     }
   }
 
   virtual void Notify(int32_t aType,
                       const nsIntRect* aRect = nullptr) override
   {