Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How many Android devices support GLSurfaceView.setPreserveEGLContextOnPause today?

I don't need the exact number, the percentage would be enough. For example, if I develop an app with 4.0 min SDK version, how can I assure that the context will be preserved? May it depend on the OpenGL-ES version?

I tried to find information about chips with limited EGL context but couldn't find any.

The reason I need to know - I don't want to implement a special cache subsystem which will reload my textures after the app is resumed. I'm ready to drop some devices that don't support preserving the context (if less than 5-7%).

like image 364
Kirill Olenyov Avatar asked Jun 26 '15 08:06

Kirill Olenyov


1 Answers

Seems that OpenGL-ES 2.0 and forward all allow multiple EGL contexts. That is what the GLSurfaceView.GLThreadManager.checkGLESVersion() method assumes. And if you have multiple contexts, it is not necessary to terminate the EGL when pausing, neither release the EGL context when pausing.

Also, from the GLSurfaceView.GLThreadManager source code (around line 1908), we have the following comment, just after the checkGLESVersion() method:

// This check was required for some pre-Android-3.0 hardware. 
// Android 3.0 provides support for hardware-accelerated views, 
// therefore multiple EGL contexts are supported on all Android 3.0+ EGL drivers.

See more details at Grepcode GLSurfaceView.GLThreadManager.

like image 140
Alex Byrth Avatar answered Oct 12 '22 05:10

Alex Byrth