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

Method Draw

libs/drape_frontend/line_shape.cpp:512–547  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

510}
511
512void LineShape::Draw(ref_ptr<dp::GraphicsContext> context, ref_ptr<dp::Batcher> batcher,
513 ref_ptr<dp::TextureManager> textures) const
514{
515 if (!m_lineShapeInfo)
516 Prepare(textures);
517
518 ASSERT(m_lineShapeInfo != nullptr, ());
519 dp::RenderState state = m_lineShapeInfo->GetState();
520 dp::AttributeProvider provider(1, m_lineShapeInfo->GetLineSize());
521 provider.InitStream(0, m_lineShapeInfo->GetBindingInfo(), m_lineShapeInfo->GetLineData());
522 if (!m_isSimple)
523 {
524 batcher->InsertListOfStrip(context, state, make_ref(&provider), dp::Batcher::VertexPerQuad);
525
526 // Not used, keep comment for possible usage. LineJoin::RoundJoin is processed as _Cap_.
527 // uint32_t const joinSize = m_lineShapeInfo->GetJoinSize();
528 // if (joinSize > 0)
529 // {
530 // dp::AttributeProvider joinsProvider(1, joinSize);
531 // joinsProvider.InitStream(0, m_lineShapeInfo->GetBindingInfo(), m_lineShapeInfo->GetJoinData());
532 // batcher->InsertTriangleList(context, state, make_ref(&joinsProvider));
533 // }
534
535 uint32_t const capSize = m_lineShapeInfo->GetCapSize();
536 if (capSize > 0)
537 {
538 dp::AttributeProvider capProvider(1, capSize);
539 capProvider.InitStream(0, m_lineShapeInfo->GetCapBindingInfo(), m_lineShapeInfo->GetCapData());
540 batcher->InsertTriangleList(context, m_lineShapeInfo->GetCapState(), make_ref(&capProvider));
541 }
542 }
543 else
544 {
545 batcher->InsertLineStrip(context, state, make_ref(&provider));
546 }
547}
548} // namespace df

Callers

nothing calls this directly

Calls 12

ASSERTFunction · 0.85
make_refFunction · 0.85
GetLineSizeMethod · 0.80
InitStreamMethod · 0.80
GetLineDataMethod · 0.80
InsertListOfStripMethod · 0.80
InsertTriangleListMethod · 0.80
InsertLineStripMethod · 0.80
GetStateMethod · 0.45
GetCapSizeMethod · 0.45
GetCapDataMethod · 0.45
GetCapStateMethod · 0.45

Tested by

no test coverage detected