| 234 | } |
| 235 | |
| 236 | void MyPosition::CachePointPosition(ref_ptr<dp::GraphicsContext> context, ref_ptr<dp::TextureManager> mng) |
| 237 | { |
| 238 | int constexpr kSymbolsCount = 1; |
| 239 | dp::TextureManager::SymbolRegion pointSymbol; |
| 240 | mng->GetSymbolRegion("current-position", pointSymbol); |
| 241 | |
| 242 | auto state = CreateRenderState(gpu::Program::MyPosition, DepthLayer::OverlayLayer); |
| 243 | state.SetDepthTestEnabled(false); |
| 244 | state.SetColorTexture(pointSymbol.GetTexture()); |
| 245 | state.SetTextureIndex(pointSymbol.GetTextureIndex()); |
| 246 | |
| 247 | dp::TextureManager::SymbolRegion * symbols[kSymbolsCount] = {&pointSymbol}; |
| 248 | EMyPositionPart partIndices[kSymbolsCount] = {MyPositionPoint}; |
| 249 | { |
| 250 | dp::Batcher batcher(kSymbolsCount * dp::Batcher::IndexPerQuad, kSymbolsCount * dp::Batcher::VertexPerQuad); |
| 251 | batcher.SetBatcherHash(static_cast<uint64_t>(BatcherBucket::Default)); |
| 252 | dp::SessionGuard guard(context, batcher, [this](dp::RenderState const & state, drape_ptr<dp::RenderBucket> && b) |
| 253 | { |
| 254 | drape_ptr<dp::RenderBucket> bucket = std::move(b); |
| 255 | ASSERT(bucket->GetOverlayHandlesCount() == 0, ()); |
| 256 | |
| 257 | m_nodes.emplace_back(state, bucket->MoveBuffer()); |
| 258 | }); |
| 259 | |
| 260 | auto const partIndex = m_nodes.size(); |
| 261 | for (int i = 0; i < kSymbolsCount; i++) |
| 262 | { |
| 263 | m_parts[partIndices[i]].second = partIndex; |
| 264 | CacheSymbol(context, *symbols[i], state, batcher, partIndices[i]); |
| 265 | } |
| 266 | } |
| 267 | } |
| 268 | |
| 269 | void MyPosition::RenderPart(ref_ptr<dp::GraphicsContext> context, ref_ptr<gpu::ProgramManager> mng, |
| 270 | gpu::ShapesProgramParams const & params, EMyPositionPart part) |
nothing calls this directly
no test coverage detected