TUserMarkShapes CacheUserMarks(UserMarksProvider const * provider, ref_ptr<dp::TextureManager> textures) { TUserMarkShapes shapes; CacheUserPoints(provider, textures, shapes); CacheUserLines(provider, textures, shapes); return shapes; }
void CacheUserMarks(UserMarksProvider const * provider, ref_ptr<dp::Batcher> batcher, ref_ptr<dp::TextureManager> textures) { CacheUserPoints(provider, batcher, textures); CacheUserLines(provider, batcher, textures); }
void UserMarkGenerator::GenerateUserMarksGeometry(ref_ptr<dp::GraphicsContext> context, TileKey const & tileKey, ref_ptr<dp::TextureManager> textures) { auto const clippedTileKey = TileKey(tileKey.m_x, tileKey.m_y, ClipTileZoomByMaxDataZoom(tileKey.m_zoomLevel)); auto marksGroups = GetUserMarksGroups(clippedTileKey); auto linesGroups = GetUserLinesGroups(clippedTileKey); if (marksGroups == nullptr && linesGroups == nullptr) return; uint32_t constexpr kMaxSize = 65000; dp::Batcher batcher(kMaxSize, kMaxSize); batcher.SetBatcherHash(tileKey.GetHashValue(BatcherBucket::UserMark)); TUserMarksRenderData renderData; { dp::SessionGuard guard(context, batcher, [&tileKey, &renderData](dp::RenderState const & state, drape_ptr<dp::RenderBucket> && b) { renderData.emplace_back(state, std::move(b), tileKey); }); if (marksGroups != nullptr) CacheUserMarks(context, tileKey, *marksGroups.get(), textures, batcher); if (linesGroups != nullptr) CacheUserLines(context, tileKey, *linesGroups.get(), textures, batcher); } m_flushFn(std::move(renderData)); }