mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-01 17:23:59 +00:00
Bug 1072645 - Use stateless event filtering in GeckoTouchDispatcher, r=kats
This commit is contained in:
parent
3a79a21d44
commit
5fde46fd7d
@ -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;
|
||||
}
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user