GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
Already on GitHub? Sign in to your account
I added to SkiaSample is another test. Called him TestTextBox. In principle, it repeats the same test to Windows, but somewhat simpler. I want to create two text boxes.One of them occupies half the screen vertically, the second - quarter of the screen. That is, there is room for navigation buttons. Areas have a different background colors, to distinguish them:
void TextBoxDemo::drawTest(SkCanvas* canvas, SkScalar w, SkScalar h, SkColor fg, SkColor bg)
SkAutoCanvasRestore acr(canvas, true);
SkScalar margin = 20;
w - margin, h - margin);
textBox_.setText(gText, strlen(gText), textPaint_);
for (int i = 16; i < 24; i += 2)
canvas->translate(0, textBox_.getTextHeight() + textPaint_.getFontSpacing());
SkScalar width = w_;
drawTest(canvas, width, h_/2, SK_ColorBLACK, SK_ColorLTGRAY);
drawTest(canvas, width, h_/4, SK_ColorRED, SK_ColorBLACK);
In that case, if the option #define USE_SKIA_OPENGL 1 is selected, then for the first time after the selection test you may seen two areas, but then the second area disappears. And along with the navigation buttons. It only remains to close the application and stop the experiment. If the option #define USE_SKIA_OPENGL 0 is selected, you can see two text boxes, but the screen is starts to blinking. Conclusion. If you draw one text box size 3/4 screen, it's no problems . After a few tests I've come to the conclusion that the error occurs when the number of displayed text box objects exceeds unity. In short at the moment, you can use a one text box. Is that true?
We do not use the SkTextBox class internally (we do not even build it). Therefore, I am not sure why you're only able to use one text box. I will investigate when I get some spare time and get back to you.
Thank you for reply. I hope the problem can be solved. Good luck.