MCPcopy Create free account
hub / github.com/android/ndk-samples / _count_rows_cols

Function _count_rows_cols

endless-tunnel/app/src/main/cpp/text_renderer.cpp:58–74  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

56}
57
58static void _count_rows_cols(const char* p, int* outCols, int* outRows) {
59 int textCols = 0, textRows = 1;
60 int curCols = 0;
61 for (; *p; ++p) {
62 if (*p == '\n') {
63 ++textRows;
64 curCols = 0;
65 } else {
66 ++curCols;
67 if (textCols < curCols) {
68 textCols = curCols;
69 }
70 }
71 }
72 *outCols = textCols;
73 *outRows = textRows;
74}
75
76TextRenderer* TextRenderer::SetMatrix(glm::mat4 m) {
77 mMatrix = m;

Callers 2

MeasureTextMethod · 0.85
RenderTextMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected