Bug 813356: Skip subtrees with null roots during resolution. r=roc a=blocking-basecamp
authorChris Jones <jones.chris.g@gmail.com>
Mon, 03 Dec 2012 12:45:42 -0800
changeset 114838 0251c6a43055
parent 114837 c304d3db90e2
child 114839 357731870ae5
push id23947
push useremorley@mozilla.com
push dateTue, 04 Dec 2012 14:54:11 +0000
treeherdermozilla-central@0035f77045bc [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersroc, blocking-basecamp
bugs813356
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 813356: Skip subtrees with null roots during resolution. r=roc a=blocking-basecamp
gfx/layers/ipc/CompositorParent.cpp
--- a/gfx/layers/ipc/CompositorParent.cpp
+++ b/gfx/layers/ipc/CompositorParent.cpp
@@ -475,28 +475,29 @@ public:
 
 private:
   enum Op { Resolve, Detach };
   template<Op OP>
   void WalkTheTree(Layer* aLayer, Layer* aParent)
   {
     if (RefLayer* ref = aLayer->AsRefLayer()) {
       if (const LayerTreeState* state = GetIndirectShadowTree(ref->GetReferentId())) {
-        Layer* referent = state->mRoot;
-        if (OP == Resolve) {
-          ref->ConnectReferentLayer(referent);
-          if (AsyncPanZoomController* apzc = state->mController) {
-            referent->SetUserData(&sPanZoomUserDataKey,
-                                  new PanZoomUserData(apzc));
+        if (Layer* referent = state->mRoot) {
+          if (OP == Resolve) {
+            ref->ConnectReferentLayer(referent);
+            if (AsyncPanZoomController* apzc = state->mController) {
+              referent->SetUserData(&sPanZoomUserDataKey,
+                                    new PanZoomUserData(apzc));
+            } else {
+              CompensateForContentScrollOffset(ref, referent);
+            }
           } else {
-            CompensateForContentScrollOffset(ref, referent);
+            ref->DetachReferentLayer(referent);
+            referent->RemoveUserData(&sPanZoomUserDataKey);
           }
-        } else {
-          ref->DetachReferentLayer(referent);
-          referent->RemoveUserData(&sPanZoomUserDataKey);
         }
       }
     }
     for (Layer* child = aLayer->GetFirstChild();
          child; child = child->GetNextSibling()) {
       WalkTheTree<OP>(child, aLayer);
     }
   }