| 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 | { |
no test coverage detected