Bug 695859. Don't progressively display images during decode if we have all of the data. r=bholley
authorJeff Muizelaar <jmuizelaar@mozilla.com>
Wed, 19 Oct 2011 18:06:14 -0400
changeset 85041 df2cf9afad63879f12137ab717d942607de9f9e9
parent 85040 a5fa5e73d9019fbc69a3dda44326fe7d14f4d29b
child 85042 bb91dfae700703d64870da6dd2ba7adc01963a9b
push id805
push userakeybl@mozilla.com
push dateWed, 01 Feb 2012 18:17:35 +0000
treeherdermozilla-aurora@6fb3bf232436 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbholley
bugs695859
milestone12.0a1
Bug 695859. Don't progressively display images during decode if we have all of the data. r=bholley This should reduce the amount of image repainting that happens during download.
image/src/RasterImage.cpp
--- a/image/src/RasterImage.cpp
+++ b/image/src/RasterImage.cpp
@@ -2834,20 +2834,20 @@ imgDecodeWorker::Run()
   if (chunkCount && !image->mDecoder->IsSizeDecode()) {
       Telemetry::Accumulate(Telemetry::IMAGE_DECODE_LATENCY, PRInt32(decodeLatency.ToMicroseconds()));
       Telemetry::Accumulate(Telemetry::IMAGE_DECODE_CHUNKS, chunkCount);
   }
   // accumulate the total decode time
   mDecodeTime += decodeLatency;
 
   // Flush invalidations _after_ we've written everything we're going to.
-  // Furthermore, if this is a redecode, we don't want to do progressive
+  // Furthermore, if we have all of the data, we don't want to do progressive
   // display at all. In that case, let Decoder::PostFrameStop() do the
   // flush once the whole frame is ready.
-  if (!image->mHasBeenDecoded) {
+  if (!image->mHasSourceData) {
     image->mInDecoder = true;
     image->mDecoder->FlushInvalidations();
     image->mInDecoder = false;
   }
 
   // If the decode finished, shutdown the decoder
   if (image->mDecoder && image->IsDecodeFinished()) {