| 103 | } |
| 104 | |
| 105 | void 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 | |
| 140 | drape_ptr<dp::OverlayHandle> PathTextShape::CreateOverlayHandle(uint32_t textIndex, |
| 141 | ref_ptr<dp::TextureManager> textures) const |
nothing calls this directly
no test coverage detected