Why “SurfaceView” is slower than a custom “view”?

前提是你 提交于 2019-12-05 11:23:27

I too have experienced a significant FPS increase when switching an application from using SurfaceView to a single View subclass. My belief is that this is due to hardware acceleration.

Switching away from SurfaceView is something I had to do ever since the serious bug with SurfaceView was introduced in Android 4.3. See https://code.google.com/p/android/issues/detail?id=58385. During a discussion about this on the Android Developers mailing list, Romain Guy actually suggested that using a normal View might be faster anyway, due to hardware acceleration. This turned out to be true - at least on devices I'm developing on (HTC One X and the old Nexus 7). It could be true, however, that the graphics are more susceptible to 'choppy' animation. For me, this FPS increase sweetened the initial pain and frustration of having to deal with the SurfaceView bug and refactor my application to not use SurfaceView.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!