MCPcopy Create free account
hub / github.com/comaps/comaps / GenerateUserMarksGeometry

Method GenerateUserMarksGeometry

libs/drape_frontend/user_mark_generator.cpp:224–249  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

222}
223
224void 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
251void UserMarkGenerator::CacheUserLines(ref_ptr<dp::GraphicsContext> context, TileKey const & tileKey,
252 MarksIDGroups const & indexesGroups, ref_ptr<dp::TextureManager> textures,

Callers 1

AcceptMessageMethod · 0.80

Calls 8

CacheUserMarksFunction · 0.85
CacheUserLinesFunction · 0.85
SetBatcherHashMethod · 0.80
GetHashValueMethod · 0.80
TileKeyClass · 0.70
getMethod · 0.65
emplace_backMethod · 0.45

Tested by

no test coverage detected