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

Method Rebuild

libs/drape_frontend/screen_quad_renderer.cpp:53–75  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

51}
52
53void ScreenQuadRenderer::Rebuild(ref_ptr<dp::GraphicsContext> context)
54{
55 std::vector<float> vertices;
56 vertices.reserve(4);
57 if (context->GetApiVersion() == dp::ApiVersion::Vulkan)
58 {
59 vertices = {-1.0f, -1.0f, m_textureRect.minX(), m_textureRect.minY(),
60 1.0f, -1.0f, m_textureRect.maxX(), m_textureRect.minY(),
61 -1.0f, 1.0f, m_textureRect.minX(), m_textureRect.maxY(),
62 1.0f, 1.0f, m_textureRect.maxX(), m_textureRect.maxY()};
63 }
64 else
65 {
66 vertices = {-1.0f, 1.0f, m_textureRect.minX(), m_textureRect.maxY(),
67 1.0f, 1.0f, m_textureRect.maxX(), m_textureRect.maxY(),
68 -1.0f, -1.0f, m_textureRect.minX(), m_textureRect.minY(),
69 1.0f, -1.0f, m_textureRect.maxX(), m_textureRect.minY()};
70 }
71 auto const bufferIndex = 0;
72 SetBuffer(bufferIndex, std::move(vertices), sizeof(float) * 4 /* stride */);
73 SetAttribute("a_pos", bufferIndex, 0 /* offset */, 2 /* componentsCount */);
74 SetAttribute("a_tcoord", bufferIndex, sizeof(float) * 2 /* offset */, 2 /* componentsCount */);
75}
76
77void ScreenQuadRenderer::RenderTexture(ref_ptr<dp::GraphicsContext> context, ref_ptr<gpu::ProgramManager> mng,
78 ref_ptr<dp::Texture> texture, float opacity, bool invertV)

Callers

nothing calls this directly

Calls 6

minXMethod · 0.80
minYMethod · 0.80
maxXMethod · 0.80
maxYMethod · 0.80
reserveMethod · 0.45
GetApiVersionMethod · 0.45

Tested by

no test coverage detected