Bug 784756 - Remove an unnecessary loop from DecodeWorker::DecodeABitOf() that caused it to always take 5ms, even when decoding didn't take that long. r=joe
authorRobert Lickenbrock <rclickenbrock@gmail.com>
Fri, 24 Aug 2012 11:24:36 -0700
changeset 103327 3331ec03e60f
parent 103326 0eb750ce354b
child 103328 a5549c0a8817
push id23343
push userryanvm@gmail.com
push date2012-08-25 02:53 +0000
treeherdermozilla-central@f077de66e52d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjoe
bugs784756
milestone17.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 784756 - Remove an unnecessary loop from DecodeWorker::DecodeABitOf() that caused it to always take 5ms, even when decoding didn't take that long. r=joe
image/src/RasterImage.cpp
--- a/image/src/RasterImage.cpp
+++ b/image/src/RasterImage.cpp
@@ -2896,30 +2896,26 @@ RasterImage::DecodeWorker::RequestDecode
 {
   AddDecodeRequest(&aImg->mDecodeRequest);
   EnsurePendingInEventLoop();
 }
 
 void
 RasterImage::DecodeWorker::DecodeABitOf(RasterImage* aImg)
 {
-  TimeStamp eventStart = TimeStamp::Now();
-
-  do {
-    DecodeSomeOfImage(aImg);
-
-    // If we aren't yet finished decoding and we have more data in hand, add
-    // this request to the back of the priority list.
-    if (aImg->mDecoder &&
-        !aImg->mError &&
-        !aImg->IsDecodeFinished() &&
-        aImg->mSourceData.Length() > aImg->mBytesDecoded) {
-      RequestDecode(aImg);
-    }
-  } while ((TimeStamp::Now() - eventStart).ToMilliseconds() <= gMaxMSBeforeYield);
+  DecodeSomeOfImage(aImg);
+
+  // If we aren't yet finished decoding and we have more data in hand, add
+  // this request to the back of the priority list.
+  if (aImg->mDecoder &&
+      !aImg->mError &&
+      !aImg->IsDecodeFinished() &&
+      aImg->mSourceData.Length() > aImg->mBytesDecoded) {
+    RequestDecode(aImg);
+  }
 }
 
 void
 RasterImage::DecodeWorker::EnsurePendingInEventLoop()
 {
   if (!mPendingInEventLoop) {
     mPendingInEventLoop = true;
     NS_DispatchToCurrentThread(this);