diff options
author | ExMix <rahuba.youri@mapswithme.com> | 2014-01-22 00:21:05 +0400 |
---|---|---|
committer | Alex Zolotarev <alex@maps.me> | 2015-09-23 02:10:40 +0300 |
commit | 4afa6a1aefe608e1bc1d67aa2becce3970b8f034 (patch) | |
tree | 8221a0bd808a6447c337e552a1080b4e5edc96d9 /drape_frontend/read_manager.cpp | |
parent | c16751396d84ae525324d4d4576ad775ba943fd0 (diff) |
[drape] not store MemoryFeatureIndex and FeaturesFetcher in TileInfo
reading feature geometry
Diffstat (limited to 'drape_frontend/read_manager.cpp')
-rw-r--r-- | drape_frontend/read_manager.cpp | 31 |
1 files changed, 13 insertions, 18 deletions
diff --git a/drape_frontend/read_manager.cpp b/drape_frontend/read_manager.cpp index 2fb9cd5677..5eb84d879b 100644 --- a/drape_frontend/read_manager.cpp +++ b/drape_frontend/read_manager.cpp @@ -12,15 +12,8 @@ namespace df { - namespace { - -void CancelTaskFn(shared_ptr<TileInfo> tinfo) -{ - tinfo->Cancel(); -} - struct LessCoverageCell { bool operator()(shared_ptr<TileInfo> const & l, TileKey const & r) const @@ -38,7 +31,6 @@ TileKey TileInfoPtrToTileKey(shared_ptr<TileInfo> const & p) { return p->GetTileKey(); } - } ReadManager::ReadManager(double visualScale, int w, int h, @@ -66,7 +58,7 @@ void ReadManager::UpdateCoverage(const ScreenBase & screen, CoverageUpdateDescri if (MustDropAllTiles(screen)) { - for_each(m_tileInfos.begin(), m_tileInfos.end(), &CancelTaskFn); + for_each(m_tileInfos.begin(), m_tileInfos.end(), bind(&ReadManager::CancelTileInfo, this, _1)); m_tileInfos.clear(); for_each(tiles.begin(), tiles.end(), bind(&ReadManager::PushTaskBackForTileKey, this, _1)); @@ -75,7 +67,6 @@ void ReadManager::UpdateCoverage(const ScreenBase & screen, CoverageUpdateDescri } else { - // Find rects that go out from viewport buffer_vector<tileinfo_ptr, 8> outdatedTiles; set_difference(m_tileInfos.begin(), m_tileInfos.end(), @@ -109,7 +100,7 @@ void ReadManager::Resize(const m2::RectI & rect) void ReadManager::Stop() { - for_each(m_tileInfos.begin(), m_tileInfos.end(), &CancelTaskFn); + for_each(m_tileInfos.begin(), m_tileInfos.end(), bind(&ReadManager::CancelTileInfo, this, _1)); m_tileInfos.clear(); m_pool->Stop(); @@ -161,21 +152,25 @@ bool ReadManager::MustDropAllTiles(ScreenBase const & screen) const void ReadManager::PushTaskBackForTileKey(TileKey const & tileKey) { - tileinfo_ptr tileInfo(new TileInfo(tileKey, m_model, m_memIndex)); + tileinfo_ptr tileInfo(new TileInfo(tileKey)); m_tileInfos.insert(tileInfo); - m_pool->PushBack(new ReadMWMTask(tileInfo, m_context)); + m_pool->PushBack(new ReadMWMTask(tileInfo, m_memIndex, m_model, m_context)); } -void ReadManager::PushTaskFront(ReadManager::tileinfo_ptr const & tileToReread) + void ReadManager::PushTaskFront(tileinfo_ptr const & tileToReread) { - m_pool->PushFront(new ReadMWMTask(tileToReread, m_context)); + m_pool->PushFront(new ReadMWMTask(tileToReread, m_memIndex, m_model, m_context)); } -void ReadManager::ClearTileInfo(ReadManager::tileinfo_ptr & tileToClear) + void ReadManager::CancelTileInfo(tileinfo_ptr tileToCancel) { - tileToClear->Cancel(); + tileToCancel->Cancel(m_memIndex); + } + + void ReadManager::ClearTileInfo(tileinfo_ptr & tileToClear) + { + CancelTileInfo(tileToClear); m_tileInfos.erase(tileToClear); } - } |