Bug 962826 - Return the product from GetTouchStartTolerance(). r=botond
authorsnigdha <snigdhaagarwal93@gmail.com>
Thu, 30 Jan 2014 13:26:54 -0500
changeset 182120 dd8a9796aa3129ddbca18725c11a61f479c814c9
parent 182119 26028496b50818ec2f7c9af4e8d4195e73a1f9d1
child 182121 15a8086a24317bbbda3854afc523b3ee3506d729
push id3343
push userffxbld
push dateMon, 17 Mar 2014 21:55:32 +0000
treeherdermozilla-beta@2f7d3415f79f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbotond
bugs962826
milestone29.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 962826 - Return the product from GetTouchStartTolerance(). r=botond
gfx/layers/ipc/AsyncPanZoomController.cpp
gfx/layers/ipc/GestureEventListener.cpp
--- a/gfx/layers/ipc/AsyncPanZoomController.cpp
+++ b/gfx/layers/ipc/AsyncPanZoomController.cpp
@@ -490,17 +490,17 @@ bool
 AsyncPanZoomController::IsDestroyed()
 {
   return mTreeManager == nullptr;
 }
 
 /* static */float
 AsyncPanZoomController::GetTouchStartTolerance()
 {
-  return gTouchStartTolerance;
+  return (gTouchStartTolerance * APZCTreeManager::GetDPI());
 }
 
 /* static */AsyncPanZoomController::AxisLockMode AsyncPanZoomController::GetAxisLockMode()
 {
   return static_cast<AxisLockMode>(gAxisLockMode);
 }
 
 nsEventStatus AsyncPanZoomController::ReceiveInputEvent(const InputData& aEvent) {
@@ -647,17 +647,17 @@ nsEventStatus AsyncPanZoomController::On
 
     case CROSS_SLIDING_X:
     case CROSS_SLIDING_Y:
       // While cross-sliding, we don't want to consume any touchmove events for
       // panning or zooming, and let the caller handle them instead.
       return nsEventStatus_eIgnore;
 
     case TOUCHING: {
-      float panThreshold = gTouchStartTolerance * APZCTreeManager::GetDPI();
+      float panThreshold = GetTouchStartTolerance();
       UpdateWithTouchAtDevicePoint(aEvent);
 
       if (PanDistance() < panThreshold) {
         return nsEventStatus_eIgnore;
       }
 
       if (mTouchActionPropertyEnabled &&
           (GetTouchBehavior(0) & AllowedTouchBehavior::VERTICAL_PAN) &&
--- a/gfx/layers/ipc/GestureEventListener.cpp
+++ b/gfx/layers/ipc/GestureEventListener.cpp
@@ -99,18 +99,17 @@ nsEventStatus GestureEventListener::Hand
     }
 
     break;
   }
   case MultiTouchInput::MULTITOUCH_MOVE: {
     // If we move too much, bail out of the tap.
     ScreenIntPoint delta = event.mTouches[0].mScreenPoint - mTouchStartPosition;
     if (mTouches.Length() == 1 &&
-        NS_hypot(delta.x, delta.y) >
-          APZCTreeManager::GetDPI() * mAsyncPanZoomController->GetTouchStartTolerance())
+        NS_hypot(delta.x, delta.y) > AsyncPanZoomController::GetTouchStartTolerance())
     {
       HandleTapCancel(event);
     }
 
     size_t eventTouchesMatched = 0;
     for (size_t i = 0; i < mTouches.Length(); i++) {
       bool isTouchRemoved = true;
       for (size_t j = 0; j < event.mTouches.Length(); j++) {