| 222 | } |
| 223 | |
| 224 | void UserMarkGenerator::GenerateUserMarksGeometry(ref_ptr<dp::GraphicsContext> context, TileKey const & tileKey, |
| 225 | ref_ptr<dp::TextureManager> textures) |
| 226 | { |
| 227 | auto const clippedTileKey = TileKey(tileKey.m_x, tileKey.m_y, ClipTileZoomByMaxDataZoom(tileKey.m_zoomLevel)); |
| 228 | auto marksGroups = GetUserMarksGroups(clippedTileKey); |
| 229 | auto linesGroups = GetUserLinesGroups(clippedTileKey); |
| 230 | |
| 231 | if (marksGroups == nullptr && linesGroups == nullptr) |
| 232 | return; |
| 233 | |
| 234 | uint32_t constexpr kMaxSize = 65000; |
| 235 | dp::Batcher batcher(kMaxSize, kMaxSize); |
| 236 | batcher.SetBatcherHash(tileKey.GetHashValue(BatcherBucket::UserMark)); |
| 237 | TUserMarksRenderData renderData; |
| 238 | { |
| 239 | dp::SessionGuard guard(context, batcher, |
| 240 | [&tileKey, &renderData](dp::RenderState const & state, drape_ptr<dp::RenderBucket> && b) |
| 241 | { renderData.emplace_back(state, std::move(b), tileKey); }); |
| 242 | |
| 243 | if (marksGroups != nullptr) |
| 244 | CacheUserMarks(context, tileKey, *marksGroups.get(), textures, batcher); |
| 245 | if (linesGroups != nullptr) |
| 246 | CacheUserLines(context, tileKey, *linesGroups.get(), textures, batcher); |
| 247 | } |
| 248 | m_flushFn(std::move(renderData)); |
| 249 | } |
| 250 | |
| 251 | void UserMarkGenerator::CacheUserLines(ref_ptr<dp::GraphicsContext> context, TileKey const & tileKey, |
| 252 | MarksIDGroups const & indexesGroups, ref_ptr<dp::TextureManager> textures, |
no test coverage detected