diff --git a/drape_frontend/base_renderer.cpp b/drape_frontend/base_renderer.cpp index c751902de6..a3d2c0bd01 100644 --- a/drape_frontend/base_renderer.cpp +++ b/drape_frontend/base_renderer.cpp @@ -14,6 +14,7 @@ BaseRenderer::BaseRenderer(ThreadsCommutator::ThreadName name, Params const & pa , m_isEnabled(true) , m_renderingEnablingCompletionHandler(nullptr) , m_wasNotified(false) + , m_wasContextReset(false) { m_commutator->RegisterThread(m_threadName, this); } diff --git a/drape_frontend/drape_engine.hpp b/drape_frontend/drape_engine.hpp index d887b2b974..63f38e616f 100644 --- a/drape_frontend/drape_engine.hpp +++ b/drape_frontend/drape_engine.hpp @@ -104,7 +104,7 @@ public: void ChangeVisibilityUserMarksLayer(TileKey const & tileKey, bool isVisible); void UpdateUserMarksLayer(TileKey const & tileKey, UserMarksProvider * provider); - void SetRenderingEnabled(ref_ptr contextFactory); + void SetRenderingEnabled(ref_ptr contextFactory = nullptr); void SetRenderingDisabled(bool const destroyContext); void InvalidateRect(m2::RectD const & rect); void UpdateMapStyle(); diff --git a/iphone/Maps/Classes/MapsAppDelegate.mm b/iphone/Maps/Classes/MapsAppDelegate.mm index f0868a26e8..c8cb743c06 100644 --- a/iphone/Maps/Classes/MapsAppDelegate.mm +++ b/iphone/Maps/Classes/MapsAppDelegate.mm @@ -633,7 +633,7 @@ using namespace osm_auth_ios; [self.mapViewController onGetFocus:NO]; [self.mapViewController.appWallAd close]; [MWMRouterSavedState store]; - GetFramework().SetRenderingEnabled(false); + GetFramework().SetRenderingDisabled(false); [MWMLocationManager applicationWillResignActive]; } @@ -667,7 +667,7 @@ using namespace osm_auth_ios; [self.mapViewController onGetFocus:YES]; [self handleURLs]; [[Statistics instance] applicationDidBecomeActive]; - GetFramework().SetRenderingEnabled(true); + GetFramework().SetRenderingEnabled(); [MWMLocationManager applicationDidBecomeActive]; [MWMRouterSavedState restore]; } diff --git a/map/framework.cpp b/map/framework.cpp index 38de0dce7b..4b18eb1a3e 100644 --- a/map/framework.cpp +++ b/map/framework.cpp @@ -189,9 +189,6 @@ void Framework::OnLocationUpdate(GpsInfo const & info) GpsInfo rInfo(info); #endif -#ifdef OMIM_OS_ANDROID - m_lastGPSInfo.reset(new GpsInfo(rInfo)); -#endif location::RouteMatchingInfo routeMatchingInfo; CheckLocationForRouting(rInfo); @@ -210,9 +207,6 @@ void Framework::OnCompassUpdate(CompassInfo const & info) CompassInfo const & rInfo = info; #endif -#ifdef OMIM_OS_ANDROID - m_lastCompassInfo.reset(new CompassInfo(rInfo)); -#endif CallDrapeFunction(bind(&df::DrapeEngine::SetCompassInfo, _1, rInfo)); } @@ -303,7 +297,7 @@ void Framework::Migrate(bool keepDownloaded) InitSearchEngine(); RegisterAllMaps(); if (m_drapeEngine && m_isRenderingEnabled) - m_drapeEngine->SetRenderingEnabled(nullptr); + m_drapeEngine->SetRenderingEnabled(); InvalidateRect(MercatorBounds::FullRect()); } @@ -1623,15 +1617,6 @@ void Framework::CreateDrapeEngine(ref_ptr contextFactory, InvalidateUserMarks(); -#ifdef OMIM_OS_ANDROID - // In case of the engine reinitialization recover compass and location data - // for correct my position state. - if (m_lastCompassInfo != nullptr) - OnCompassUpdate(*m_lastCompassInfo.release()); - if (m_lastGPSInfo != nullptr) - OnLocationUpdate(*m_lastGPSInfo.release()); -#endif - Allow3dMode(allow3d, allow3dBuildings); LoadViewport(); @@ -1646,13 +1631,6 @@ void Framework::CreateDrapeEngine(ref_ptr contextFactory, if (m_connectToGpsTrack) GpsTracker::Instance().Connect(bind(&Framework::OnUpdateGpsTrackPointsCallback, this, _1, _2)); - // In case of the engine reinitialization simulate the last tap to show selection mark. - if (m_lastTapEvent) - { - place_page::Info info; - ActivateMapSelection(false, OnTapEventImpl(*m_lastTapEvent, info), info); - } - m_drapeEngine->RequestSymbolsSize(kSearchMarks, [this](vector const & sizes) { GetPlatform().RunOnGuiThread([this, sizes](){ m_searchMarksSizes = sizes; }); @@ -1664,7 +1642,14 @@ void Framework::UpdateDrapeEngine(int width, int height) if (m_drapeEngine) { m_drapeEngine->Update(width, height); + InvalidateUserMarks(); + + if (m_lastTapEvent) + { + place_page::Info info; + ActivateMapSelection(false, OnTapEventImpl(*m_lastTapEvent, info), info); + } } } diff --git a/map/framework.hpp b/map/framework.hpp index 60b3f47277..0b9ef4823d 100644 --- a/map/framework.hpp +++ b/map/framework.hpp @@ -331,10 +331,6 @@ public: private: unique_ptr m_lastTapEvent; -#ifdef OMIM_OS_ANDROID - unique_ptr m_lastCompassInfo; - unique_ptr m_lastGPSInfo; -#endif void OnTapEvent(df::TapInfo const & tapInfo); /// outInfo is valid only if return value is not df::SelectionShape::OBJECT_EMPTY. @@ -392,7 +388,7 @@ public: bool IsDrapeEngineCreated() const { return m_drapeEngine != nullptr; } void DestroyDrapeEngine(); /// Called when graphics engine should be temporarily paused and then resumed. - void SetRenderingEnabled(ref_ptr contextFactory); + void SetRenderingEnabled(ref_ptr contextFactory = nullptr); void SetRenderingDisabled(bool destroyContext); void UpdateDrapeEngine(int width, int height);