Bug 811891. Only sync decode once per image. r=joe
authorJeff Muizelaar <jmuizelaar@mozilla.com>
Sat, 15 Dec 2012 14:03:42 -0500
changeset 116160 cf43df0a70954afa110ea929b4f04748725e068c
parent 116159 c8a1314aa449e76e5338f4b8a389bc16e29f831e
child 116161 f050eb79064f9ec750aa34c35452b9f72cabea64
push id24044
push useremorley@mozilla.com
push dateMon, 17 Dec 2012 13:40:16 +0000
treeherdermozilla-central@ba26dc1c6267 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjoe
bugs811891, 799335
milestone20.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 811891. Only sync decode once per image. r=joe Bug 799335 intentionally caused us to do some decoding everytime StartDecoding is called. This can be multiple times per paint which can delay tab switch substantially.
image/src/RasterImage.cpp
--- a/image/src/RasterImage.cpp
+++ b/image/src/RasterImage.cpp
@@ -2717,23 +2717,19 @@ RasterImage::RequestDecodeCore(RequestDe
   // If we're fully decoded, we have nothing to do
   if (mDecoded)
     return NS_OK;
 
   // If we're not storing source data, we have nothing to do
   if (!StoringSourceData())
     return NS_OK;
 
-  // If we've already got a full decoder running, we'll spend a bit of time
-  // decoding because the caller want's an image soon.
-  if (mDecoder && !mDecoder->IsSizeDecode()) {
-    if (!mDecoded && !mInDecoder && mHasSourceData && aDecodeType == SOMEWHAT_SYNCHRONOUS) {
-      SAMPLE_LABEL_PRINTF("RasterImage", "DecodeABitOf", "%s", GetURIString());
-      DecodeWorker::Singleton()->DecodeABitOf(this);
-    }
+  // If we've already got a full decoder running, and have already
+  // decoded some bytes, we have nothing to do
+  if (mDecoder && !mDecoder->IsSizeDecode() && mBytesDecoded) {
     return NS_OK;
   }
 
   // mFinishing protects against the case when we enter RequestDecode from
   // ShutdownDecoder -- in that case, we're done with the decode, we're just
   // not quite ready to admit it.  See bug 744309.
   if (mFinishing)
     return NS_OK;