Bug 950934 - Enable APZ in the B2G root process. r=botond,smaug
authorKartikaya Gupta <kgupta@mozilla.com>
Mon, 12 Jan 2015 18:13:18 -0500
changeset 240399 3e710889d4e86937c9bb8a6d5c130fa700241d48
parent 240398 72940b27aeaa3c5284252eda375ccfd32ce3b644
child 240400 bcefc7d8d8859469897c4c66b48c5b4ef6e9afeb
push id535
push usercmanchester@mozilla.com
push dateMon, 02 Feb 2015 19:04:18 +0000
reviewersbotond, smaug
bugs950934
milestone38.0a1
Bug 950934 - Enable APZ in the B2G root process. r=botond,smaug
docshell/base/nsDocShell.cpp
layout/base/nsLayoutUtils.cpp
--- a/docshell/base/nsDocShell.cpp
+++ b/docshell/base/nsDocShell.cpp
@@ -13675,17 +13675,17 @@ nsDocShell::GetAppManifestURL(nsAString&
 
 NS_IMETHODIMP
 nsDocShell::GetAsyncPanZoomEnabled(bool* aOut)
 {
     if (TabChild* tabChild = TabChild::GetFrom(this)) {
         *aOut = tabChild->IsAsyncPanZoomEnabled();
         return NS_OK;
     }
-    *aOut = false;
+    *aOut = Preferences::GetBool("layers.async-pan-zoom.enabled", false);
     return NS_OK;
 }
 
 bool
 nsDocShell::HasUnloadedParent()
 {
     nsRefPtr<nsDocShell> parent = GetParentDocshell();
     while (parent) {
--- a/layout/base/nsLayoutUtils.cpp
+++ b/layout/base/nsLayoutUtils.cpp
@@ -7642,25 +7642,18 @@ nsLayoutUtils::CalculateExpandedScrollab
     scrollableRect.height = compSize.height;
   }
   return scrollableRect;
 }
 
 /* static */ bool
 nsLayoutUtils::WantSubAPZC()
 {
-  // TODO Turn this on for inprocess OMTC on all platforms
-  bool wantSubAPZC = gfxPrefs::AsyncPanZoomEnabled() &&
-                     gfxPrefs::APZSubframeEnabled();
-#ifdef MOZ_WIDGET_GONK
-  if (XRE_GetProcessType() != GeckoProcessType_Content) {
-    wantSubAPZC = false;
-  }
-#endif
-  return wantSubAPZC;
+  return gfxPrefs::AsyncPanZoomEnabled() &&
+         gfxPrefs::APZSubframeEnabled();
 }
 
 /* static */ bool
 nsLayoutUtils::UsesAsyncScrolling()
 {
 #ifdef MOZ_WIDGET_ANDROID
   // We always have async scrolling for android
   return true;