ChillingVan / android-openGL-canvas

An Android library that provides views using openGL canvas to draw things on SurfaceView or TextureView.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Ios version

farfromrefug opened this issue · comments

Love the idea of your lib. Actually interested for a chart library that I have already written with Android canvas. The issue is that long lines drawing (around 10000 points) is not that fast. That s why I want to try opengl.
Now I would also need an ios version (same apis) I suppose it does not exist. Would you want to help?
I first need to try your Android version

Hello, in fact after Android 4.0 the canvas in View has been an openGL Canvas. Your performance issue may be caused by too many jobs in onDraw. (10000 vertex in OpenGL should also not be a good practice). The iOS should have a similar mechanism.
You can show your code as a link to see if I can help.
This library is more for the Video rendering.

@ChillingVan actually good to know. I never was sure about this.
You say that 10000 vertices is not a good practice but would you draw very complex lines for example? I use this is a Chart library.
The main issue i have is with iOS though. THere drawing 10000 points line is dead slow with CGContext. here is the code that i use now.
That s why i was thinking about OpenGL.
I might have a go at testing this This would be easy to test with and see how it handles many points.

Thanks for your answer. I will close that issue as you answered my question

@farfromrefug How about draw less points when the screen resolution is not high? I think for current devices screen resolution, no need for hign definition. Downsample the points should be enough for most screen.

@ChillingVan actually a very good idea. Will try that! Just need to find the right formula!