MCPcopy Create free account
hub / github.com/Snapchat/Valdi / TextLayoutLongTextSingleLine

Function TextLayoutLongTextSingleLine

snap_drawing/src/benchmark/main.cpp:38–53  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

36 });
37}
38
39static void TextLayoutLongTextSingleLine(benchmark::State& state) {
40 doBenchmark(state, [&](const auto& fontManager) {
41 auto font = fontManager->getDefaultFont().moveValue();
42
43 TextLayoutBuilder builder(
44 TextAlignLeft, TextOverflowEllipsis, Size::make(50000, 5000), 0, fontManager, false, 1.0f);
45
46 builder.append("Hello World! This string might be pretty long, and because of that we will have to lay it out "
47 "on multiple lines",
48 font,
49 TextLayoutLineHeight::multiple(1.0f),
50 0.0f,
51 TextDecorationNone);
52
53 benchmark::DoNotOptimize(builder.build());
54 });
55}
56

Callers

nothing calls this directly

Calls 4

doBenchmarkFunction · 0.85
getDefaultFontMethod · 0.80
appendMethod · 0.65
buildMethod · 0.45

Tested by

no test coverage detected