Bug 832117: Check that the referent root is nonnull. r=roc a=blocking-b2g
authorChris Jones <jones.chris.g@gmail.com>
Thu, 17 Jan 2013 18:34:44 -0800
changeset 119225 765fb43a17a06c355e06f67e3dd2ce83368a130f
parent 119224 49cfb1e213e65a24da6d121a9e9759bba4c58046
child 119226 5e00fb1ffd1992ec40c9fb36ce0a37c928a2bf54
push id21542
push usercjones@mozilla.com
push dateFri, 18 Jan 2013 02:34:49 +0000
treeherdermozilla-inbound@765fb43a17a0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersroc, blocking-b2g
bugs832117
milestone21.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 832117: Check that the referent root is nonnull. r=roc a=blocking-b2g
gfx/layers/ipc/CompositorParent.cpp
--- a/gfx/layers/ipc/CompositorParent.cpp
+++ b/gfx/layers/ipc/CompositorParent.cpp
@@ -506,38 +506,38 @@ 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 (!ref->GetVisibleRegion().IsEmpty()) {
-          ScreenOrientation chromeOrientation = mTargetConfig.orientation();
-          ScreenOrientation contentOrientation = state->mTargetConfig.orientation();
-          if (!IsSameDimension(chromeOrientation, contentOrientation) &&
-              ContentMightReflowOnOrientationChange(mTargetConfig.clientBounds())) {
-            mReadyForCompose = false;
+        if (Layer* referent = state->mRoot) {
+          if (!ref->GetVisibleRegion().IsEmpty()) {
+            ScreenOrientation chromeOrientation = mTargetConfig.orientation();
+            ScreenOrientation contentOrientation = state->mTargetConfig.orientation();
+            if (!IsSameDimension(chromeOrientation, contentOrientation) &&
+                ContentMightReflowOnOrientationChange(mTargetConfig.clientBounds())) {
+              mReadyForCompose = false;
+            }
           }
-        }
 
-        if (OP == Resolve) {
-          ref->ConnectReferentLayer(referent);
-          if (AsyncPanZoomController* apzc = state->mController) {
-            referent->SetUserData(&sPanZoomUserDataKey,
-                                  new PanZoomUserData(apzc));
+          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);
     }
   }