diff options
author | Romain Guy <romainguy@google.com> | 2011-08-24 17:06:58 -0700 |
---|---|---|
committer | Romain Guy <romainguy@google.com> | 2011-08-24 17:06:58 -0700 |
commit | 407ec78b828173257b0c5dae221649a4ccd8b058 (patch) | |
tree | 3890ba718151c345ce5c87a8d252e0445d790dc3 /opengl/java | |
parent | 631582f7f7a3c879a5fba81f2bc082e4826758aa (diff) | |
download | frameworks_base-407ec78b828173257b0c5dae221649a4ccd8b058.zip frameworks_base-407ec78b828173257b0c5dae221649a4ccd8b058.tar.gz frameworks_base-407ec78b828173257b0c5dae221649a4ccd8b058.tar.bz2 |
Add OpenGL backend to ImageWallpaper
Bug #5204874
Currently disabled.
Change-Id: I5e7b35dce2981b0691f107e39c6394b260466543
Diffstat (limited to 'opengl/java')
-rw-r--r-- | opengl/java/android/opengl/GLUtils.java | 49 |
1 files changed, 48 insertions, 1 deletions
diff --git a/opengl/java/android/opengl/GLUtils.java b/opengl/java/android/opengl/GLUtils.java index f30a4cd..125c56e 100644 --- a/opengl/java/android/opengl/GLUtils.java +++ b/opengl/java/android/opengl/GLUtils.java @@ -16,9 +16,11 @@ package android.opengl; -import javax.microedition.khronos.opengles.GL10; import android.graphics.Bitmap; +import javax.microedition.khronos.egl.EGL10; +import javax.microedition.khronos.egl.EGL11; + /** * * Utility class to help bridging OpenGL ES and Android APIs. @@ -222,6 +224,51 @@ public final class GLUtils { } } + /** + * Return a string for the EGL error code, or the hex representation + * if the error is unknown. + * + * @param error The EGL error to convert into a String. + * + * @return An error string corresponding to the EGL error code. + */ + public static String getEGLErrorString(int error) { + switch (error) { + case EGL10.EGL_SUCCESS: + return "EGL_SUCCESS"; + case EGL10.EGL_NOT_INITIALIZED: + return "EGL_NOT_INITIALIZED"; + case EGL10.EGL_BAD_ACCESS: + return "EGL_BAD_ACCESS"; + case EGL10.EGL_BAD_ALLOC: + return "EGL_BAD_ALLOC"; + case EGL10.EGL_BAD_ATTRIBUTE: + return "EGL_BAD_ATTRIBUTE"; + case EGL10.EGL_BAD_CONFIG: + return "EGL_BAD_CONFIG"; + case EGL10.EGL_BAD_CONTEXT: + return "EGL_BAD_CONTEXT"; + case EGL10.EGL_BAD_CURRENT_SURFACE: + return "EGL_BAD_CURRENT_SURFACE"; + case EGL10.EGL_BAD_DISPLAY: + return "EGL_BAD_DISPLAY"; + case EGL10.EGL_BAD_MATCH: + return "EGL_BAD_MATCH"; + case EGL10.EGL_BAD_NATIVE_PIXMAP: + return "EGL_BAD_NATIVE_PIXMAP"; + case EGL10.EGL_BAD_NATIVE_WINDOW: + return "EGL_BAD_NATIVE_WINDOW"; + case EGL10.EGL_BAD_PARAMETER: + return "EGL_BAD_PARAMETER"; + case EGL10.EGL_BAD_SURFACE: + return "EGL_BAD_SURFACE"; + case EGL11.EGL_CONTEXT_LOST: + return "EGL_CONTEXT_LOST"; + default: + return "0x" + Integer.toHexString(error); + } + } + native private static void nativeClassInit(); native private static int native_getInternalFormat(Bitmap bitmap); |