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

Method DrawPathTextOutlined

libs/drape_frontend/path_text_shape.cpp:105–138  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

103}
104
105void PathTextShape::DrawPathTextOutlined(ref_ptr<dp::GraphicsContext> context, ref_ptr<dp::TextureManager> textures,
106 ref_ptr<dp::Batcher> batcher) const
107{
108 auto const layout = m_context->GetLayout();
109 ASSERT(layout != nullptr, ());
110 ASSERT(!m_context->GetOffsets().empty(), ());
111
112 dp::TextureManager::ColorRegion color;
113 dp::TextureManager::ColorRegion outline;
114 textures->GetColorRegion(m_params.m_textFont.m_color, color);
115 textures->GetColorRegion(m_params.m_textFont.m_outlineColor, outline);
116
117 auto state = CreateRenderState(gpu::Program::TextOutlined, DepthLayer::OverlayLayer);
118 state.SetProgram3d(gpu::Program::TextOutlinedBillboard);
119 state.SetDepthTestEnabled(m_params.m_depthTestEnabled);
120 state.SetColorTexture(color.GetTexture());
121 state.SetMaskTexture(layout->GetMaskTexture());
122
123 gpu::TTextOutlinedStaticVertexBuffer staticBuffer;
124 gpu::TTextDynamicVertexBuffer dynBuffer;
125 for (uint32_t textIndex = 0; textIndex < m_context->GetOffsets().size(); ++textIndex)
126 {
127 staticBuffer.clear();
128 dynBuffer.clear();
129
130 layout->CacheStaticGeometry(color, outline, staticBuffer);
131 dynBuffer.resize(staticBuffer.size());
132
133 dp::AttributeProvider provider(2, static_cast<uint32_t>(staticBuffer.size()));
134 provider.InitStream(0, gpu::TextOutlinedStaticVertex::GetBindingInfo(), make_ref(staticBuffer.data()));
135 provider.InitStream(1, gpu::TextDynamicVertex::GetBindingInfo(), make_ref(dynBuffer.data()));
136 batcher->InsertListOfStrip(context, state, make_ref(&provider), CreateOverlayHandle(textIndex, textures), 4);
137 }
138}
139
140drape_ptr<dp::OverlayHandle> PathTextShape::CreateOverlayHandle(uint32_t textIndex,
141 ref_ptr<dp::TextureManager> textures) 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