summaryrefslogtreecommitdiffstats
path: root/opengl
diff options
context:
space:
mode:
authorJin Zhebin <zhebinx.jin@intel.com>2014-01-21 15:27:20 +0800
committerbdeng3X <bingx.deng@intel.com>2014-04-15 05:11:58 +0800
commit28a5c593577d6aef03d874b42ec0215c88f62bf4 (patch)
treeff7d91c71484ecbcc137d2fe62bc15bf752a3ad5 /opengl
parentc420ce34ba177cd959cbb9432e9597d377e6cee6 (diff)
downloadframeworks_base-28a5c593577d6aef03d874b42ec0215c88f62bf4.zip
frameworks_base-28a5c593577d6aef03d874b42ec0215c88f62bf4.tar.gz
frameworks_base-28a5c593577d6aef03d874b42ec0215c88f62bf4.tar.bz2
EGL_OPENGL_ES3_BIT_KHR is set as ES 3 context is requested.
OpenGL ES have 3 configuration: 1(EGL10.EGL_RENDERABLE_TYPE), 2(EGL_OPENGL_ES2_BIT), 3(EGL_OPENGL_ES3_BIT_KHR). The driver should be get the according configuration parameter. Now 1 is set to driver when Configuration 3 is set from user. Specification EGL_OPENGL_ES3_BIT_KHR is set to driver when a OpenGL ES 3 context is requested in setEGLContextClientVersion(). Change-Id: I980d9d8dbe5754295f8329fcf9378962d669fa89 Signed-off-by: Jin Zhebin <zhebinx.jin@intel.com> Signed-off-by: bdeng3X <bingx.deng@intel.com>
Diffstat (limited to 'opengl')
-rw-r--r--opengl/java/android/opengl/GLSurfaceView.java8
1 files changed, 6 insertions, 2 deletions
diff --git a/opengl/java/android/opengl/GLSurfaceView.java b/opengl/java/android/opengl/GLSurfaceView.java
index 5a2e261..4c024ae 100644
--- a/opengl/java/android/opengl/GLSurfaceView.java
+++ b/opengl/java/android/opengl/GLSurfaceView.java
@@ -882,7 +882,7 @@ public class GLSurfaceView extends SurfaceView implements SurfaceHolder.Callback
protected int[] mConfigSpec;
private int[] filterConfigSpec(int[] configSpec) {
- if (mEGLContextClientVersion != 2) {
+ if (mEGLContextClientVersion != 2 && mEGLContextClientVersion != 3) {
return configSpec;
}
/* We know none of the subclasses define EGL_RENDERABLE_TYPE.
@@ -892,7 +892,11 @@ public class GLSurfaceView extends SurfaceView implements SurfaceHolder.Callback
int[] newConfigSpec = new int[len + 2];
System.arraycopy(configSpec, 0, newConfigSpec, 0, len-1);
newConfigSpec[len-1] = EGL10.EGL_RENDERABLE_TYPE;
- newConfigSpec[len] = 4; /* EGL_OPENGL_ES2_BIT */
+ if (mEGLContextClientVersion == 2) {
+ newConfigSpec[len] = EGL14.EGL_OPENGL_ES2_BIT; /* EGL_OPENGL_ES2_BIT */
+ } else {
+ newConfigSpec[len] = EGLExt.EGL_OPENGL_ES3_BIT_KHR; /* EGL_OPENGL_ES3_BIT_KHR */
+ }
newConfigSpec[len+1] = EGL10.EGL_NONE;
return newConfigSpec;
}