From e9626e8b7f808d4e72069d2da6d199d1ca692faa Mon Sep 17 00:00:00 2001 From: Kartikaya Gupta Date: Wed, 3 Jun 2015 15:46:40 -0400 Subject: [PATCH] Bug 1169844 - Remove incorrect assertion and properly untransform wheel events for overscroll situations. r=botond --- gfx/layers/apz/src/APZCTreeManager.cpp | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/gfx/layers/apz/src/APZCTreeManager.cpp b/gfx/layers/apz/src/APZCTreeManager.cpp index 054648e285e..33ddec28bcd 100644 --- a/gfx/layers/apz/src/APZCTreeManager.cpp +++ b/gfx/layers/apz/src/APZCTreeManager.cpp @@ -588,12 +588,12 @@ APZCTreeManager::ReceiveInputEvent(InputData& aEvent, // want to pass to gecko should be the pre-scroll event coordinates, // transformed into the gecko space. (pre-scroll because the mouse // cursor is stationary during wheel scrolling, unlike touchmove - // events). Also, since we just flushed the pending repaints the - // transform to gecko space is a no-op so we can just skip it. - MOZ_ASSERT( - (GetScreenToApzcTransform(apzc) * GetApzcToGeckoTransform(apzc)) - .NudgeToIntegersFixedEpsilon() - .IsIdentity()); + // events). Since we just flushed the pending repaints the transform to + // gecko space should only consist of overscroll-cancelling transforms. + Matrix4x4 transformToGecko = GetScreenToApzcTransform(apzc) + * GetApzcToGeckoTransform(apzc); + ScreenPoint untransformedOrigin = TransformTo( + transformToGecko, wheelInput.mOrigin); result = mInputQueue->ReceiveInputEvent( apzc, @@ -602,6 +602,7 @@ APZCTreeManager::ReceiveInputEvent(InputData& aEvent, // Update the out-parameters so they are what the caller expects. apzc->GetGuid(aOutTargetGuid); + wheelInput.mOrigin = untransformedOrigin; } break; } case PANGESTURE_INPUT: { @@ -771,12 +772,6 @@ APZCTreeManager::ProcessTouchInput(MultiTouchInput& aInput, Matrix4x4 transformToApzc = GetScreenToApzcTransform(mApzcForInputBlock); Matrix4x4 transformToGecko = GetApzcToGeckoTransform(mApzcForInputBlock); Matrix4x4 outTransform = transformToApzc * transformToGecko; - if (aInput.mType == MultiTouchInput::MULTITOUCH_START) { - // For touch-start events we should have flushed all pending repaints - // above as part of the GetTouchInputBlockAPZC call, and so we expect - // the apzc-to-gecko transform to be empty. - MOZ_ASSERT(outTransform.NudgeToIntegersFixedEpsilon().IsIdentity()); - } for (size_t i = 0; i < aInput.mTouches.Length(); i++) { SingleTouchData& touchData = aInput.mTouches[i]; touchData.mScreenPoint = TransformTo(