From 1cbb1c003a1e682e9f3157ecff268db906713e8d Mon Sep 17 00:00:00 2001 From: vng Date: Fri, 26 Sep 2014 13:50:08 +0300 Subject: [PATCH] [android] Pass compass and location in main rendering thread. --- android/jni/com/mapswithme/maps/Framework.cpp | 5 +++-- android/jni/com/mapswithme/platform/Platform.cpp | 2 +- android/jni/com/mapswithme/platform/Platform.hpp | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/android/jni/com/mapswithme/maps/Framework.cpp b/android/jni/com/mapswithme/maps/Framework.cpp index a23bbe4882..8683f15d90 100644 --- a/android/jni/com/mapswithme/maps/Framework.cpp +++ b/android/jni/com/mapswithme/maps/Framework.cpp @@ -67,7 +67,7 @@ namespace android void Framework::OnLocationUpdated(location::GpsInfo const & info) { - m_work.OnLocationUpdate(info); + Platform::RunOnGuiThreadImpl(bind(&::Framework::OnLocationUpdate, ref(m_work), info)); } void Framework::OnCompassUpdated(uint64_t timestamp, double magneticNorth, double trueNorth, double accuracy) @@ -77,7 +77,8 @@ namespace android info.m_magneticHeading = magneticNorth; info.m_trueHeading = trueNorth; info.m_accuracy = accuracy; - m_work.OnCompassUpdate(info); + + Platform::RunOnGuiThreadImpl(bind(&::Framework::OnCompassUpdate, ref(m_work), info)); } void Framework::UpdateCompassSensor(int ind, float * arr) diff --git a/android/jni/com/mapswithme/platform/Platform.cpp b/android/jni/com/mapswithme/platform/Platform.cpp index 3acd130d55..87e4ee0dab 100644 --- a/android/jni/com/mapswithme/platform/Platform.cpp +++ b/android/jni/com/mapswithme/platform/Platform.cpp @@ -57,7 +57,7 @@ string Platform::UniqueClientId() const void Platform::RunOnGuiThread(TFunctor const & fn) { - static_cast(this)->RunOnGuiThreadImpl(fn); + android::Platform::RunOnGuiThreadImpl(fn); } namespace android diff --git a/android/jni/com/mapswithme/platform/Platform.hpp b/android/jni/com/mapswithme/platform/Platform.hpp index 17ae20d49b..d5d54669a8 100644 --- a/android/jni/com/mapswithme/platform/Platform.hpp +++ b/android/jni/com/mapswithme/platform/Platform.hpp @@ -24,7 +24,7 @@ namespace android bool HasAvailableSpaceForWriting(uint64_t size) const; - void RunOnGuiThreadImpl(TFunctor const & fn); + static void RunOnGuiThreadImpl(TFunctor const & fn); static Platform & Instance(); };