Bug 1287691 (Part 4) - Leave notifying decoding progress for each frame to DecodingTask. r=edwin
authorSeth Fowler <mark.seth.fowler@gmail.com>
Mon, 18 Jul 2016 23:53:20 -0700
changeset 345849 f518461663cdd993b9c95a8a04d902d2427f40c0
parent 345848 2448661e77258bcb13ba892a7e32c5a8ce0e584b
child 345850 744232e7c04a6e4c7167822b58163c712feb4719
push id6389
push userraliiev@mozilla.com
push dateMon, 19 Sep 2016 13:38:22 +0000
treeherdermozilla-beta@01d67bfe6c81 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersedwin
bugs1287691
milestone50.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 1287691 (Part 4) - Leave notifying decoding progress for each frame to DecodingTask. r=edwin
image/Decoder.cpp
image/IDecodingTask.cpp
image/IDecodingTask.h
--- a/image/Decoder.cpp
+++ b/image/Decoder.cpp
@@ -441,22 +441,16 @@ Decoder::PostFrameStop(Opacity aFrameOpa
   mProgress |= FLAG_FRAME_COMPLETE;
 
   // If we're not sending partial invalidations, then we send an invalidation
   // here when the first frame is complete.
   if (!ShouldSendPartialInvalidations() && mFrameCount == 1) {
     mInvalidRect.UnionRect(mInvalidRect,
                            gfx::IntRect(gfx::IntPoint(0, 0), GetSize()));
   }
-
-  // If we are going to keep decoding we should notify now about the first frame being done.
-  if (mImage && mFrameCount == 1 && HasAnimation()) {
-    MOZ_ASSERT(HasProgress());
-    IDecodingTask::NotifyProgress(WrapNotNull(this));
-  }
 }
 
 void
 Decoder::PostInvalidation(const nsIntRect& aRect,
                           const Maybe<nsIntRect>& aRectAtTargetSize
                             /* = Nothing() */)
 {
   // We should be mid-frame
--- a/image/IDecodingTask.cpp
+++ b/image/IDecodingTask.cpp
@@ -14,18 +14,18 @@
 
 namespace mozilla {
 namespace image {
 
 ///////////////////////////////////////////////////////////////////////////////
 // Helpers for sending notifications to the image associated with a decoder.
 ///////////////////////////////////////////////////////////////////////////////
 
-/* static */ void
-IDecodingTask::NotifyProgress(NotNull<Decoder*> aDecoder)
+static void
+NotifyProgress(NotNull<Decoder*> aDecoder)
 {
   MOZ_ASSERT(aDecoder->HasProgress() && !aDecoder->IsMetadataDecode());
 
   // Synchronously notify if we can.
   if (NS_IsMainThread() &&
       !(aDecoder->GetDecoderFlags() & DecoderFlags::ASYNC_NOTIFY)) {
     aDecoder->GetImage()->NotifyProgress(aDecoder->TakeProgress(),
                                          aDecoder->TakeInvalidRect(),
--- a/image/IDecodingTask.h
+++ b/image/IDecodingTask.h
@@ -45,21 +45,16 @@ public:
 
   /// A default implementation of IResumable which resubmits the task to the
   /// DecodePool. Subclasses can override this if they need different behavior.
   void Resume() override;
 
   /// @return a non-null weak pointer to the Decoder associated with this task.
   virtual NotNull<Decoder*> GetDecoder() const = 0;
 
-  // Notify the Image associated with a Decoder of its progress, sending a
-  // runnable to the main thread if necessary.
-  // XXX(seth): This is a hack that will be removed soon.
-  static void NotifyProgress(NotNull<Decoder*> aDecoder);
-
 protected:
   virtual ~IDecodingTask() { }
 };
 
 
 /**
  * An IDecodingTask implementation for full decodes of images.
  */