forked from organicmaps/organicmaps
Tiles reading fixed.
This commit is contained in:
parent
635be54e90
commit
3eb9e4363c
6 changed files with 20 additions and 15 deletions
|
@ -29,7 +29,7 @@ public:
|
|||
|
||||
private:
|
||||
typedef pair<dp::Batcher *, int> TBatcherPair;
|
||||
typedef map<TileKey, TBatcherPair> TBatcherMap;
|
||||
typedef map<TileKey, TBatcherPair, TileKeyStrictComparator> TBatcherMap;
|
||||
typedef TBatcherMap::iterator TIterator;
|
||||
TSendMessageFn m_sendMessageFn;
|
||||
|
||||
|
|
|
@ -598,6 +598,7 @@ void FrontendRenderer::AcceptMessage(ref_ptr<Message> message)
|
|||
|
||||
// Request new tiles.
|
||||
ScreenBase screen = m_userEventStream.GetCurrentScreen();
|
||||
m_lastReadedModelView = screen;
|
||||
m_requestedTiles->Set(screen, m_isIsometry || screen.isPerspective(), ResolveTileKeys(screen));
|
||||
m_commutator->PostMessage(ThreadsCommutator::ResourceUploadThread,
|
||||
make_unique_dp<UpdateReadManagerMessage>(),
|
||||
|
@ -760,6 +761,7 @@ void FrontendRenderer::InvalidateRect(m2::RectD const & gRect)
|
|||
blocker.Wait();
|
||||
|
||||
// Request new tiles.
|
||||
m_lastReadedModelView = screen;
|
||||
m_requestedTiles->Set(screen, m_isIsometry || screen.isPerspective(), ResolveTileKeys(screen));
|
||||
m_commutator->PostMessage(ThreadsCommutator::ResourceUploadThread,
|
||||
make_unique_dp<UpdateReadManagerMessage>(),
|
||||
|
@ -1577,10 +1579,14 @@ void FrontendRenderer::UpdateScene(ScreenBase const & modelView)
|
|||
for (RenderLayer & layer : m_layers)
|
||||
layer.m_isDirty |= RemoveGroups(removePredicate, layer.m_renderGroups, make_ref(m_overlayTree));
|
||||
|
||||
m_requestedTiles->Set(modelView, m_isIsometry || modelView.isPerspective(), ResolveTileKeys(modelView));
|
||||
m_commutator->PostMessage(ThreadsCommutator::ResourceUploadThread,
|
||||
make_unique_dp<UpdateReadManagerMessage>(),
|
||||
MessagePriority::UberHighSingleton);
|
||||
if (m_lastReadedModelView != modelView)
|
||||
{
|
||||
m_lastReadedModelView = modelView;
|
||||
m_requestedTiles->Set(modelView, m_isIsometry || modelView.isPerspective(), ResolveTileKeys(modelView));
|
||||
m_commutator->PostMessage(ThreadsCommutator::ResourceUploadThread,
|
||||
make_unique_dp<UpdateReadManagerMessage>(),
|
||||
MessagePriority::UberHighSingleton);
|
||||
}
|
||||
}
|
||||
|
||||
void FrontendRenderer::EmitModelViewChanged(ScreenBase const & modelView) const
|
||||
|
|
|
@ -271,6 +271,7 @@ private:
|
|||
TTapEventInfoFn m_tapEventInfoFn;
|
||||
TUserPositionChangedFn m_userPositionChangedFn;
|
||||
|
||||
ScreenBase m_lastReadedModelView;
|
||||
TTilesCollection m_notFinishedTiles;
|
||||
|
||||
int m_currentZoomLevel = -1;
|
||||
|
|
|
@ -40,7 +40,6 @@ ReadManager::ReadManager(ref_ptr<ThreadsCommutator> commutator, MapDataProvider
|
|||
: m_commutator(commutator)
|
||||
, m_model(model)
|
||||
, m_pool(make_unique_dp<threads::ThreadPool>(ReadCount(), bind(&ReadManager::OnTaskFinished, this, _1)))
|
||||
, m_forceUpdate(true)
|
||||
, m_have3dBuildings(false)
|
||||
, m_allow3dBuildings(allow3dBuildings)
|
||||
, m_modeChanged(false)
|
||||
|
@ -88,10 +87,6 @@ void ReadManager::OnTaskFinished(threads::IRoutine * task)
|
|||
void ReadManager::UpdateCoverage(ScreenBase const & screen, bool have3dBuildings,
|
||||
TTilesCollection const & tiles, ref_ptr<dp::TextureManager> texMng)
|
||||
{
|
||||
if (screen == m_currentViewport && !m_forceUpdate)
|
||||
return;
|
||||
|
||||
m_forceUpdate = false;
|
||||
m_modeChanged |= (m_have3dBuildings != have3dBuildings);
|
||||
m_have3dBuildings = have3dBuildings;
|
||||
|
||||
|
@ -160,8 +155,6 @@ void ReadManager::Invalidate(TTilesCollection const & keyStorage)
|
|||
CancelTileInfo(info);
|
||||
m_tileInfos.erase(info);
|
||||
}
|
||||
|
||||
m_forceUpdate = true;
|
||||
}
|
||||
|
||||
void ReadManager::InvalidateAll()
|
||||
|
@ -171,7 +164,6 @@ void ReadManager::InvalidateAll()
|
|||
|
||||
m_tileInfos.clear();
|
||||
|
||||
m_forceUpdate = true;
|
||||
m_modeChanged = true;
|
||||
}
|
||||
|
||||
|
@ -271,7 +263,6 @@ void ReadManager::Allow3dBuildings(bool allow3dBuildings)
|
|||
if (m_allow3dBuildings != allow3dBuildings)
|
||||
{
|
||||
m_modeChanged = true;
|
||||
m_forceUpdate = true;
|
||||
m_allow3dBuildings = allow3dBuildings;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -54,7 +54,6 @@ private:
|
|||
drape_ptr<threads::ThreadPool> m_pool;
|
||||
|
||||
ScreenBase m_currentViewport;
|
||||
bool m_forceUpdate;
|
||||
bool m_have3dBuildings;
|
||||
bool m_allow3dBuildings;
|
||||
bool m_modeChanged;
|
||||
|
|
|
@ -31,6 +31,14 @@ struct TileKey
|
|||
uint64_t m_generation;
|
||||
};
|
||||
|
||||
struct TileKeyStrictComparator
|
||||
{
|
||||
bool operator() (TileKey const & lhs, TileKey const & rhs) const
|
||||
{
|
||||
return lhs.LessStrict(rhs);
|
||||
}
|
||||
};
|
||||
|
||||
string DebugPrint(TileKey const & key);
|
||||
|
||||
} // namespace df
|
||||
|
|
Loading…
Add table
Reference in a new issue