From 61d5c3fe9a484a1e59892e233bead76f81bf3493 Mon Sep 17 00:00:00 2001 From: "r.kuznetsov" Date: Wed, 20 Jan 2016 16:39:37 +0300 Subject: [PATCH] Review fixes --- android/src/com/mapswithme/maps/Framework.java | 5 +++++ android/src/com/mapswithme/maps/MapFragment.java | 4 ++-- android/src/com/mapswithme/maps/MwmActivity.java | 4 ++-- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/android/src/com/mapswithme/maps/Framework.java b/android/src/com/mapswithme/maps/Framework.java index 69d55db6f8..525af6a545 100644 --- a/android/src/com/mapswithme/maps/Framework.java +++ b/android/src/com/mapswithme/maps/Framework.java @@ -161,6 +161,11 @@ public class Framework public native static void nativeSetMapStyle(int mapStyle); + /** + * This method allows to set new map style without immediate applying. It can be used before + * engine recreation instead of nativeSetMapStyle to avoid huge flow of OpenGL invocations. + * @param mapStyle style index + */ public native static void nativeMarkMapStyle(int mapStyle); public native static void nativeSetRouter(int routerType); diff --git a/android/src/com/mapswithme/maps/MapFragment.java b/android/src/com/mapswithme/maps/MapFragment.java index 8eb2c56a2d..a13ddae749 100644 --- a/android/src/com/mapswithme/maps/MapFragment.java +++ b/android/src/com/mapswithme/maps/MapFragment.java @@ -180,12 +180,12 @@ public class MapFragment extends BaseMwmFragment return; if (getActivity() == null || !getActivity().isChangingConfigurations()) - destroySurface(); + destroyEngine(); else nativeDetachSurface(); } - public void destroySurface() + public void destroyEngine() { if (!mEngineCreated) return; diff --git a/android/src/com/mapswithme/maps/MwmActivity.java b/android/src/com/mapswithme/maps/MwmActivity.java index f671905ce7..13b9c5745d 100644 --- a/android/src/com/mapswithme/maps/MwmActivity.java +++ b/android/src/com/mapswithme/maps/MwmActivity.java @@ -753,8 +753,8 @@ public class MwmActivity extends BaseMwmFragmentActivity @Override public void recreate() { - // Explicitly destroy surface before activity recreation. - mMapFragment.destroySurface(); + // Explicitly destroy engine before activity recreation. + mMapFragment.destroyEngine(); super.recreate(); }