forked from organicmaps/organicmaps
Review fixes
This commit is contained in:
parent
0c87211af6
commit
676f7d5414
7 changed files with 17 additions and 17 deletions
|
@ -50,7 +50,7 @@ DrapeEngine::DrapeEngine(Params && params)
|
|||
bind(&DrapeEngine::UserPositionChanged, this, _1),
|
||||
bind(&DrapeEngine::MyPositionModeChanged, this, _1, _2),
|
||||
mode, make_ref(m_requestedTiles),
|
||||
move(params.m_showEventCallback), timeInBackground,
|
||||
move(params.m_overlaysShowStatsCallback), timeInBackground,
|
||||
params.m_allow3dBuildings, params.m_trafficEnabled,
|
||||
params.m_blockTapEvents, params.m_isFirstLaunch,
|
||||
params.m_isRoutingActive, params.m_isAutozoomEnabled);
|
||||
|
|
|
@ -58,7 +58,7 @@ public:
|
|||
bool isRoutingActive,
|
||||
bool isAutozoomEnabled,
|
||||
bool simplifiedTrafficColors,
|
||||
OverlayShowEventCallback && showEventCallback)
|
||||
OverlaysShowStatsCallback && overlaysShowStatsCallback)
|
||||
: m_factory(factory)
|
||||
, m_stringsBundle(stringBundle)
|
||||
, m_viewport(viewport)
|
||||
|
@ -77,7 +77,7 @@ public:
|
|||
, m_isRoutingActive(isRoutingActive)
|
||||
, m_isAutozoomEnabled(isAutozoomEnabled)
|
||||
, m_simplifiedTrafficColors(simplifiedTrafficColors)
|
||||
, m_showEventCallback(move(showEventCallback))
|
||||
, m_overlaysShowStatsCallback(move(overlaysShowStatsCallback))
|
||||
{}
|
||||
|
||||
ref_ptr<dp::OGLContextFactory> m_factory;
|
||||
|
@ -98,7 +98,7 @@ public:
|
|||
bool m_isRoutingActive;
|
||||
bool m_isAutozoomEnabled;
|
||||
bool m_simplifiedTrafficColors;
|
||||
OverlayShowEventCallback m_showEventCallback;
|
||||
OverlaysShowStatsCallback m_overlaysShowStatsCallback;
|
||||
};
|
||||
|
||||
DrapeEngine(Params && params);
|
||||
|
|
|
@ -138,7 +138,7 @@ FrontendRenderer::FrontendRenderer(Params && params)
|
|||
, m_needRegenerateTraffic(false)
|
||||
, m_trafficEnabled(params.m_trafficEnabled)
|
||||
, m_overlaysTracker(new OverlaysTracker())
|
||||
, m_showEventCallback(move(params.m_showEventCallback))
|
||||
, m_overlaysShowStatsCallback(move(params.m_overlaysShowStatsCallback))
|
||||
#ifdef SCENARIO_ENABLE
|
||||
, m_scenarioManager(new ScenarioManager(this))
|
||||
#endif
|
||||
|
@ -780,7 +780,7 @@ void FrontendRenderer::AcceptMessage(ref_ptr<Message> message)
|
|||
case Message::UpdateCustomSymbols:
|
||||
{
|
||||
ref_ptr<UpdateCustomSymbolsMessage> msg = message;
|
||||
m_overlaysTracker->Init(msg->AcceptSymbolsFeatures());
|
||||
m_overlaysTracker->SetTrackedOverlaysFeatures(msg->AcceptSymbolsFeatures());
|
||||
ScreenBase const & screen = m_userEventStream.GetCurrentScreen();
|
||||
InvalidateRect(screen.ClipRect());
|
||||
break;
|
||||
|
@ -1943,8 +1943,8 @@ drape_ptr<ScenarioManager> const & FrontendRenderer::GetScenarioManager() const
|
|||
|
||||
void FrontendRenderer::CollectShowOverlaysEvents()
|
||||
{
|
||||
ASSERT(m_showEventCallback != nullptr, ());
|
||||
m_showEventCallback(m_overlaysTracker->Collect());
|
||||
ASSERT(m_overlaysShowStatsCallback != nullptr, ());
|
||||
m_overlaysShowStatsCallback(m_overlaysTracker->Collect());
|
||||
}
|
||||
|
||||
FrontendRenderer::RenderLayer::RenderLayerID FrontendRenderer::RenderLayer::GetLayerID(dp::GLState const & state)
|
||||
|
|
|
@ -80,7 +80,7 @@ public:
|
|||
location::TMyPositionModeChanged myPositionModeCallback,
|
||||
location::EMyPositionMode initMode,
|
||||
ref_ptr<RequestedTiles> requestedTiles,
|
||||
OverlayShowEventCallback && showEventCallback,
|
||||
OverlaysShowStatsCallback && overlaysShowStatsCallback,
|
||||
double timeInBackground,
|
||||
bool allow3dBuildings,
|
||||
bool trafficEnabled,
|
||||
|
@ -96,7 +96,7 @@ public:
|
|||
, m_myPositionModeCallback(myPositionModeCallback)
|
||||
, m_initMyPositionMode(initMode)
|
||||
, m_requestedTiles(requestedTiles)
|
||||
, m_showEventCallback(move(showEventCallback))
|
||||
, m_overlaysShowStatsCallback(move(overlaysShowStatsCallback))
|
||||
, m_timeInBackground(timeInBackground)
|
||||
, m_allow3dBuildings(allow3dBuildings)
|
||||
, m_trafficEnabled(trafficEnabled)
|
||||
|
@ -113,7 +113,7 @@ public:
|
|||
location::TMyPositionModeChanged m_myPositionModeCallback;
|
||||
location::EMyPositionMode m_initMyPositionMode;
|
||||
ref_ptr<RequestedTiles> m_requestedTiles;
|
||||
OverlayShowEventCallback m_showEventCallback;
|
||||
OverlaysShowStatsCallback m_overlaysShowStatsCallback;
|
||||
double m_timeInBackground;
|
||||
bool m_allow3dBuildings;
|
||||
bool m_trafficEnabled;
|
||||
|
@ -337,7 +337,7 @@ private:
|
|||
bool m_trafficEnabled;
|
||||
|
||||
drape_ptr<OverlaysTracker> m_overlaysTracker;
|
||||
OverlayShowEventCallback m_showEventCallback;
|
||||
OverlaysShowStatsCallback m_overlaysShowStatsCallback;
|
||||
|
||||
drape_ptr<ScenarioManager> m_scenarioManager;
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
namespace df
|
||||
{
|
||||
void OverlaysTracker::Init(std::vector<FeatureID> && ids)
|
||||
void OverlaysTracker::SetTrackedOverlaysFeatures(std::vector<FeatureID> && ids)
|
||||
{
|
||||
m_data.clear();
|
||||
for (auto const & fid : ids)
|
||||
|
|
|
@ -23,7 +23,7 @@ struct OverlayShowEvent
|
|||
{}
|
||||
};
|
||||
|
||||
using OverlayShowEventCallback = std::function<void(std::list<OverlayShowEvent> &&)>;
|
||||
using OverlaysShowStatsCallback = std::function<void(std::list<OverlayShowEvent> &&)>;
|
||||
|
||||
int constexpr kMinZoomLevel = 10;
|
||||
|
||||
|
@ -32,7 +32,7 @@ class OverlaysTracker
|
|||
public:
|
||||
OverlaysTracker() = default;
|
||||
|
||||
void Init(std::vector<FeatureID> && ids);
|
||||
void SetTrackedOverlaysFeatures(std::vector<FeatureID> && ids);
|
||||
|
||||
bool StartTracking(int zoomLevel);
|
||||
void Track(FeatureID const & fid);
|
||||
|
|
|
@ -1673,7 +1673,7 @@ void Framework::CreateDrapeEngine(ref_ptr<dp::OGLContextFactory> contextFactory,
|
|||
});
|
||||
};
|
||||
|
||||
auto showOverlaysEventFn = [](std::list<df::OverlayShowEvent> && events)
|
||||
auto overlaysShowStatsFn = [](std::list<df::OverlayShowEvent> && events)
|
||||
{
|
||||
// TODO: implement sending events. This callback is called on a render thread,
|
||||
// so placing here not lightweight code is strictly prohibited! The best option is
|
||||
|
@ -1704,7 +1704,7 @@ void Framework::CreateDrapeEngine(ref_ptr<dp::OGLContextFactory> contextFactory,
|
|||
move(myPositionModeChangedFn), allow3dBuildings, trafficEnabled, params.m_isChoosePositionMode,
|
||||
params.m_isChoosePositionMode, GetSelectedFeatureTriangles(), params.m_isFirstLaunch,
|
||||
m_routingSession.IsActive() && m_routingSession.IsFollowing(), isAutozoomEnabled,
|
||||
simplifiedTrafficColors, showOverlaysEventFn);
|
||||
simplifiedTrafficColors, move(overlaysShowStatsFn));
|
||||
|
||||
m_drapeEngine = make_unique_dp<df::DrapeEngine>(move(p));
|
||||
m_drapeEngine->SetModelViewListener([this](ScreenBase const & screen)
|
||||
|
|
Loading…
Add table
Reference in a new issue