-
安卓端,Path在触摸move时不断的lineto 绘制会越来越卡,请问可以优化么 |
Beta Was this translation helpful? Give feedback.
Answered by
domchen
Jan 17, 2024
Replies: 1 comment 4 replies
-
petal_hdr_20240116_172843.mp4 |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
你是不是一直在往同一个Path对象上不断累加数据然后每次清屏重画。这样操作无论是什么方案最后都会触发性能临界值。你的还是靠无数的直线在模拟曲线,数据量巨大。这种场景要用起来缓存,不要清屏,每次只生成新增的 Path画上去就行了。要缓存也用Suface.makeImageSnapshot()生成画好的图片缓存,不应该去缓存无限大的矢量数据。