0

enter image description here

We are running cobalt with openGL enabled, and the graphics appear to display correctly under 1920x1080 resolution.

But once in a while, some icons in the "Settings" menu may have unexpected vertical lines on top (as shown in the picture).

We are guessing the icons are created from TTF font file, but we are not sure how it is rendering onto the screen.

We want to dump the icons to file at the following points to check what went wrong.

When the icon is actually converted to image. When the icon experience further modification. (eg, color change, bolding, etc) When the icons are rendered onto screen canvas.

Would really appreciate if someone can help to point out where in source code these events may be happening.

Cœur
  • 37,241
  • 25
  • 195
  • 267
Charlie
  • 53
  • 4

1 Answers1

2

I guess the first question is: are you running the stable branch or the experimental branch of Cobalt?

Beyond that, yes, the icons are created from a TTF font file that is downloaded remotely. The icon itself is simply a character that is converted into a glyph, like the text above it, albeit at a much larger size.

I believe that the logic that you're looking for is within RenderText() in cobalt/renderer/rasterizer/skia/render_tree_node_visitor.cc. SkCanvas::drawTextBlob() is passed the glyph and color information that it uses to render the icon.

The specific glyph that is being used looks correct, but the location where the render_tree::GlyphBuffer representing it is created is TextShaper::CreateGlyphBuffer() in cobalt/renderer/rasterizer/skia/text_shaper.cc.

J Gray
  • 46
  • 2