diff --git a/include/ui/EGLUtils.h b/include/ui/EGLUtils.h deleted file mode 100644 index a5bff8123..000000000 --- a/include/ui/EGLUtils.h +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright (C) 2009 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -#ifndef ANDROID_UI_EGLUTILS_H -#define ANDROID_UI_EGLUTILS_H - -#include -#include -#include - - -// ---------------------------------------------------------------------------- -namespace android { -// ---------------------------------------------------------------------------- - -class EGLUtils -{ -public: - - static const char *strerror(EGLint err); - - static status_t selectConfigForPixelFormat( - EGLDisplay dpy, - EGLint const* attrs, - PixelFormat format, - EGLConfig* outConfig); - - static status_t selectConfigForNativeWindow( - EGLDisplay dpy, - EGLint const* attrs, - EGLNativeWindowType window, - EGLConfig* outConfig); -}; - -// ---------------------------------------------------------------------------- -}; // namespace android -// ---------------------------------------------------------------------------- - -#endif /* ANDROID_UI_EGLUTILS_H */ diff --git a/libs/ui/Android.mk b/libs/ui/Android.mk index c0292915d..5aff7a461 100644 --- a/libs/ui/Android.mk +++ b/libs/ui/Android.mk @@ -16,7 +16,6 @@ LOCAL_PATH:= $(call my-dir) include $(CLEAR_VARS) LOCAL_SRC_FILES:= \ - EGLUtils.cpp \ FramebufferNativeWindow.cpp \ GraphicBuffer.cpp \ GraphicBufferAllocator.cpp \ @@ -28,7 +27,6 @@ LOCAL_SRC_FILES:= \ LOCAL_SHARED_LIBRARIES := \ libcutils \ libutils \ - libEGL \ libhardware ifneq ($(BOARD_FRAMEBUFFER_FORCE_FORMAT),) diff --git a/opengl/tests/angeles/Android.mk b/opengl/tests/angeles/Android.mk index d0c3221cf..84b754b51 100644 --- a/opengl/tests/angeles/Android.mk +++ b/opengl/tests/angeles/Android.mk @@ -4,14 +4,7 @@ LOCAL_PATH:= $(call my-dir) include $(CLEAR_VARS) LOCAL_SRC_FILES:= app-linux.cpp demo.c.arm LOCAL_SHARED_LIBRARIES := libEGL libGLESv1_CM libui +LOCAL_C_INCLUDES += frameworks/base/opengl/tests/include LOCAL_MODULE:= angeles LOCAL_MODULE_TAGS := optional include $(BUILD_EXECUTABLE) - - -include $(CLEAR_VARS) -LOCAL_SRC_FILES:= gpustate.c -LOCAL_SHARED_LIBRARIES := libEGL libGLESv1_CM -LOCAL_MODULE:= gpustate -LOCAL_MODULE_TAGS := optional -include $(BUILD_EXECUTABLE) diff --git a/opengl/tests/angeles/app-linux.cpp b/opengl/tests/angeles/app-linux.cpp index 4d10ee509..6ac68a2ae 100644 --- a/opengl/tests/angeles/app-linux.cpp +++ b/opengl/tests/angeles/app-linux.cpp @@ -53,7 +53,7 @@ #include #include -#include +#include "EGLUtils.h" using namespace android; diff --git a/opengl/tests/angeles/gpustate.c b/opengl/tests/angeles/gpustate.c deleted file mode 100644 index 3c540c9ca..000000000 --- a/opengl/tests/angeles/gpustate.c +++ /dev/null @@ -1,39 +0,0 @@ -#include -#include -#include -#include -#include -#include - -static void *map_memory(const char *fn, unsigned base, unsigned size) -{ - int fd; - void *ptr; - - fd = open(fn, O_RDWR | O_SYNC); - if(fd < 0) { - perror("cannot open %s for mapping"); - return MAP_FAILED; - } - - ptr = mmap(0, size, PROT_READ | PROT_WRITE, - MAP_SHARED, fd, base); - close(fd); - - if(ptr == MAP_FAILED) { - fprintf(stderr,"cannot map %s (@%08x,%08x)\n", fn, base, size); - } - return ptr; -} - - -int main(int argc, char** argv) -{ - void *grp_regs = map_memory("/dev/hw3d", 0, 1024 * 1024); - printf("GPU base mapped at %p\n", grp_regs); - int state_offset = 0x10140; - printf("GPU state = %08lx\n", - *((long*)((char*)grp_regs + state_offset)) ); - - return 0; -} diff --git a/opengl/tests/fillrate/Android.mk b/opengl/tests/fillrate/Android.mk index 191c59b5a..835f858e5 100644 --- a/opengl/tests/fillrate/Android.mk +++ b/opengl/tests/fillrate/Android.mk @@ -11,6 +11,8 @@ LOCAL_SHARED_LIBRARIES := \ libGLESv1_CM \ libui +LOCAL_C_INCLUDES += frameworks/base/opengl/tests/include + LOCAL_MODULE:= test-opengl-fillrate LOCAL_MODULE_TAGS := optional diff --git a/opengl/tests/fillrate/fillrate.cpp b/opengl/tests/fillrate/fillrate.cpp index 911d35469..a708647a9 100644 --- a/opengl/tests/fillrate/fillrate.cpp +++ b/opengl/tests/fillrate/fillrate.cpp @@ -26,7 +26,7 @@ #include #include -#include +#include "EGLUtils.h" using namespace android; diff --git a/opengl/tests/filter/Android.mk b/opengl/tests/filter/Android.mk index a254127e7..d780362b5 100644 --- a/opengl/tests/filter/Android.mk +++ b/opengl/tests/filter/Android.mk @@ -10,6 +10,8 @@ LOCAL_SHARED_LIBRARIES := \ libGLESv1_CM \ libui +LOCAL_C_INCLUDES += frameworks/base/opengl/tests/include + LOCAL_MODULE:= test-opengl-filter LOCAL_MODULE_TAGS := optional diff --git a/opengl/tests/filter/filter.cpp b/opengl/tests/filter/filter.cpp index 235190974..006732755 100644 --- a/opengl/tests/filter/filter.cpp +++ b/opengl/tests/filter/filter.cpp @@ -6,7 +6,7 @@ #include #include -#include +#include "EGLUtils.h" using namespace android; diff --git a/opengl/tests/finish/Android.mk b/opengl/tests/finish/Android.mk index aa607c6a2..8f4f9c399 100644 --- a/opengl/tests/finish/Android.mk +++ b/opengl/tests/finish/Android.mk @@ -11,6 +11,8 @@ LOCAL_SHARED_LIBRARIES := \ libGLESv1_CM \ libui +LOCAL_C_INCLUDES += frameworks/base/opengl/tests/include + LOCAL_MODULE:= test-opengl-finish LOCAL_MODULE_TAGS := optional diff --git a/opengl/tests/finish/finish.cpp b/opengl/tests/finish/finish.cpp index 91f5c45dd..11f0c22c3 100644 --- a/opengl/tests/finish/finish.cpp +++ b/opengl/tests/finish/finish.cpp @@ -27,7 +27,7 @@ #include #include -#include +#include "EGLUtils.h" using namespace android; diff --git a/opengl/tests/gl2_basic/Android.mk b/opengl/tests/gl2_basic/Android.mk index a642eafef..07469a06e 100644 --- a/opengl/tests/gl2_basic/Android.mk +++ b/opengl/tests/gl2_basic/Android.mk @@ -10,6 +10,8 @@ LOCAL_SHARED_LIBRARIES := \ libGLESv2 \ libui +LOCAL_C_INCLUDES += frameworks/base/opengl/tests/include + LOCAL_MODULE:= test-opengl-gl2_basic LOCAL_MODULE_TAGS := optional diff --git a/opengl/tests/gl2_basic/gl2_basic.cpp b/opengl/tests/gl2_basic/gl2_basic.cpp index f274c7c4e..7007871da 100644 --- a/opengl/tests/gl2_basic/gl2_basic.cpp +++ b/opengl/tests/gl2_basic/gl2_basic.cpp @@ -27,7 +27,7 @@ #include #include -#include +#include "EGLUtils.h" using namespace android; diff --git a/opengl/tests/gl2_copyTexImage/Android.mk b/opengl/tests/gl2_copyTexImage/Android.mk index bef1f908b..b6164284a 100644 --- a/opengl/tests/gl2_copyTexImage/Android.mk +++ b/opengl/tests/gl2_copyTexImage/Android.mk @@ -10,6 +10,8 @@ LOCAL_SHARED_LIBRARIES := \ libGLESv2 \ libui +LOCAL_C_INCLUDES += frameworks/base/opengl/tests/include + LOCAL_MODULE:= test-opengl-gl2_copyTexImage LOCAL_MODULE_TAGS := optional diff --git a/opengl/tests/gl2_copyTexImage/gl2_copyTexImage.cpp b/opengl/tests/gl2_copyTexImage/gl2_copyTexImage.cpp index c2bfdecfc..988d7ac0f 100644 --- a/opengl/tests/gl2_copyTexImage/gl2_copyTexImage.cpp +++ b/opengl/tests/gl2_copyTexImage/gl2_copyTexImage.cpp @@ -27,7 +27,7 @@ #include #include -#include +#include "EGLUtils.h" using namespace android; diff --git a/opengl/tests/gl2_yuvtex/Android.mk b/opengl/tests/gl2_yuvtex/Android.mk index 6304700f1..e36f319c5 100644 --- a/opengl/tests/gl2_yuvtex/Android.mk +++ b/opengl/tests/gl2_yuvtex/Android.mk @@ -10,6 +10,8 @@ LOCAL_SHARED_LIBRARIES := \ libGLESv2 \ libui +LOCAL_C_INCLUDES += frameworks/base/opengl/tests/include + LOCAL_MODULE:= test-opengl-gl2_yuvtex LOCAL_MODULE_TAGS := optional diff --git a/opengl/tests/gl2_yuvtex/gl2_yuvtex.cpp b/opengl/tests/gl2_yuvtex/gl2_yuvtex.cpp index f0b8d1259..d3e493263 100644 --- a/opengl/tests/gl2_yuvtex/gl2_yuvtex.cpp +++ b/opengl/tests/gl2_yuvtex/gl2_yuvtex.cpp @@ -29,7 +29,7 @@ #include #include -#include +#include "EGLUtils.h" using namespace android; diff --git a/opengl/tests/gl_basic/Android.mk b/opengl/tests/gl_basic/Android.mk index 6b6341fc3..2ba327bfe 100644 --- a/opengl/tests/gl_basic/Android.mk +++ b/opengl/tests/gl_basic/Android.mk @@ -10,6 +10,8 @@ LOCAL_SHARED_LIBRARIES := \ libGLESv1_CM \ libui +LOCAL_C_INCLUDES += frameworks/base/opengl/tests/include + LOCAL_MODULE:= test-opengl-gl_basic LOCAL_MODULE_TAGS := optional diff --git a/opengl/tests/gl_basic/gl_basic.cpp b/opengl/tests/gl_basic/gl_basic.cpp index 0cc8398a4..23ce93480 100644 --- a/opengl/tests/gl_basic/gl_basic.cpp +++ b/opengl/tests/gl_basic/gl_basic.cpp @@ -6,7 +6,7 @@ #include #include -#include +#include "EGLUtils.h" #include diff --git a/opengl/tests/gl_perf/Android.mk b/opengl/tests/gl_perf/Android.mk index 37647ca68..f32abd3b5 100644 --- a/opengl/tests/gl_perf/Android.mk +++ b/opengl/tests/gl_perf/Android.mk @@ -11,6 +11,8 @@ LOCAL_SHARED_LIBRARIES := \ libGLESv2 \ libui +LOCAL_C_INCLUDES += frameworks/base/opengl/tests/include + LOCAL_MODULE:= test-opengl-gl2_perf LOCAL_MODULE_TAGS := optional diff --git a/opengl/tests/gl_perf/gl2_perf.cpp b/opengl/tests/gl_perf/gl2_perf.cpp index 9dfcf1cc0..224acafa7 100644 --- a/opengl/tests/gl_perf/gl2_perf.cpp +++ b/opengl/tests/gl_perf/gl2_perf.cpp @@ -27,7 +27,7 @@ #include #include -#include +#include "EGLUtils.h" using namespace android; diff --git a/opengl/tests/gl_yuvtex/Android.mk b/opengl/tests/gl_yuvtex/Android.mk index a78db2557..5b87f2ee6 100644 --- a/opengl/tests/gl_yuvtex/Android.mk +++ b/opengl/tests/gl_yuvtex/Android.mk @@ -10,6 +10,8 @@ LOCAL_SHARED_LIBRARIES := \ libGLESv1_CM \ libui +LOCAL_C_INCLUDES += frameworks/base/opengl/tests/include + LOCAL_MODULE:= test-opengl-gl_yuvtex LOCAL_MODULE_TAGS := optional diff --git a/opengl/tests/gl_yuvtex/gl_yuvtex.cpp b/opengl/tests/gl_yuvtex/gl_yuvtex.cpp index fbe65f12e..7a00f76f8 100644 --- a/opengl/tests/gl_yuvtex/gl_yuvtex.cpp +++ b/opengl/tests/gl_yuvtex/gl_yuvtex.cpp @@ -29,7 +29,7 @@ #include #include -#include +#include "EGLUtils.h" using namespace android; diff --git a/opengl/tests/hwc/hwcColorEquiv.cpp b/opengl/tests/hwc/hwcColorEquiv.cpp index 1d039481c..bb305dcaf 100644 --- a/opengl/tests/hwc/hwcColorEquiv.cpp +++ b/opengl/tests/hwc/hwcColorEquiv.cpp @@ -87,7 +87,6 @@ #include #include -#include #define LOG_TAG "hwcColorEquivTest" #include diff --git a/opengl/tests/hwc/hwcCommit.cpp b/opengl/tests/hwc/hwcCommit.cpp index 66ccdae70..685dc5d0b 100644 --- a/opengl/tests/hwc/hwcCommit.cpp +++ b/opengl/tests/hwc/hwcCommit.cpp @@ -98,7 +98,6 @@ #include #include -#include #define LOG_TAG "hwcCommitTest" #include diff --git a/opengl/tests/hwc/hwcRects.cpp b/opengl/tests/hwc/hwcRects.cpp index 523e3dea7..80cde23a7 100644 --- a/opengl/tests/hwc/hwcRects.cpp +++ b/opengl/tests/hwc/hwcRects.cpp @@ -106,7 +106,6 @@ #include #include -#include #define LOG_TAG "hwcRectsTest" #include diff --git a/opengl/tests/hwc/hwcStress.cpp b/opengl/tests/hwc/hwcStress.cpp index 1cefb4b8f..7d7bc1f9c 100644 --- a/opengl/tests/hwc/hwcStress.cpp +++ b/opengl/tests/hwc/hwcStress.cpp @@ -103,7 +103,6 @@ #include #include -#include #define LOG_TAG "hwcStressTest" #include diff --git a/opengl/tests/hwc/hwcTestLib.cpp b/opengl/tests/hwc/hwcTestLib.cpp index 925405e69..63f42bafc 100644 --- a/opengl/tests/hwc/hwcTestLib.cpp +++ b/opengl/tests/hwc/hwcTestLib.cpp @@ -27,6 +27,8 @@ #include +#include "EGLUtils.h" + // Defines #define NUMA(a) (sizeof(a) / sizeof(a [0])) diff --git a/opengl/tests/hwc/hwcTestLib.h b/opengl/tests/hwc/hwcTestLib.h index 99ee60867..b0c301249 100644 --- a/opengl/tests/hwc/hwcTestLib.h +++ b/opengl/tests/hwc/hwcTestLib.h @@ -29,7 +29,6 @@ #include #include -#include #include #include diff --git a/libs/ui/EGLUtils.cpp b/opengl/tests/include/EGLUtils.h similarity index 83% rename from libs/ui/EGLUtils.cpp rename to opengl/tests/include/EGLUtils.h index f24a71d88..014c2611a 100644 --- a/libs/ui/EGLUtils.cpp +++ b/opengl/tests/include/EGLUtils.h @@ -15,21 +15,42 @@ */ -#define LOG_TAG "EGLUtils" +#ifndef ANDROID_UI_EGLUTILS_H +#define ANDROID_UI_EGLUTILS_H -#include +#include +#include + +#include #include - -#include - #include -#include // ---------------------------------------------------------------------------- namespace android { // ---------------------------------------------------------------------------- +class EGLUtils +{ +public: + + static inline const char *strerror(EGLint err); + + static inline status_t selectConfigForPixelFormat( + EGLDisplay dpy, + EGLint const* attrs, + int32_t format, + EGLConfig* outConfig); + + static inline status_t selectConfigForNativeWindow( + EGLDisplay dpy, + EGLint const* attrs, + EGLNativeWindowType window, + EGLConfig* outConfig); +}; + +// ---------------------------------------------------------------------------- + const char *EGLUtils::strerror(EGLint err) { switch (err){ @@ -55,7 +76,7 @@ const char *EGLUtils::strerror(EGLint err) status_t EGLUtils::selectConfigForPixelFormat( EGLDisplay dpy, EGLint const* attrs, - PixelFormat format, + int32_t format, EGLConfig* outConfig) { EGLint numConfigs = -1, n=0; @@ -65,7 +86,7 @@ status_t EGLUtils::selectConfigForPixelFormat( if (outConfig == NULL) return BAD_VALUE; - + // Get all the "potential match" configs... if (eglGetConfigs(dpy, NULL, 0, &numConfigs) == EGL_FALSE) return BAD_VALUE; @@ -75,7 +96,7 @@ status_t EGLUtils::selectConfigForPixelFormat( free(configs); return BAD_VALUE; } - + int i; EGLConfig config = NULL; for (i=0 ; iquery(window, NATIVE_WINDOW_FORMAT, &format)) < 0) { return err; } @@ -119,3 +140,5 @@ status_t EGLUtils::selectConfigForNativeWindow( // ---------------------------------------------------------------------------- }; // namespace android // ---------------------------------------------------------------------------- + +#endif /* ANDROID_UI_EGLUTILS_H */ diff --git a/opengl/tests/include/glTestLib.h b/opengl/tests/include/glTestLib.h index 06fbf5d54..c91c59488 100644 --- a/opengl/tests/include/glTestLib.h +++ b/opengl/tests/include/glTestLib.h @@ -24,9 +24,7 @@ #include #include -//#include -//#include -#include +#include "EGLUtils.h" void glTestPrintGLString(const char *name, GLenum s); void glTestCheckEglError(const char* op, EGLBoolean returnVal = EGL_TRUE); diff --git a/opengl/tests/lib/glTestLib.cpp b/opengl/tests/lib/glTestLib.cpp index 052cbd75c..b434fc7ef 100644 --- a/opengl/tests/lib/glTestLib.cpp +++ b/opengl/tests/lib/glTestLib.cpp @@ -26,7 +26,7 @@ #include #include -#include +#include "EGLUtils.h" #include #include diff --git a/opengl/tests/linetex/Android.mk b/opengl/tests/linetex/Android.mk index 6ff248dcc..261940e4e 100644 --- a/opengl/tests/linetex/Android.mk +++ b/opengl/tests/linetex/Android.mk @@ -10,6 +10,8 @@ LOCAL_SHARED_LIBRARIES := \ libGLESv1_CM \ libui +LOCAL_C_INCLUDES += frameworks/base/opengl/tests/include + LOCAL_MODULE:= test-opengl-linetex LOCAL_MODULE_TAGS := optional diff --git a/opengl/tests/linetex/linetex.cpp b/opengl/tests/linetex/linetex.cpp index 684294094..86694921c 100644 --- a/opengl/tests/linetex/linetex.cpp +++ b/opengl/tests/linetex/linetex.cpp @@ -27,7 +27,7 @@ #include #include -#include +#include "EGLUtils.h" using namespace android; diff --git a/opengl/tests/swapinterval/Android.mk b/opengl/tests/swapinterval/Android.mk index 9a4145eb4..d014cc94d 100644 --- a/opengl/tests/swapinterval/Android.mk +++ b/opengl/tests/swapinterval/Android.mk @@ -11,6 +11,8 @@ LOCAL_SHARED_LIBRARIES := \ libGLESv1_CM \ libui +LOCAL_C_INCLUDES += frameworks/base/opengl/tests/include + LOCAL_MODULE:= test-opengl-swapinterval LOCAL_MODULE_TAGS := optional diff --git a/opengl/tests/swapinterval/swapinterval.cpp b/opengl/tests/swapinterval/swapinterval.cpp index 8ca031bef..a0f4bc466 100644 --- a/opengl/tests/swapinterval/swapinterval.cpp +++ b/opengl/tests/swapinterval/swapinterval.cpp @@ -24,7 +24,7 @@ #include #include -#include +#include "EGLUtils.h" using namespace android; diff --git a/opengl/tests/textures/Android.mk b/opengl/tests/textures/Android.mk index b2fa18557..fe9f43c40 100644 --- a/opengl/tests/textures/Android.mk +++ b/opengl/tests/textures/Android.mk @@ -10,6 +10,8 @@ LOCAL_SHARED_LIBRARIES := \ libGLESv1_CM \ libui +LOCAL_C_INCLUDES += frameworks/base/opengl/tests/include + LOCAL_MODULE:= test-opengl-textures LOCAL_MODULE_TAGS := optional diff --git a/opengl/tests/textures/textures.cpp b/opengl/tests/textures/textures.cpp index cbe8ffddc..5d3d94e7d 100644 --- a/opengl/tests/textures/textures.cpp +++ b/opengl/tests/textures/textures.cpp @@ -23,7 +23,7 @@ #include #include -#include +#include "EGLUtils.h" using namespace android; diff --git a/opengl/tests/tritex/Android.mk b/opengl/tests/tritex/Android.mk index 6db3f49a9..fc544e44c 100644 --- a/opengl/tests/tritex/Android.mk +++ b/opengl/tests/tritex/Android.mk @@ -10,6 +10,8 @@ LOCAL_SHARED_LIBRARIES := \ libGLESv1_CM \ libui +LOCAL_C_INCLUDES += frameworks/base/opengl/tests/include + LOCAL_MODULE:= test-opengl-tritex LOCAL_MODULE_TAGS := optional diff --git a/opengl/tests/tritex/tritex.cpp b/opengl/tests/tritex/tritex.cpp index 3365ab47e..f18348367 100644 --- a/opengl/tests/tritex/tritex.cpp +++ b/opengl/tests/tritex/tritex.cpp @@ -9,7 +9,7 @@ #include #include -#include +#include "EGLUtils.h" #include #include diff --git a/services/surfaceflinger/DisplayHardware/DisplayHardware.cpp b/services/surfaceflinger/DisplayHardware/DisplayHardware.cpp index 986aec576..cea17f878 100644 --- a/services/surfaceflinger/DisplayHardware/DisplayHardware.cpp +++ b/services/surfaceflinger/DisplayHardware/DisplayHardware.cpp @@ -26,7 +26,6 @@ #include #include -#include #include #include @@ -60,6 +59,29 @@ void checkGLErrors() static __attribute__((noinline)) void checkEGLErrors(const char* token) { + struct EGLUtils { + static const char *strerror(EGLint err) { + switch (err){ + case EGL_SUCCESS: return "EGL_SUCCESS"; + case EGL_NOT_INITIALIZED: return "EGL_NOT_INITIALIZED"; + case EGL_BAD_ACCESS: return "EGL_BAD_ACCESS"; + case EGL_BAD_ALLOC: return "EGL_BAD_ALLOC"; + case EGL_BAD_ATTRIBUTE: return "EGL_BAD_ATTRIBUTE"; + case EGL_BAD_CONFIG: return "EGL_BAD_CONFIG"; + case EGL_BAD_CONTEXT: return "EGL_BAD_CONTEXT"; + case EGL_BAD_CURRENT_SURFACE: return "EGL_BAD_CURRENT_SURFACE"; + case EGL_BAD_DISPLAY: return "EGL_BAD_DISPLAY"; + case EGL_BAD_MATCH: return "EGL_BAD_MATCH"; + case EGL_BAD_NATIVE_PIXMAP: return "EGL_BAD_NATIVE_PIXMAP"; + case EGL_BAD_NATIVE_WINDOW: return "EGL_BAD_NATIVE_WINDOW"; + case EGL_BAD_PARAMETER: return "EGL_BAD_PARAMETER"; + case EGL_BAD_SURFACE: return "EGL_BAD_SURFACE"; + case EGL_CONTEXT_LOST: return "EGL_CONTEXT_LOST"; + default: return "UNKNOWN"; + } + } + }; + EGLint error = eglGetError(); if (error && error != EGL_SUCCESS) { ALOGE("%s: EGL error 0x%04x (%s)",