| 215 | } |
| 216 | |
| 217 | void ReadManager::PushTaskBackForTileKey(TileKey const & tileKey, ref_ptr<dp::TextureManager> texMng, |
| 218 | ref_ptr<MetalineManager> metalineMng) |
| 219 | { |
| 220 | ASSERT(m_pool != nullptr, ()); |
| 221 | auto context = make_unique_dp<EngineContext>(TileKey(tileKey, m_generationCounter, m_userMarksGenerationCounter), |
| 222 | m_commutator, texMng, metalineMng, m_customFeaturesContext, |
| 223 | m_have3dBuildings && m_allow3dBuildings, m_trafficEnabled, |
| 224 | m_isolinesEnabled, m_mapLangIndex); |
| 225 | std::shared_ptr<TileInfo> tileInfo = std::make_shared<TileInfo>(std::move(context)); |
| 226 | m_tileInfos.insert(tileInfo); |
| 227 | |
| 228 | /// @todo Do we really need ReadMWMTask pool? Avoid "new" with hand-written bicycle? ;) |
| 229 | ReadMWMTask * task = m_tasksPool.Get(); |
| 230 | |
| 231 | task->Init(tileInfo); |
| 232 | /// @todo Can we update m_activeTiles once like IncreaseCounter and lock mutex once? |
| 233 | /// Or order is important here? |
| 234 | { |
| 235 | std::lock_guard lock(m_finishedTilesMutex); |
| 236 | m_activeTiles.insert(TileKey(tileKey, m_generationCounter, m_userMarksGenerationCounter)); |
| 237 | } |
| 238 | m_pool->PushBack(task); |
| 239 | } |
| 240 | |
| 241 | void ReadManager::CheckFinishedTiles(TTileInfoCollection const & requestedTiles, bool forceUpdateUserMarks) |
| 242 | { |