Bug 729534 - Semi-fix scroll layer retention. r=mats
authorChris Lord <chrislord.net@gmail.com>
Wed, 29 Feb 2012 17:01:50 +0000
changeset 89276 d137bbd5fe5b620175bae04bff29b0e16b783129
parent 89275 3fe06bb3b9f246f05f16d0749a5076af79105f97
child 89277 1244345c816c157b505052906f15b6c2faea37be
push id22242
push userkgupta@mozilla.com
push dateWed, 14 Mar 2012 15:19:09 +0000
treeherdermozilla-central@936ef50fa498 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmats
bugs729534
milestone13.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 729534 - Semi-fix scroll layer retention. r=mats When flattening the display list, the last child frame in a scroll layer is used to retain the associated ThebesLayer. Instead, use the first child, which tends to be more stable. This fixes retaining layers when scrolling through engadget.com. Fix by Robert O'Callahan <robert@ocallahan.org>
layout/base/nsDisplayList.cpp
--- a/layout/base/nsDisplayList.cpp
+++ b/layout/base/nsDisplayList.cpp
@@ -2002,16 +2002,21 @@ nsDisplayScrollLayer::TryMerge(nsDisplay
     return false;
   }
 
   FrameProperties props = mScrolledFrame->Properties();
   props.Set(nsIFrame::ScrollLayerCount(),
     reinterpret_cast<void*>(GetScrollLayerCount() - 1));
 
   mList.AppendToBottom(&other->mList);
+  // XXX - This ensures that the frame associated with a scroll layer after
+  // merging is the first, rather than the last. This tends to change less,
+  // ensuring we're more likely to retain the associated gfx layer.
+  // See Bug 729534 and Bug 731641.
+  mFrame = other->mFrame;
   return true;
 }
 
 bool
 nsDisplayScrollLayer::ShouldFlattenAway(nsDisplayListBuilder* aBuilder)
 {
   return GetScrollLayerCount() > 1;
 }