MCPcopy Create free account
hub / github.com/defold/defold / CreateProfilerTextLayout

Function CreateProfilerTextLayout

engine/profiler/src/profiler_render.cpp:180–205  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

178 }
179
180 static bool CreateProfilerTextLayout(HRenderProfile render_profile, dmRender::HFontMap font_map, const char* text, const dmRender::DrawTextParams& params, HTextLayout* out_layout)
181 {
182 TextLayoutSettings settings = {};
183 settings.m_Width = params.m_Width;
184 settings.m_LineBreak = params.m_LineBreak;
185 settings.m_Leading = params.m_Leading;
186 settings.m_Tracking = params.m_Tracking;
187 settings.m_Size = dmRender::GetFontMapSize(font_map);
188 settings.m_Monospace = dmRender::GetFontMapMonospaced(font_map);
189 settings.m_Padding = dmRender::GetFontMapPadding(font_map);
190
191 TextToCodePoints(text, render_profile->m_TextCodePoints);
192 uint32_t* codepoints = render_profile->m_TextCodePoints.Empty() ? 0 : render_profile->m_TextCodePoints.Begin();
193
194 HTextLayout layout = 0;
195 TextResult r = TextLayoutCreate(dmRender::GetFontCollection(font_map), codepoints, render_profile->m_TextCodePoints.Size(), &settings, &layout);
196 if (r != TEXT_RESULT_OK)
197 {
198 if (layout)
199 TextLayoutRelease(layout);
200 return false;
201 }
202
203 *out_layout = layout;
204 return true;
205 }
206
207 static void DrawProfilerTextLayout(dmRender::HRenderContext render_context, dmRender::HFontMap font_map, uint64_t batch_key, const dmRender::DrawTextParams& params, HTextLayout layout)
208 {

Callers 2

Calls 10

GetFontMapSizeFunction · 0.85
GetFontMapMonospacedFunction · 0.85
GetFontMapPaddingFunction · 0.85
TextToCodePointsFunction · 0.85
TextLayoutCreateFunction · 0.85
GetFontCollectionFunction · 0.85
TextLayoutReleaseFunction · 0.85
EmptyMethod · 0.45
BeginMethod · 0.45
SizeMethod · 0.45

Tested by

no test coverage detected