Skip to content
Snippets Groups Projects
Commit 6b5f5bbf authored by Kartikaya Gupta's avatar Kartikaya Gupta
Browse files

Bug 740883 - Coalesce VIEWPORT events across NATIVE_POKE and DRAW events on insertion. r=Cwiiis

parent 9bb250ac
No related branches found
No related tags found
No related merge requests found
......@@ -517,6 +517,11 @@ void
nsAppShell::PostEvent(AndroidGeckoEvent *ae)
{
{
// set this to true when inserting events that we can coalesce
// viewport events across. this is effectively maintaining a whitelist
// of events that are unaffected by viewport changes.
bool allowCoalescingNextViewport = false;
MutexAutoLock lock(mQueueLock);
EVLOG("nsAppShell::PostEvent %p %d", ae, ae->Type());
switch (ae->Type()) {
......@@ -586,6 +591,9 @@ nsAppShell::PostEvent(AndroidGeckoEvent *ae)
} else {
mQueuedDrawEvent = ae;
}
allowCoalescingNextViewport = true;
mEventQueue.AppendElement(ae);
break;
......@@ -600,6 +608,7 @@ nsAppShell::PostEvent(AndroidGeckoEvent *ae)
// temporarily turn off draw-coalescing, so that we process a draw
// event as soon as possible after a viewport change
mAllowCoalescingNextDraw = false;
allowCoalescingNextViewport = true;
mEventQueue.AppendElement(ae);
break;
......@@ -620,10 +629,20 @@ nsAppShell::PostEvent(AndroidGeckoEvent *ae)
mEventQueue.AppendElement(ae);
break;
case AndroidGeckoEvent::NATIVE_POKE:
allowCoalescingNextViewport = true;
// fall through
default:
mEventQueue.AppendElement(ae);
break;
}
// if the event wasn't on our whitelist then reset mQueuedViewportEvent
// so that we don't coalesce future viewport events into the last viewport
// event we added
if (!allowCoalescingNextViewport)
mQueuedViewportEvent = nsnull;
}
NotifyNativeEvent();
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment