Bug 1120252 - Avoid trying to get the APZCTreeManager if APZ isn't enabled. r=mattwoodrow, a=bustage
authorKartikaya Gupta <kgupta@mozilla.com>
Sun, 11 Jan 2015 20:39:36 -0500
changeset 200525 e224d1b46d565c882e31a6563c3ca9e5656ac5fb
parent 200524 d90957959967b46a7f44cddc998af36aa84e9ad0
child 200526 7ae1b58e84580f25b9964e3aed7a140d485871f8
push id173
push userryanvm@gmail.com
push dateTue, 20 Jan 2015 18:47:25 +0000
treeherdermozilla-esr31@e224d1b46d56 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmattwoodrow, bustage
bugs1120252
milestone31.4.0
Bug 1120252 - Avoid trying to get the APZCTreeManager if APZ isn't enabled. r=mattwoodrow, a=bustage
layout/ipc/RenderFrameParent.cpp
--- a/layout/ipc/RenderFrameParent.cpp
+++ b/layout/ipc/RenderFrameParent.cpp
@@ -4,16 +4,17 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "base/basictypes.h"
 
 #include "BasicLayers.h"
 #include "gfx3DMatrix.h"
+#include "gfxPrefs.h"
 #ifdef MOZ_ENABLE_D3D9_LAYER
 # include "LayerManagerD3D9.h"
 #endif //MOZ_ENABLE_D3D9_LAYER
 #include "mozilla/BrowserElementParent.h"
 #include "mozilla/dom/TabParent.h"
 #include "mozilla/layers/APZCTreeManager.h"
 #include "mozilla/layers/CompositorParent.h"
 #include "mozilla/layers/LayerTransactionParent.h"
@@ -756,17 +757,17 @@ RenderFrameParent::Init(nsFrameLoader* a
 
 APZCTreeManager*
 RenderFrameParent::GetApzcTreeManager()
 {
   // We can't get a ref to the APZCTreeManager until after the child is
   // created and the static getter knows which CompositorParent is
   // instantiated with this layers ID. That's why try to fetch it when
   // we first need it and cache the result.
-  if (!mApzcTreeManager) {
+  if (!mApzcTreeManager && gfxPrefs::AsyncPanZoomEnabled()) {
     mApzcTreeManager = CompositorParent::GetAPZCTreeManager(mLayersId);
   }
   return mApzcTreeManager.get();
 }
 
 RenderFrameParent::~RenderFrameParent()
 {}