| 69 | } |
| 70 | |
| 71 | void 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 | |
| 105 | void PathTextShape::DrawPathTextOutlined(ref_ptr<dp::GraphicsContext> context, ref_ptr<dp::TextureManager> textures, |
| 106 | ref_ptr<dp::Batcher> batcher) const |
nothing calls this directly
no test coverage detected