Skip to content
Discussion options

You must be logged in to vote

这个特性叫做边缘抗锯齿,边缘会有一像素的透明度过渡起到平滑的作用。使用Skia绘制也是这个表现,包括浏览器里。你可以构造一个SVG拼接的图放到浏览器里就可以观察到了。关闭边缘抗锯齿或者使用别的抗锯齿功能才能解决。通常做法是使用MSAA抗锯齿,但是占用内存会更高,各个平台的硬件支持也有一些问题,Intel集成显卡的情况都无法使用。Figma里实现了完美的抗锯齿且没有接缝的模式。他们是直接绘制两倍大的分辨率后缩小的方式实现的,就是最朴素的抗锯齿方式。MSAA如果在硬件支持的情况下会比这种方式更快,你可以根据需要支持的平台一个个测试下性能,看采用哪种抗锯齿能力。tgfx里的开启MSAA就是创建Surface的时候把sampleCount指定为4即可。

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by domchen
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #1068 on November 28, 2025 01:02.