| 122 | } |
| 123 | |
| 124 | void ReadManager::UpdateCoverage(ScreenBase const & screen, bool have3dBuildings, bool forceUpdate, |
| 125 | bool forceUpdateUserMarks, TTilesCollection const & tiles, |
| 126 | ref_ptr<dp::TextureManager> texMng, ref_ptr<MetalineManager> metalineMng) |
| 127 | { |
| 128 | m_modeChanged |= (m_have3dBuildings != have3dBuildings); |
| 129 | m_have3dBuildings = have3dBuildings; |
| 130 | |
| 131 | if (m_modeChanged || forceUpdate || MustDropAllTiles(screen)) |
| 132 | { |
| 133 | m_modeChanged = false; |
| 134 | |
| 135 | for (auto const & info : m_tileInfos) |
| 136 | CancelTileInfo(info); |
| 137 | m_tileInfos.clear(); |
| 138 | |
| 139 | IncreaseCounter(tiles.size()); |
| 140 | ++m_generationCounter; |
| 141 | ++m_userMarksGenerationCounter; |
| 142 | |
| 143 | for (auto const & tileKey : tiles) |
| 144 | PushTaskBackForTileKey(tileKey, texMng, metalineMng); |
| 145 | } |
| 146 | else |
| 147 | { |
| 148 | // Find rects that go out from viewport. |
| 149 | TTileInfoCollection outdatedTiles; |
| 150 | std::set_difference(m_tileInfos.begin(), m_tileInfos.end(), tiles.begin(), tiles.end(), |
| 151 | std::back_inserter(outdatedTiles), LessCoverageCell()); |
| 152 | |
| 153 | for (auto const & info : outdatedTiles) |
| 154 | ClearTileInfo(info); |
| 155 | |
| 156 | // Find rects that go in into viewport. |
| 157 | buffer_vector<TileKey, 8> newTiles; |
| 158 | std::set_difference(tiles.begin(), tiles.end(), m_tileInfos.begin(), m_tileInfos.end(), |
| 159 | std::back_inserter(newTiles), LessCoverageCell()); |
| 160 | |
| 161 | // Find ready tiles. |
| 162 | TTileInfoCollection readyTiles; |
| 163 | std::set_difference(m_tileInfos.begin(), m_tileInfos.end(), outdatedTiles.begin(), outdatedTiles.end(), |
| 164 | std::back_inserter(readyTiles), LessCoverageCell()); |
| 165 | |
| 166 | IncreaseCounter(newTiles.size()); |
| 167 | |
| 168 | if (forceUpdateUserMarks) |
| 169 | ++m_userMarksGenerationCounter; |
| 170 | CheckFinishedTiles(readyTiles, forceUpdateUserMarks); |
| 171 | |
| 172 | for (auto const & tileKey : newTiles) |
| 173 | PushTaskBackForTileKey(tileKey, texMng, metalineMng); |
| 174 | } |
| 175 | |
| 176 | m_currentViewport = screen; |
| 177 | } |
| 178 | |
| 179 | void ReadManager::Invalidate(TTilesCollection const & keyStorage) |
| 180 | { |
no test coverage detected