diff --git a/include/ui/EGLUtils.h b/include/ui/EGLUtils.h deleted file mode 100644 index a5bff812399b1..0000000000000 --- 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/rs/driver/rsdGL.cpp b/libs/rs/driver/rsdGL.cpp index b136cc7d767cc..7c66857399d6c 100644 --- a/libs/rs/driver/rsdGL.cpp +++ b/libs/rs/driver/rsdGL.cpp @@ -16,7 +16,6 @@ #include #include -#include #include #include @@ -47,6 +46,29 @@ using namespace android::renderscript; static int32_t gGLContextCount = 0; static void checkEglError(const char* op, EGLBoolean returnVal = EGL_TRUE) { + 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"; + } + } + }; + if (returnVal != EGL_TRUE) { fprintf(stderr, "%s() returned %d\n", op, returnVal); } diff --git a/libs/ui/Android.mk b/libs/ui/Android.mk index c0292915db423..5aff7a461442a 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 d0c3221cfba4f..84b754b515c8f 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 4d10ee509924c..6ac68a2aee459 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 3c540c9ca5fd1..0000000000000 --- 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 191c59b5abb3e..835f858e53162 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 911d35469b1e2..a708647a9a550 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 a254127e78468..d780362b5d4ff 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 2351909743b0f..00673275502bd 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 aa607c6a27889..8f4f9c399faa3 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 91f5c45dde8f8..11f0c22c33178 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 a642eafef1991..07469a06ed067 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 f274c7c4ef9a3..7007871dad450 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 bef1f908b1f8d..b6164284a2f6d 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 c2bfdecfca106..988d7ac0ff371 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 6304700f17f91..e36f319c55b15 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 f0b8d1259a2c6..d3e4932634703 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 6b6341fc3581b..2ba327bfe36fa 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 0cc8398a4adae..23ce93480f282 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 37647ca682c9e..f32abd3b5a1ef 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 9dfcf1cc0efe9..224acafa7a998 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 a78db25571f08..5b87f2ee6e72b 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 fbe65f12ed358..7a00f76f845bc 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 1d039481cf2ff..bb305dcafedf1 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 66ccdae709d9c..685dc5d0b85f9 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 523e3dea7875f..80cde23a7a777 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 1cefb4b8ff842..7d7bc1f9cc30d 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 925405e69a267..63f42bafc436d 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 99ee60867da8c..b0c3012491135 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 f24a71d88d9d1..014c2611ae1ff 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 06fbf5d54920f..c91c5948828b2 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 052cbd75cfd3d..b434fc7efa02c 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 6ff248dcce34e..261940e4eb406 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 68429409403b5..86694921c308d 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 9a4145eb4874d..d014cc94dbc08 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 8ca031bef5d21..a0f4bc4663e52 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 b2fa18557744b..fe9f43c406ff8 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 cbe8ffddc9418..5d3d94e7dab92 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 6db3f49a99e13..fc544e44c9d39 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 3365ab47ef47e..f18348367d265 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 986aec576a0f4..cea17f878b8ac 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)",