Bug 734135 - When we draw an unlocked image, move it to the back of the discard queue.

Bug 734135 - When we draw an unlocked image, move it to the back of the discard queue. r=joe

--HG--
extra : rebase_source : c78206fa9abdb1aa3b054f7ab4d53affe0883ece
This commit is contained in:
Justin Lebar 2012-03-08 09:14:00 -05:00
parent 7ca32f453f
commit b18e3bbd15

View File

@ -2581,6 +2581,16 @@ RasterImage::Draw(gfxContext *aContext,
mFrameDecodeFlags = DECODE_FLAGS_DEFAULT;
}
// If this image is a candidate for discarding, reset its position in the
// discard tracker so we're less likely to discard it right away.
//
// (We don't normally draw unlocked images, so this conditition will usually
// be false. But we will draw unlocked images if image locking is globally
// disabled via the content.image.allow_locking pref.)
if (DiscardingActive()) {
DiscardTracker::Reset(&mDiscardTrackerNode);
}
// We use !mDecoded && mHasSourceData to mean discarded.
if (!mDecoded && mHasSourceData) {
mDrawStartTime = TimeStamp::Now();