Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AndroidCanvasHelper canvas/bitmap开启硬件加速 #103

Open
kolyneh opened this issue Dec 13, 2021 · 1 comment
Open

AndroidCanvasHelper canvas/bitmap开启硬件加速 #103

kolyneh opened this issue Dec 13, 2021 · 1 comment

Comments

@kolyneh
Copy link

kolyneh commented Dec 13, 2021

在视频播放器上叠加画板,使用 AndroidCanvasHelper来画path,没有纯View使用canvas画path那么跟手,跟踪发现canvas.isHardwareAccelerated是false。
是否是与硬件加速有关?或是双线程影响呢。

如果AndroidCanvasHelper需要开启硬件加速,还需要设置bitmap配置为HARDWARE,好像比较麻烦

@ChillingVan
Copy link
Owner

AndroidCanvasHelper只能用软件绘制的,原理是用android自己的Canvas生成一个Bitmap再绘制到TextureView里。就性能上可能没有特别好的优化方式。
可能可以试试用SurfaceView开启硬件加速试试。
又或者单独只用一个View覆盖在上层只做显示处理,绘制完后再单独获取Bitmap来做数据处理或传输

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants