зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1140578 - Add a explicit flag to track if we have pending touch moves to process. r=mchang
This commit is contained in:
Родитель
c856037b1d
Коммит
e288f1cc73
|
@ -63,6 +63,7 @@ GeckoTouchDispatcher::GetInstance()
|
|||
|
||||
GeckoTouchDispatcher::GeckoTouchDispatcher()
|
||||
: mTouchQueueLock("GeckoTouchDispatcher::mTouchQueueLock")
|
||||
, mHavePendingTouchMoves(false)
|
||||
, mTouchEventsFiltered(false)
|
||||
{
|
||||
// Since GeckoTouchDispatcher is initialized when input is initialized
|
||||
|
@ -112,6 +113,7 @@ GeckoTouchDispatcher::NotifyTouch(MultiTouchInput& aTouch, TimeStamp aEventTime)
|
|||
if (aTouch.mType == MultiTouchInput::MULTITOUCH_MOVE) {
|
||||
MutexAutoLock lock(mTouchQueueLock);
|
||||
mTouchMoveEvents.push_back(aTouch);
|
||||
mHavePendingTouchMoves = true;
|
||||
if (mResamplingEnabled) {
|
||||
return;
|
||||
}
|
||||
|
@ -131,9 +133,10 @@ GeckoTouchDispatcher::DispatchTouchMoveEvents(TimeStamp aVsyncTime)
|
|||
|
||||
{
|
||||
MutexAutoLock lock(mTouchQueueLock);
|
||||
if (mTouchMoveEvents.empty()) {
|
||||
if (!mHavePendingTouchMoves) {
|
||||
return;
|
||||
}
|
||||
mHavePendingTouchMoves = false;
|
||||
|
||||
if (mResamplingEnabled) {
|
||||
int touchCount = mTouchMoveEvents.size();
|
||||
|
|
|
@ -60,10 +60,12 @@ private:
|
|||
void DispatchMouseEvent(MultiTouchInput& aMultiTouch,
|
||||
bool aForwardToChildren);
|
||||
|
||||
// mTouchQueueLock are used to protect the vector below
|
||||
// as it is accessed on the vsync thread and main thread
|
||||
// mTouchQueueLock is used to protect the vector and state below
|
||||
// as it is accessed on multiple threads.
|
||||
Mutex mTouchQueueLock;
|
||||
std::vector<MultiTouchInput> mTouchMoveEvents;
|
||||
bool mHavePendingTouchMoves;
|
||||
// end stuff protected by mTouchQueueLock
|
||||
|
||||
bool mResamplingEnabled;
|
||||
bool mTouchEventsFiltered;
|
||||
|
|
Загрузка…
Ссылка в новой задаче