Bug 827715; Skip some checking for touch events from the gesture listener. r=cjones a=blocking-basecamp
authorNicholas Cameron <ncameron@mozilla.com>
Thu, 10 Jan 2013 17:10:23 +0100
changeset 118148 8f2ef4998b60cd5bb674f35b3e4887d6fcb01393
parent 118147 73992309b6dc9cbedde76e0c96b63d1cb050b0b7
child 118149 daab716630a7029aa9ff731d27d0368c1828ba08
push id241
push usercjones@mozilla.com
push dateFri, 11 Jan 2013 20:02:31 +0000
reviewerscjones, blocking-basecamp
bugs827715
milestone18.0
Bug 827715; Skip some checking for touch events from the gesture listener. r=cjones a=blocking-basecamp
gfx/layers/ipc/AsyncPanZoomController.h
gfx/layers/ipc/GestureEventListener.cpp
--- a/gfx/layers/ipc/AsyncPanZoomController.h
+++ b/gfx/layers/ipc/AsyncPanZoomController.h
@@ -233,22 +233,23 @@ public:
   static gfx::Rect CalculateCompositedRectInCssPixels(const FrameMetrics& aMetrics);
 
   /**
    * Send an mozbrowserasyncscroll event.
    * *** The monitor must be held while calling this.
    */
   void SendAsyncScrollEvent();
 
-protected:
   /**
-   * Internal handler for ReceiveInputEvent(). Does all the actual work.
+   * Handler for events which should not be intercepted by the touch listener.
+   * Does the work for ReceiveInputEvent().
    */
   nsEventStatus HandleInputEvent(const InputData& aEvent);
 
+protected:
   /**
    * Helper method for touches beginning. Sets everything up for panning and any
    * multitouch gestures.
    */
   nsEventStatus OnTouchStart(const MultiTouchInput& aEvent);
 
   /**
    * Helper method for touches moving. Does any transforms needed when panning.
--- a/gfx/layers/ipc/GestureEventListener.cpp
+++ b/gfx/layers/ipc/GestureEventListener.cpp
@@ -224,31 +224,31 @@ nsEventStatus GestureEventListener::Hand
       mSpanChange += fabsf(currentSpan - mPreviousSpan);
       if (mSpanChange > PINCH_START_THRESHOLD) {
         PinchGestureInput pinchEvent(PinchGestureInput::PINCHGESTURE_START,
                                      aEvent.mTime,
                                      focusPoint,
                                      currentSpan,
                                      currentSpan);
 
-        mAsyncPanZoomController->ReceiveInputEvent(pinchEvent);
+        mAsyncPanZoomController->HandleInputEvent(pinchEvent);
 
         mState = GESTURE_PINCH;
       }
 
       break;
     }
     case GESTURE_PINCH: {
       PinchGestureInput pinchEvent(PinchGestureInput::PINCHGESTURE_SCALE,
                                    aEvent.mTime,
                                    focusPoint,
                                    currentSpan,
                                    mPreviousSpan);
 
-      mAsyncPanZoomController->ReceiveInputEvent(pinchEvent);
+      mAsyncPanZoomController->HandleInputEvent(pinchEvent);
       break;
     }
     default:
       // What?
       break;
     }
 
     mPreviousSpan = currentSpan;
@@ -256,46 +256,46 @@ nsEventStatus GestureEventListener::Hand
     rv = nsEventStatus_eConsumeNoDefault;
   } else if (mState == GESTURE_PINCH) {
     PinchGestureInput pinchEvent(PinchGestureInput::PINCHGESTURE_END,
                                  aEvent.mTime,
                                  mTouches[0].mScreenPoint,
                                  1.0f,
                                  1.0f);
 
-    mAsyncPanZoomController->ReceiveInputEvent(pinchEvent);
+    mAsyncPanZoomController->HandleInputEvent(pinchEvent);
 
     mState = GESTURE_NONE;
 
     rv = nsEventStatus_eConsumeNoDefault;
   }
 
   if (aClearTouches) {
     mTouches.Clear();
   }
 
   return rv;
 }
 
 nsEventStatus GestureEventListener::HandleSingleTapUpEvent(const MultiTouchInput& aEvent)
 {
   TapGestureInput tapEvent(TapGestureInput::TAPGESTURE_UP, aEvent.mTime, aEvent.mTouches[0].mScreenPoint);
-  return mAsyncPanZoomController->ReceiveInputEvent(tapEvent);
+  return mAsyncPanZoomController->HandleInputEvent(tapEvent);
 }
 
 nsEventStatus GestureEventListener::HandleSingleTapConfirmedEvent(const MultiTouchInput& aEvent)
 {
   TapGestureInput tapEvent(TapGestureInput::TAPGESTURE_CONFIRMED, aEvent.mTime, aEvent.mTouches[0].mScreenPoint);
-  return mAsyncPanZoomController->ReceiveInputEvent(tapEvent);
+  return mAsyncPanZoomController->HandleInputEvent(tapEvent);
 }
 
 nsEventStatus GestureEventListener::HandleLongTapEvent(const MultiTouchInput& aEvent)
 {
   TapGestureInput tapEvent(TapGestureInput::TAPGESTURE_LONG, aEvent.mTime, aEvent.mTouches[0].mScreenPoint);
-  return mAsyncPanZoomController->ReceiveInputEvent(tapEvent);
+  return mAsyncPanZoomController->HandleInputEvent(tapEvent);
 }
 
 nsEventStatus GestureEventListener::HandleTapCancel(const MultiTouchInput& aEvent)
 {
   mTapStartTime = 0;
 
   switch (mState)
   {
@@ -312,17 +312,17 @@ nsEventStatus GestureEventListener::Hand
   }
 
   return nsEventStatus_eConsumeDoDefault;
 }
 
 nsEventStatus GestureEventListener::HandleDoubleTap(const MultiTouchInput& aEvent)
 {
   TapGestureInput tapEvent(TapGestureInput::TAPGESTURE_DOUBLE, aEvent.mTime, aEvent.mTouches[0].mScreenPoint);
-  return mAsyncPanZoomController->ReceiveInputEvent(tapEvent);
+  return mAsyncPanZoomController->HandleInputEvent(tapEvent);
 }
 
 void GestureEventListener::TimeoutDoubleTap()
 {
   // If we haven't gotten another tap by now, reset the state and treat it as a
   // single tap. It couldn't have been a double tap.
   if (mState == GESTURE_WAITING_DOUBLE_TAP) {
     mState = GESTURE_NONE;