diff --git a/b2g/config/dolphin/sources.xml b/b2g/config/dolphin/sources.xml
index defc659bc816..4b35b5722cfd 100644
--- a/b2g/config/dolphin/sources.xml
+++ b/b2g/config/dolphin/sources.xml
@@ -15,7 +15,7 @@
-
+
diff --git a/b2g/config/emulator-ics/sources.xml b/b2g/config/emulator-ics/sources.xml
index 451cbe29ca26..74c3b4bc788a 100644
--- a/b2g/config/emulator-ics/sources.xml
+++ b/b2g/config/emulator-ics/sources.xml
@@ -19,7 +19,7 @@
-
+
diff --git a/b2g/config/emulator-jb/sources.xml b/b2g/config/emulator-jb/sources.xml
index 7053370abf0b..140aa76d7301 100644
--- a/b2g/config/emulator-jb/sources.xml
+++ b/b2g/config/emulator-jb/sources.xml
@@ -17,7 +17,7 @@
-
+
diff --git a/b2g/config/emulator-kk/sources.xml b/b2g/config/emulator-kk/sources.xml
index 30ebd63a5308..d50c3fb22268 100644
--- a/b2g/config/emulator-kk/sources.xml
+++ b/b2g/config/emulator-kk/sources.xml
@@ -15,7 +15,7 @@
-
+
diff --git a/b2g/config/emulator/sources.xml b/b2g/config/emulator/sources.xml
index 451cbe29ca26..74c3b4bc788a 100644
--- a/b2g/config/emulator/sources.xml
+++ b/b2g/config/emulator/sources.xml
@@ -19,7 +19,7 @@
-
+
diff --git a/b2g/config/flame-kk/sources.xml b/b2g/config/flame-kk/sources.xml
index 8183de806ffb..41c8b2abe136 100644
--- a/b2g/config/flame-kk/sources.xml
+++ b/b2g/config/flame-kk/sources.xml
@@ -15,7 +15,7 @@
-
+
diff --git a/b2g/config/flame/sources.xml b/b2g/config/flame/sources.xml
index e7bd6bf28da4..7de609e10838 100644
--- a/b2g/config/flame/sources.xml
+++ b/b2g/config/flame/sources.xml
@@ -17,7 +17,7 @@
-
+
diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json
index ffb10f2a696b..57c69fb35dec 100644
--- a/b2g/config/gaia.json
+++ b/b2g/config/gaia.json
@@ -1,9 +1,9 @@
{
"git": {
- "git_revision": "7cf43cd4ec81882564c75f522977b0f68d6d71a8",
+ "git_revision": "f6bfd854fe4746f21bc006eac145365e85f98808",
"remote": "https://git.mozilla.org/releases/gaia.git",
"branch": ""
},
- "revision": "ad24b3efa6d745b1c3c420b19619466d98a5b56d",
+ "revision": "e6b6631570eae8356747b4d4f0e8c1257da9a195",
"repo_path": "integration/gaia-central"
}
diff --git a/b2g/config/nexus-4/sources.xml b/b2g/config/nexus-4/sources.xml
index 9b30492d4c52..060e672cc30f 100644
--- a/b2g/config/nexus-4/sources.xml
+++ b/b2g/config/nexus-4/sources.xml
@@ -17,7 +17,7 @@
-
+
diff --git a/b2g/config/nexus-5-l/sources.xml b/b2g/config/nexus-5-l/sources.xml
index 926efbd0ebcc..c0fa4c86303d 100644
--- a/b2g/config/nexus-5-l/sources.xml
+++ b/b2g/config/nexus-5-l/sources.xml
@@ -15,7 +15,7 @@
-
+
diff --git a/gfx/layers/ipc/CompositorParent.cpp b/gfx/layers/ipc/CompositorParent.cpp
index dbfdbf3b82be..24a372b894e0 100644
--- a/gfx/layers/ipc/CompositorParent.cpp
+++ b/gfx/layers/ipc/CompositorParent.cpp
@@ -232,7 +232,7 @@ CompositorVsyncObserver::CompositorVsyncObserver(CompositorParent* aCompositorPa
MOZ_ASSERT(aWidget != nullptr);
mCompositorVsyncDispatcher = aWidget->GetCompositorVsyncDispatcher();
#ifdef MOZ_WIDGET_GONK
- GeckoTouchDispatcher::SetCompositorVsyncObserver(this);
+ GeckoTouchDispatcher::GetInstance()->SetCompositorVsyncObserver(this);
#endif
}
@@ -370,7 +370,7 @@ void
CompositorVsyncObserver::DispatchTouchEvents(TimeStamp aVsyncTimestamp)
{
#ifdef MOZ_WIDGET_GONK
- GeckoTouchDispatcher::NotifyVsync(aVsyncTimestamp);
+ GeckoTouchDispatcher::GetInstance()->NotifyVsync(aVsyncTimestamp);
#endif
}
diff --git a/widget/gonk/GeckoTouchDispatcher.cpp b/widget/gonk/GeckoTouchDispatcher.cpp
index 0cef897fc6e6..a73d25c1ba15 100644
--- a/widget/gonk/GeckoTouchDispatcher.cpp
+++ b/widget/gonk/GeckoTouchDispatcher.cpp
@@ -51,6 +51,16 @@ static const uint64_t kInputExpirationThresholdMs = 1000;
static StaticRefPtr sTouchDispatcher;
+/* static */ GeckoTouchDispatcher*
+GeckoTouchDispatcher::GetInstance()
+{
+ if (!sTouchDispatcher) {
+ sTouchDispatcher = new GeckoTouchDispatcher();
+ ClearOnShutdown(&sTouchDispatcher);
+ }
+ return sTouchDispatcher;
+}
+
GeckoTouchDispatcher::GeckoTouchDispatcher()
: mTouchQueueLock("GeckoTouchDispatcher::mTouchQueueLock")
, mTouchEventsFiltered(false)
@@ -70,40 +80,32 @@ GeckoTouchDispatcher::GeckoTouchDispatcher()
mMaxPredict = TimeDuration::FromMilliseconds(gfxPrefs::TouchResampleMaxPredict());
mOldTouchThreshold = TimeDuration::FromMilliseconds(gfxPrefs::TouchResampleOldTouchThreshold());
mDelayedVsyncThreshold = TimeDuration::FromMilliseconds(gfxPrefs::TouchResampleVsyncDelayThreshold());
- sTouchDispatcher = this;
- ClearOnShutdown(&sTouchDispatcher);
}
-/* static */ void
+void
GeckoTouchDispatcher::SetCompositorVsyncObserver(mozilla::layers::CompositorVsyncObserver *aObserver)
{
- MOZ_ASSERT(sTouchDispatcher != nullptr);
MOZ_ASSERT(NS_IsMainThread());
// We assume on b2g that there is only 1 CompositorParent
- MOZ_ASSERT(sTouchDispatcher->mCompositorVsyncObserver == nullptr);
- if (sTouchDispatcher->mResamplingEnabled) {
- sTouchDispatcher->mCompositorVsyncObserver = aObserver;
+ MOZ_ASSERT(mCompositorVsyncObserver == nullptr);
+ if (mResamplingEnabled) {
+ mCompositorVsyncObserver = aObserver;
}
}
-// Timestamp is in nanoseconds
-/* static */ bool
+bool
GeckoTouchDispatcher::NotifyVsync(TimeStamp aVsyncTimestamp)
{
- if (sTouchDispatcher == nullptr) {
- return false;
- }
-
- MOZ_ASSERT(sTouchDispatcher->mResamplingEnabled);
+ MOZ_ASSERT(mResamplingEnabled);
bool haveTouchData = false;
{
- MutexAutoLock lock(sTouchDispatcher->mTouchQueueLock);
- haveTouchData = !sTouchDispatcher->mTouchMoveEvents.empty();
+ MutexAutoLock lock(mTouchQueueLock);
+ haveTouchData = !mTouchMoveEvents.empty();
}
if (haveTouchData) {
layers::APZThreadUtils::AssertOnControllerThread();
- sTouchDispatcher->DispatchTouchMoveEvents(aVsyncTimestamp);
+ DispatchTouchMoveEvents(aVsyncTimestamp);
}
return haveTouchData;
diff --git a/widget/gonk/GeckoTouchDispatcher.h b/widget/gonk/GeckoTouchDispatcher.h
index 8e6531db4418..7cda7b744184 100644
--- a/widget/gonk/GeckoTouchDispatcher.h
+++ b/widget/gonk/GeckoTouchDispatcher.h
@@ -46,14 +46,15 @@ class GeckoTouchDispatcher
NS_INLINE_DECL_THREADSAFE_REFCOUNTING(GeckoTouchDispatcher)
public:
- GeckoTouchDispatcher();
+ static GeckoTouchDispatcher* GetInstance();
void NotifyTouch(MultiTouchInput& aTouch, TimeStamp aEventTime);
void DispatchTouchEvent(MultiTouchInput aMultiTouch);
void DispatchTouchMoveEvents(TimeStamp aVsyncTime);
- static bool NotifyVsync(TimeStamp aVsyncTimestamp);
- static void SetCompositorVsyncObserver(layers::CompositorVsyncObserver* aObserver);
+ bool NotifyVsync(TimeStamp aVsyncTimestamp);
+ void SetCompositorVsyncObserver(layers::CompositorVsyncObserver* aObserver);
private:
+ GeckoTouchDispatcher();
void ResampleTouchMoves(MultiTouchInput& aOutTouch, TimeStamp vsyncTime);
void SendTouchEvent(MultiTouchInput& aData);
void DispatchMouseEvent(MultiTouchInput& aMultiTouch,
diff --git a/widget/gonk/nsAppShell.cpp b/widget/gonk/nsAppShell.cpp
index 951c59c9b976..40d0c86408fe 100644
--- a/widget/gonk/nsAppShell.cpp
+++ b/widget/gonk/nsAppShell.cpp
@@ -506,7 +506,7 @@ public:
, mKeyEventsFiltered(false)
, mPowerWakelock(false)
{
- mTouchDispatcher = new GeckoTouchDispatcher();
+ mTouchDispatcher = GeckoTouchDispatcher::GetInstance();
}
virtual void dump(String8& dump);