Compress input events in gonk backend (bug 718914, r=cjones).
authorAndreas Gal <gal@mozilla.com>
Tue, 07 Feb 2012 22:42:44 -0800
changeset 86344 4b9608fd670cad90cdf25c99d0603d39c69839a4
parent 86343 b45785802731b6fe9253deb08647cad9227a3819
child 86417 06b063c001b6127012ef5f8316996cae02c2b5e9
push id22014
push useragal@mozilla.com
push dateWed, 08 Feb 2012 06:43:57 +0000
treeherdermozilla-central@4b9608fd670c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerscjones
bugs718914
milestone13.0a1
first release with
nightly linux32
4b9608fd670c / 13.0a1 / 20120208031253 / files
nightly linux64
4b9608fd670c / 13.0a1 / 20120208031253 / files
nightly mac
4b9608fd670c / 13.0a1 / 20120208031253 / files
nightly win32
4b9608fd670c / 13.0a1 / 20120208031253 / files
nightly win64
4b9608fd670c / 13.0a1 / 20120208031253 / files
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
releases
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Compress input events in gonk backend (bug 718914, r=cjones).
widget/gonk/nsAppShell.cpp
--- a/widget/gonk/nsAppShell.cpp
+++ b/widget/gonk/nsAppShell.cpp
@@ -582,17 +582,20 @@ GeckoInputDispatcher::notifyMotion(nsecs
     data.motion.touchCount = pointerCount;
     for (int32_t i = 0; i < pointerCount; ++i) {
         Touch& touch = data.motion.touches[i];
         touch.id = pointerIds[i];
         memcpy(&touch.coords, &pointerCoords[i], sizeof(*pointerCoords));
     }
     {
         MutexAutoLock lock(mQueueLock);
-        mEventQueue.push(data);
+        if (!mEventQueue.empty() && mEventQueue.back().type == UserInputData::MOTION_DATA)
+            mEventQueue.back() = data;
+        else
+            mEventQueue.push(data);
     }
     gAppShell->NotifyNativeEvent();
 }
 
 void
 GeckoInputDispatcher::notifySwitch(nsecs_t when,
                                    int32_t switchCode,
                                    int32_t switchValue,