Android graphics performance?

In my opinion, I have a simple ARGB resource that takes about 2 ms, but I can draw the same file as a bitmap under 0.5 ms (just some kind of quick code, I can not consider it an option) . What are the best ways to optimize your drawing speed?

0
source share
1 answer

This will depend on the number of items displayed and the number of times each drawing. For a small number, use canvas (the exact number will also depend on the device), I would suggest using Canvas , as this is a good higher level approach to drawing.

If you want to pull out a lot of images (think hundreds), I would suggest creating GLSurfaceView and using openGL to render your images using VBOs adapted to your application. I would also recommend using a texture sheet if you go down this route, since you will get a huge increase in performance due to the complexity of the code.

But it will also depend on the type of application. My experience is in game development, so I use openGL exclusively for better performance. for a simple application (something like androidify strings) The canvas should be perfect. If you need a simple tutorial for openGL, I suggest visiting the Bergman series of publications on this topic (for this you need to specify a google link). This is a good entry for openGL.

+1
source

Source: https://habr.com/ru/post/904044/


All Articles