summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorRomain Guy <romainguy@google.com>2012-09-24 20:18:13 -0700
committerJean-Baptiste Queru <jbq@google.com>2012-09-25 09:43:23 -0700
commitc002936e4bd042db3024202b3e9696835a730cfa (patch)
tree465c3342969f59cec5bd0bc188a633d9dd2eef01 /core
parentbf2e088b008cdc80059b943c3b144ec982963f4e (diff)
downloadframeworks_base-c002936e4bd042db3024202b3e9696835a730cfa.zip
frameworks_base-c002936e4bd042db3024202b3e9696835a730cfa.tar.gz
frameworks_base-c002936e4bd042db3024202b3e9696835a730cfa.tar.bz2
Trigger the log when EGL_NO_CONTEXT is returned by eglCreateContext
Bug #7216919 Change-Id: If2059227d55e8ddb2d2673ee36029c3c92dd9a3d
Diffstat (limited to 'core')
-rw-r--r--core/java/android/view/HardwareRenderer.java17
1 files changed, 9 insertions, 8 deletions
diff --git a/core/java/android/view/HardwareRenderer.java b/core/java/android/view/HardwareRenderer.java
index 49f9e9d..39deca2 100644
--- a/core/java/android/view/HardwareRenderer.java
+++ b/core/java/android/view/HardwareRenderer.java
@@ -864,12 +864,6 @@ public abstract class HardwareRenderer {
if (mEglContext == null) {
mEglContext = createContext(sEgl, sEglDisplay, sEglConfig);
- if (mEglContext == null) {
- //noinspection ConstantConditions
- throw new IllegalStateException("Could not create an EGL context. " +
- "eglCreateContext failed with error: " +
- GLUtils.getEGLErrorString(sEgl.eglGetError()));
- }
sEglContextStorage.set(createManagedContext(mEglContext));
}
}
@@ -998,8 +992,15 @@ public abstract class HardwareRenderer {
EGLContext createContext(EGL10 egl, EGLDisplay eglDisplay, EGLConfig eglConfig) {
int[] attribs = { EGL_CONTEXT_CLIENT_VERSION, mGlVersion, EGL_NONE };
- return egl.eglCreateContext(eglDisplay, eglConfig, EGL_NO_CONTEXT,
- mGlVersion != 0 ? attribs : null);
+ EGLContext context = egl.eglCreateContext(eglDisplay, eglConfig, EGL_NO_CONTEXT,
+ mGlVersion != 0 ? attribs : null);
+ if (context == null) {
+ //noinspection ConstantConditions
+ throw new IllegalStateException(
+ "Could not create an EGL context. eglCreateContext failed with error: " +
+ GLUtils.getEGLErrorString(sEgl.eglGetError()));
+ }
+ return context;
}
@Override