Low FPS with android SurfaceView

不想你离开。 提交于 2019-12-05 17:03:14

If you disable the drawing, how much fps do you achieve ? Just to check how much the display pipeline is hogging.

I had tried following create 5 bitmaps of size 720 x 480 : pix format RGB565 display them on a SurfaceView from a loop similar to yours. The only difference is that I had "prepared bitmaps" and wasn't drawing them in a loop. This is what was achieved on a Nexus-S phone

FPS : 55 (I tried to run the loop as fast, without regulation)

Cpu load : 85%

This is when I decided to render my SurfaceView from JNI :) !!

Do a similar experiment and see how much your device is able to throttle "without" drawing operations. If it looks good, then you can profile whether you can fit-in your your drawing operations within the budget.

Things to consider : How long does you draw routine take?

If you have problems with it running under 30 FPS, I would reconsider having it sleep. This is not an exact thing and could sleep less or more according to the API, so I would remove this for now and let it run as fast as it can.

I agree with above, please post drawing code or comment it out the the call to the draw routine and see what FPS you're running at.

In general, from a sampling stand point you may see it jitter in value if only measuring over 1 seconds.

Many drawing back ends only work in even divisors of 60. So if you were doing a lot of stuff it's possible one or two extra calls will bring you from 60/1 = 60 fps to 60/2 = 30 fps.

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