Hello,
I am currently using Skia in combination with Vulkan, and noticed that when rendering text, the rendered glyph have incorrect antialias. I can't reproduce the issue when using software rendering (glyphs look fine).
I have used Renderdoc to examine the shader (decompiled from SPIRV) used to render the text:
void main()
{
mediump vec4 outputColor_Stage0 = vinColor_Stage0;
mediump vec4 texColor = texture(uTextureSampler_0_Stage0, vTextureCoords_Stage0).xxxx;
mediump vec4 outputCoverage_Stage0 = texColor;
sk_FragColor = outputColor_Stage0 * outputCoverage_Stage0;
}
This seems wrong to me. The atlas image is single channel, which as far i understand, is intended to be used only in the alpha component for the final color, but in the above shader it also used in the color components. When rendering white text upon a white background (in which case the text should be completely invisible) the above shader results in the antialiased parts to be darker. AFAIK, the color component should be whatever the color of the text is supposed to be, and the alpha channel equal to alpha value retrieved from the atlas image.
I'm certain this must be an oversight on my part somewhere, though can't find any setting or value to alter that would fix this.
Here is a screenshot from Renderdoc showing the rendered text, in the bottom bar you can see the value of one of the darker pixels:
I am on the master branch of Skia.
Kind regards,
Florian