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

Method DrawPathTextPlain

libs/drape_frontend/path_text_shape.cpp:71–103  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

69}
70
71void PathTextShape::DrawPathTextPlain(ref_ptr<dp::GraphicsContext> context, ref_ptr<dp::TextureManager> textures,
72 ref_ptr<dp::Batcher> batcher) const
73{
74 auto const layout = m_context->GetLayout();
75 ASSERT(layout != nullptr, ());
76 ASSERT(!m_context->GetOffsets().empty(), ());
77
78 dp::TextureManager::ColorRegion color;
79 textures->GetColorRegion(m_params.m_textFont.m_color, color);
80
81 auto state = CreateRenderState(gpu::Program::Text, DepthLayer::OverlayLayer);
82 state.SetProgram3d(gpu::Program::TextBillboard);
83 state.SetDepthTestEnabled(m_params.m_depthTestEnabled);
84 state.SetColorTexture(color.GetTexture());
85 state.SetMaskTexture(layout->GetMaskTexture());
86
87 gpu::TTextStaticVertexBuffer staticBuffer;
88 gpu::TTextDynamicVertexBuffer dynBuffer;
89
90 for (uint32_t textIndex = 0; textIndex < m_context->GetOffsets().size(); ++textIndex)
91 {
92 staticBuffer.clear();
93 dynBuffer.clear();
94
95 layout->CacheStaticGeometry(color, staticBuffer);
96 dynBuffer.resize(staticBuffer.size());
97
98 dp::AttributeProvider provider(2, static_cast<uint32_t>(staticBuffer.size()));
99 provider.InitStream(0, gpu::TextStaticVertex::GetBindingInfo(), make_ref(staticBuffer.data()));
100 provider.InitStream(1, gpu::TextDynamicVertex::GetBindingInfo(), make_ref(dynBuffer.data()));
101 batcher->InsertListOfStrip(context, state, make_ref(&provider), CreateOverlayHandle(textIndex, textures), 4);
102 }
103}
104
105void PathTextShape::DrawPathTextOutlined(ref_ptr<dp::GraphicsContext> context, ref_ptr<dp::TextureManager> textures,
106 ref_ptr<dp::Batcher> batcher) const

Callers

nothing calls this directly

Calls 15

ASSERTFunction · 0.85
CreateRenderStateFunction · 0.85
GetBindingInfoFunction · 0.85
make_refFunction · 0.85
GetLayoutMethod · 0.80
GetOffsetsMethod · 0.80
GetColorRegionMethod · 0.80
SetProgram3dMethod · 0.80
SetColorTextureMethod · 0.80
SetMaskTextureMethod · 0.80
CacheStaticGeometryMethod · 0.80
InitStreamMethod · 0.80

Tested by

no test coverage detected