Bug 1193062 - Remove mPanGestureState. r=kats

Now that PanGestureInput events are only processed during a PanGestureBlock, we can get rid of the mPanGestureState workaround.

--HG--
extra : commitid : 4KYXEbxJ5zZ
extra : rebase_source : 9ee0b85d3bec2554871f621270998b2e2d86a3ce
extra : histedit_source : e7c56cca500680c95744110ccaeefa635f7f1613
This commit is contained in:
Markus Stange 2015-08-07 15:20:31 -04:00
Родитель 7f5ea187ae
Коммит a83ae1f63a
2 изменённых файлов: 9 добавлений и 25 удалений

Просмотреть файл

@ -1632,11 +1632,7 @@ nsEventStatus AsyncPanZoomController::OnPanMayBegin(const PanGestureInput& aEven
mX.StartTouch(aEvent.mLocalPanStartPoint.x, aEvent.mTime);
mY.StartTouch(aEvent.mLocalPanStartPoint.y, aEvent.mTime);
if (mPanGestureState) {
mPanGestureState->GetOverscrollHandoffChain()->CancelAnimations();
} else {
CancelAnimation();
}
CurrentPanGestureBlock()->GetOverscrollHandoffChain()->CancelAnimations();
return nsEventStatus_eConsumeNoDefault;
}
@ -1659,8 +1655,6 @@ nsEventStatus AsyncPanZoomController::OnPanBegin(const PanGestureInput& aEvent)
CancelAnimation();
}
mPanGestureState = MakeUnique<InputBlockState>(this, true);
mX.StartTouch(aEvent.mLocalPanStartPoint.x, aEvent.mTime);
mY.StartTouch(aEvent.mLocalPanStartPoint.y, aEvent.mTime);
@ -1708,17 +1702,14 @@ nsEventStatus AsyncPanZoomController::OnPan(const PanGestureInput& aEvent, Scrol
HandlePanningUpdate(aEvent.mPanDisplacement);
// TODO: Handle pan events sent without pan begin / pan end events properly.
if (mPanGestureState) {
ScreenPoint panDistance(fabs(aEvent.mPanDisplacement.x), fabs(aEvent.mPanDisplacement.y));
OverscrollHandoffState handoffState(
*mPanGestureState->GetOverscrollHandoffChain(),
panDistance,
aSource);
CallDispatchScroll(aEvent.mLocalPanStartPoint,
aEvent.mLocalPanStartPoint + aEvent.mLocalPanDisplacement,
handoffState);
}
ScreenPoint panDistance(fabs(aEvent.mPanDisplacement.x), fabs(aEvent.mPanDisplacement.y));
OverscrollHandoffState handoffState(
*CurrentPanGestureBlock()->GetOverscrollHandoffChain(),
panDistance,
aSource);
CallDispatchScroll(aEvent.mLocalPanStartPoint,
aEvent.mLocalPanStartPoint + aEvent.mLocalPanDisplacement,
handoffState);
return nsEventStatus_eConsumeNoDefault;
}
@ -1726,8 +1717,6 @@ nsEventStatus AsyncPanZoomController::OnPan(const PanGestureInput& aEvent, Scrol
nsEventStatus AsyncPanZoomController::OnPanEnd(const PanGestureInput& aEvent) {
APZC_LOG("%p got a pan-end in state %d\n", this, mState);
mPanGestureState = nullptr;
mX.EndTouch(aEvent.mTime);
mY.EndTouch(aEvent.mTime);
SetState(NOTHING);
@ -1744,7 +1733,6 @@ nsEventStatus AsyncPanZoomController::OnPanMomentumStart(const PanGestureInput&
CancelAnimation();
}
mPanGestureState = MakeUnique<InputBlockState>(this, true);
SetState(PAN_MOMENTUM);
return nsEventStatus_eConsumeNoDefault;
@ -1753,7 +1741,6 @@ nsEventStatus AsyncPanZoomController::OnPanMomentumStart(const PanGestureInput&
nsEventStatus AsyncPanZoomController::OnPanMomentumEnd(const PanGestureInput& aEvent) {
APZC_LOG("%p got a pan-momentumend in state %d\n", this, mState);
mPanGestureState = nullptr;
// We need to reset the velocity to zero. We don't really have a "touch"
// here because the touch has already ended long before the momentum

Просмотреть файл

@ -841,9 +841,6 @@ private:
*/
private:
UniquePtr<InputBlockState> mPanGestureState;
/* ===================================================================
* The functions and members in this section are used to manage
* fling animations, smooth scroll animations, and overscroll