Bug 1072645 - Use stateless event filtering in GeckoTouchDispatcher, r=kats

This commit is contained in:
Michael Wu 2014-09-25 00:55:39 -04:00
parent 3a79a21d44
commit 5fde46fd7d
2 changed files with 2 additions and 21 deletions

View File

@ -54,7 +54,6 @@ static StaticRefPtr<GeckoTouchDispatcher> sTouchDispatcher;
GeckoTouchDispatcher::GeckoTouchDispatcher()
: mTouchQueueLock("GeckoTouchDispatcher::mTouchQueueLock")
, mTouchEventsFiltered(false)
, mTouchDownCount(0)
, mTouchTimeDiff(0)
, mLastTouchTime(0)
{
@ -350,28 +349,11 @@ IsExpired(const MultiTouchInput& aTouch)
void
GeckoTouchDispatcher::DispatchTouchEvent(MultiTouchInput& aMultiTouch)
{
if (!mTouchDownCount) {
if (aMultiTouch.mType == MultiTouchInput::MULTITOUCH_START &&
aMultiTouch.mTouches.Length() == 1) {
mTouchEventsFiltered = IsExpired(aMultiTouch);
}
switch (aMultiTouch.mType) {
case MultiTouchInput::MULTITOUCH_START:
mTouchDownCount++;
break;
case MultiTouchInput::MULTITOUCH_MOVE:
break;
case MultiTouchInput::MULTITOUCH_END:
case MultiTouchInput::MULTITOUCH_CANCEL:
mTouchDownCount--;
if (mTouchDownCount == 0) {
MutexAutoLock lock(mTouchQueueLock);
mTouchMoveEvents.clear();
}
break;
default:
break;
}
if (mTouchEventsFiltered) {
return;
}

View File

@ -66,7 +66,6 @@ private:
bool mResamplingEnabled;
bool mTouchEventsFiltered;
bool mEnabledUniformityInfo;
int mTouchDownCount;
// All times below are in nanoseconds
int32_t mVsyncAdjust; // Time from vsync we create sample times from