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

Function TestLayout

engine/font/src/test/test_font.cpp:83–100  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

81}
82
83static TextResult TestLayout(HFontCollection coll, dmArray<uint32_t>& codepoints,
84 TextLayoutSettings* settings,
85 HTextLayout* layout)
86{
87 uint64_t tstart = dmTime::GetMonotonicTime();
88
89 uint32_t* pc = codepoints.Begin();
90 uint32_t num_codepoints = codepoints.Size();
91 TextResult r = TextLayoutCreate(coll, pc, num_codepoints, settings, layout);
92
93 uint64_t tend = dmTime::GetMonotonicTime();
94 if (*layout)
95 {
96 printf("Layout %u codepoints into %u glyphs took %.3f ms\n", codepoints.Size(), (*layout)->m_Glyphs.Size(), (tend-tstart)/1000.0f);
97 }
98
99 return r;
100}
101
102static void DebugPrintLayout(HTextLayout layout)
103{

Callers 1

TEST_FFunction · 0.85

Calls 4

TextLayoutCreateFunction · 0.85
GetMonotonicTimeFunction · 0.50
BeginMethod · 0.45
SizeMethod · 0.45

Tested by

no test coverage detected