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 188701 76e172ece6de59ae658c47bb1dbc3339a0c7c2df
parent 188700 b1d00301569fc210b182120d93bb16871c434a77
child 188702 a9b81473ddc4e3a598e73482ba61310cd91b7047
push id774
push userryanvm@gmail.com
push dateTue, 20 Jan 2015 21:07:59 +0000
treeherdermozilla-b2g30_v1_4@76e172ece6de [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmattwoodrow, bustage
bugs1120252
milestone30.0
Bug 1120252 - Avoid trying to get the APZCTreeManager if APZ isn't enabled. r=mattwoodrow, a=bustage
gfx/thebes/gfxPrefs.h
layout/ipc/RenderFrameParent.cpp
--- a/gfx/thebes/gfxPrefs.h
+++ b/gfx/thebes/gfxPrefs.h
@@ -136,16 +136,17 @@ private:
   DECL_GFX_PREF(Live, "layers.acceleration.draw-fps",          LayersDrawFPS, bool, false);
   DECL_GFX_PREF(Once, "layers.acceleration.force-enabled",     LayersAccelerationForceEnabled, bool, false);
 #ifdef XP_WIN
   // On windows, ignore the preference value, forcing async video to false.
   DECL_GFX_PREF(Skip, "layers.async-video.enabled",            AsyncVideoEnabled, bool, false);
 #else
   DECL_GFX_PREF(Once, "layers.async-video.enabled",            AsyncVideoEnabled, bool, false);
 #endif
+  DECL_GFX_PREF(Once, "layers.async-pan-zoom.enabled",         AsyncPanZoomEnabled, bool, false);
   DECL_GFX_PREF(Once, "layers.bufferrotation.enabled",         BufferRotationEnabled, bool, true);
 #ifdef MOZ_GFX_OPTIMIZE_MOBILE
   // If MOZ_GFX_OPTIMIZE_MOBILE is defined, we force component alpha off
   // and ignore the preference.
   DECL_GFX_PREF(Skip, "layers.componentalpha.enabled",         ComponentAlphaEnabled, bool, false);
 #else
   // If MOZ_GFX_OPTIMIZE_MOBILE is not defined, we actually take the
   // preference value, defaulting to true.
--- 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"
@@ -769,17 +770,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()
 {}