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

Method Render

libs/drape_frontend/drape_api_renderer.cpp:57–94  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

55}
56
57void DrapeApiRenderer::Render(ref_ptr<dp::GraphicsContext> context, ref_ptr<gpu::ProgramManager> mng,
58 ScreenBase const & screen, FrameValues const & frameValues)
59{
60 if (m_properties.empty())
61 return;
62
63 auto const & glyphParams = df::VisualParams::Instance().GetGlyphVisualParams();
64 for (auto const & property : m_properties)
65 {
66 math::Matrix<float, 4, 4> const mv = screen.GetModelView(property->m_center, kShapeCoordScalar);
67 for (auto const & bucket : property->m_buckets)
68 {
69 auto program = mng->GetProgram(bucket.first.GetProgram<gpu::Program>());
70 program->Bind();
71 dp::ApplyState(context, program, bucket.first);
72
73 auto const p = bucket.first.GetProgram<gpu::Program>();
74 if (p == gpu::Program::TextOutlinedGui || p == gpu::Program::TextStaticOutlinedGui)
75 {
76 gpu::GuiProgramParams params;
77 frameValues.SetTo(params);
78 params.m_modelView = glsl::make_mat4(mv.m_data);
79 params.m_contrastGamma = glsl::vec2(glyphParams.m_guiContrast, glyphParams.m_guiGamma);
80 params.m_isOutlinePass = 0.0f;
81 mng->GetParamsSetter()->Apply(context, program, params);
82 }
83 else
84 {
85 gpu::MapProgramParams params;
86 frameValues.SetTo(params);
87 params.m_modelView = glsl::make_mat4(mv.m_data);
88 mng->GetParamsSetter()->Apply(context, program, params);
89 }
90
91 bucket.second->Render(context, bucket.first.GetDrawAsLine());
92 }
93 }
94}
95} // namespace df

Callers

nothing calls this directly

Calls 10

ApplyStateFunction · 0.85
vec2Class · 0.85
GetModelViewMethod · 0.80
SetToMethod · 0.80
GetParamsSetterMethod · 0.80
GetDrawAsLineMethod · 0.80
emptyMethod · 0.45
GetProgramMethod · 0.45
BindMethod · 0.45
ApplyMethod · 0.45

Tested by

no test coverage detected