summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Mathias Agopian <mathias@google.com> 2012-02-24 16:42:46 -0800
committer Mathias Agopian <mathias@google.com> 2012-02-24 16:42:46 -0800
commitcc0eaa6582563f51c98db1b232200ac4d2a9a996 (patch)
tree68fcede9c118f7a72de79d0402e92c97b4edfaf3
parent7b49b4bea8090bb8e5015225eb05686d3676205c (diff)
remove libui dependency on libEGL
Change-Id: I1194f04085637d5c384e134967249430cc43b6ee
-rw-r--r--include/ui/EGLUtils.h53
-rw-r--r--libs/rs/driver/rsdGL.cpp24
-rw-r--r--libs/ui/Android.mk2
-rw-r--r--opengl/tests/angeles/Android.mk9
-rw-r--r--opengl/tests/angeles/app-linux.cpp2
-rw-r--r--opengl/tests/angeles/gpustate.c39
-rw-r--r--opengl/tests/fillrate/Android.mk2
-rw-r--r--opengl/tests/fillrate/fillrate.cpp2
-rw-r--r--opengl/tests/filter/Android.mk2
-rw-r--r--opengl/tests/filter/filter.cpp2
-rw-r--r--opengl/tests/finish/Android.mk2
-rw-r--r--opengl/tests/finish/finish.cpp2
-rw-r--r--opengl/tests/gl2_basic/Android.mk2
-rw-r--r--opengl/tests/gl2_basic/gl2_basic.cpp2
-rw-r--r--opengl/tests/gl2_copyTexImage/Android.mk2
-rw-r--r--opengl/tests/gl2_copyTexImage/gl2_copyTexImage.cpp2
-rw-r--r--opengl/tests/gl2_yuvtex/Android.mk2
-rw-r--r--opengl/tests/gl2_yuvtex/gl2_yuvtex.cpp2
-rw-r--r--opengl/tests/gl_basic/Android.mk2
-rw-r--r--opengl/tests/gl_basic/gl_basic.cpp2
-rw-r--r--opengl/tests/gl_perf/Android.mk2
-rw-r--r--opengl/tests/gl_perf/gl2_perf.cpp2
-rw-r--r--opengl/tests/gl_yuvtex/Android.mk2
-rw-r--r--opengl/tests/gl_yuvtex/gl_yuvtex.cpp2
-rw-r--r--opengl/tests/hwc/hwcColorEquiv.cpp1
-rw-r--r--opengl/tests/hwc/hwcCommit.cpp1
-rw-r--r--opengl/tests/hwc/hwcRects.cpp1
-rw-r--r--opengl/tests/hwc/hwcStress.cpp1
-rw-r--r--opengl/tests/hwc/hwcTestLib.cpp2
-rw-r--r--opengl/tests/hwc/hwcTestLib.h1
-rw-r--r--opengl/tests/include/EGLUtils.h (renamed from libs/ui/EGLUtils.cpp)47
-rw-r--r--opengl/tests/include/glTestLib.h4
-rw-r--r--opengl/tests/lib/glTestLib.cpp2
-rw-r--r--opengl/tests/linetex/Android.mk2
-rw-r--r--opengl/tests/linetex/linetex.cpp2
-rw-r--r--opengl/tests/swapinterval/Android.mk2
-rw-r--r--opengl/tests/swapinterval/swapinterval.cpp2
-rw-r--r--opengl/tests/textures/Android.mk2
-rw-r--r--opengl/tests/textures/textures.cpp2
-rw-r--r--opengl/tests/tritex/Android.mk2
-rw-r--r--opengl/tests/tritex/tritex.cpp2
-rw-r--r--services/surfaceflinger/DisplayHardware/DisplayHardware.cpp24
42 files changed, 126 insertions, 139 deletions
diff --git a/include/ui/EGLUtils.h b/include/ui/EGLUtils.h
deleted file mode 100644
index a5bff812399b..000000000000
--- 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 <utils/Errors.h>
-#include <ui/PixelFormat.h>
-#include <EGL/egl.h>
-
-
-// ----------------------------------------------------------------------------
-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 b136cc7d767c..7c66857399d6 100644
--- a/libs/rs/driver/rsdGL.cpp
+++ b/libs/rs/driver/rsdGL.cpp
@@ -16,7 +16,6 @@
#include <ui/FramebufferNativeWindow.h>
#include <ui/PixelFormat.h>
-#include <ui/EGLUtils.h>
#include <ui/egl/android_natives.h>
#include <sys/types.h>
@@ -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 c0292915db42..5aff7a461442 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 d0c3221cfba4..84b754b515c8 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 4d10ee509924..6ac68a2aee45 100644
--- a/opengl/tests/angeles/app-linux.cpp
+++ b/opengl/tests/angeles/app-linux.cpp
@@ -53,7 +53,7 @@
#include <GLES/gl.h>
#include <ui/FramebufferNativeWindow.h>
-#include <ui/EGLUtils.h>
+#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 3c540c9ca5fd..000000000000
--- a/opengl/tests/angeles/gpustate.c
+++ /dev/null
@@ -1,39 +0,0 @@
-#include <errno.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <sys/mman.h>
-#include <unistd.h>
-#include <fcntl.h>
-
-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 191c59b5abb3..835f858e5316 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 911d35469b1e..a708647a9a55 100644
--- a/opengl/tests/fillrate/fillrate.cpp
+++ b/opengl/tests/fillrate/fillrate.cpp
@@ -26,7 +26,7 @@
#include <utils/StopWatch.h>
#include <ui/FramebufferNativeWindow.h>
-#include <ui/EGLUtils.h>
+#include "EGLUtils.h"
using namespace android;
diff --git a/opengl/tests/filter/Android.mk b/opengl/tests/filter/Android.mk
index a254127e7846..d780362b5d4f 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 2351909743b0..00673275502b 100644
--- a/opengl/tests/filter/filter.cpp
+++ b/opengl/tests/filter/filter.cpp
@@ -6,7 +6,7 @@
#include <GLES/glext.h>
#include <ui/FramebufferNativeWindow.h>
-#include <ui/EGLUtils.h>
+#include "EGLUtils.h"
using namespace android;
diff --git a/opengl/tests/finish/Android.mk b/opengl/tests/finish/Android.mk
index aa607c6a2788..8f4f9c399faa 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 91f5c45dde8f..11f0c22c3317 100644
--- a/opengl/tests/finish/finish.cpp
+++ b/opengl/tests/finish/finish.cpp
@@ -27,7 +27,7 @@
#include <utils/Timers.h>
#include <ui/FramebufferNativeWindow.h>
-#include <ui/EGLUtils.h>
+#include "EGLUtils.h"
using namespace android;
diff --git a/opengl/tests/gl2_basic/Android.mk b/opengl/tests/gl2_basic/Android.mk
index a642eafef199..07469a06ed06 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 f274c7c4ef9a..7007871dad45 100644
--- a/opengl/tests/gl2_basic/gl2_basic.cpp
+++ b/opengl/tests/gl2_basic/gl2_basic.cpp
@@ -27,7 +27,7 @@
#include <utils/Timers.h>
#include <ui/FramebufferNativeWindow.h>
-#include <ui/EGLUtils.h>
+#include "EGLUtils.h"
using namespace android;
diff --git a/opengl/tests/gl2_copyTexImage/Android.mk b/opengl/tests/gl2_copyTexImage/Android.mk
index bef1f908b1f8..b6164284a2f6 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 c2bfdecfca10..988d7ac0ff37 100644
--- a/opengl/tests/gl2_copyTexImage/gl2_copyTexImage.cpp
+++ b/opengl/tests/gl2_copyTexImage/gl2_copyTexImage.cpp
@@ -27,7 +27,7 @@
#include <utils/Timers.h>
#include <ui/FramebufferNativeWindow.h>
-#include <ui/EGLUtils.h>
+#include "EGLUtils.h"
using namespace android;
diff --git a/opengl/tests/gl2_yuvtex/Android.mk b/opengl/tests/gl2_yuvtex/Android.mk
index 6304700f17f9..e36f319c55b1 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 f0b8d1259a2c..d3e493263470 100644
--- a/opengl/tests/gl2_yuvtex/gl2_yuvtex.cpp
+++ b/opengl/tests/gl2_yuvtex/gl2_yuvtex.cpp
@@ -29,7 +29,7 @@
#include <ui/FramebufferNativeWindow.h>
#include <ui/GraphicBuffer.h>
-#include <ui/EGLUtils.h>
+#include "EGLUtils.h"
using namespace android;
diff --git a/opengl/tests/gl_basic/Android.mk b/opengl/tests/gl_basic/Android.mk
index 6b6341fc3581..2ba327bfe36f 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 0cc8398a4ada..23ce93480f28 100644
--- a/opengl/tests/gl_basic/gl_basic.cpp
+++ b/opengl/tests/gl_basic/gl_basic.cpp
@@ -6,7 +6,7 @@
#include <GLES/glext.h>
#include <ui/FramebufferNativeWindow.h>
-#include <ui/EGLUtils.h>
+#include "EGLUtils.h"
#include <stdio.h>
diff --git a/opengl/tests/gl_perf/Android.mk b/opengl/tests/gl_perf/Android.mk
index 37647ca682c9..f32abd3b5a1e 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 9dfcf1cc0efe..224acafa7a99 100644
--- a/opengl/tests/gl_perf/gl2_perf.cpp
+++ b/opengl/tests/gl_perf/gl2_perf.cpp
@@ -27,7 +27,7 @@
#include <utils/Timers.h>
#include <ui/FramebufferNativeWindow.h>
-#include <ui/EGLUtils.h>
+#include "EGLUtils.h"
using namespace android;
diff --git a/opengl/tests/gl_yuvtex/Android.mk b/opengl/tests/gl_yuvtex/Android.mk
index a78db25571f0..5b87f2ee6e72 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 fbe65f12ed35..7a00f76f845b 100644
--- a/opengl/tests/gl_yuvtex/gl_yuvtex.cpp
+++ b/opengl/tests/gl_yuvtex/gl_yuvtex.cpp
@@ -29,7 +29,7 @@
#include <ui/FramebufferNativeWindow.h>
#include <ui/GraphicBuffer.h>
-#include <ui/EGLUtils.h>
+#include "EGLUtils.h"
using namespace android;
diff --git a/opengl/tests/hwc/hwcColorEquiv.cpp b/opengl/tests/hwc/hwcColorEquiv.cpp
index 1d039481cf2f..bb305dcafedf 100644
--- a/opengl/tests/hwc/hwcColorEquiv.cpp
+++ b/opengl/tests/hwc/hwcColorEquiv.cpp
@@ -87,7 +87,6 @@
#include <ui/FramebufferNativeWindow.h>
#include <ui/GraphicBuffer.h>
-#include <ui/EGLUtils.h>
#define LOG_TAG "hwcColorEquivTest"
#include <utils/Log.h>
diff --git a/opengl/tests/hwc/hwcCommit.cpp b/opengl/tests/hwc/hwcCommit.cpp
index 66ccdae709d9..685dc5d0b85f 100644
--- a/opengl/tests/hwc/hwcCommit.cpp
+++ b/opengl/tests/hwc/hwcCommit.cpp
@@ -98,7 +98,6 @@
#include <ui/FramebufferNativeWindow.h>
#include <ui/GraphicBuffer.h>
-#include <ui/EGLUtils.h>
#define LOG_TAG "hwcCommitTest"
#include <utils/Log.h>
diff --git a/opengl/tests/hwc/hwcRects.cpp b/opengl/tests/hwc/hwcRects.cpp
index 523e3dea7875..80cde23a7a77 100644
--- a/opengl/tests/hwc/hwcRects.cpp
+++ b/opengl/tests/hwc/hwcRects.cpp
@@ -106,7 +106,6 @@
#include <ui/FramebufferNativeWindow.h>
#include <ui/GraphicBuffer.h>
-#include <ui/EGLUtils.h>
#define LOG_TAG "hwcRectsTest"
#include <utils/Log.h>
diff --git a/opengl/tests/hwc/hwcStress.cpp b/opengl/tests/hwc/hwcStress.cpp
index 1cefb4b8ff84..7d7bc1f9cc30 100644
--- a/opengl/tests/hwc/hwcStress.cpp
+++ b/opengl/tests/hwc/hwcStress.cpp
@@ -103,7 +103,6 @@
#include <ui/FramebufferNativeWindow.h>
#include <ui/GraphicBuffer.h>
-#include <ui/EGLUtils.h>
#define LOG_TAG "hwcStressTest"
#include <utils/Log.h>
diff --git a/opengl/tests/hwc/hwcTestLib.cpp b/opengl/tests/hwc/hwcTestLib.cpp
index 925405e69a26..63f42bafc436 100644
--- a/opengl/tests/hwc/hwcTestLib.cpp
+++ b/opengl/tests/hwc/hwcTestLib.cpp
@@ -27,6 +27,8 @@
#include <hwc/hwcTestLib.h>
+#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 99ee60867da8..b0c301249113 100644
--- a/opengl/tests/hwc/hwcTestLib.h
+++ b/opengl/tests/hwc/hwcTestLib.h
@@ -29,7 +29,6 @@
#include <ui/FramebufferNativeWindow.h>
#include <ui/GraphicBuffer.h>
-#include <ui/EGLUtils.h>
#include <utils/Log.h>
#include <testUtil.h>
diff --git a/libs/ui/EGLUtils.cpp b/opengl/tests/include/EGLUtils.h
index f24a71d88d9d..014c2611ae1f 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 <cutils/log.h>
-#include <utils/Errors.h>
-
-#include <ui/EGLUtils.h>
+#include <stdint.h>
+#include <stdlib.h>
+#include <system/window.h>
+#include <utils/Errors.h>
#include <EGL/egl.h>
-#include <private/ui/android_natives_priv.h>
// ----------------------------------------------------------------------------
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 ; i<n ; i++) {
@@ -88,7 +109,7 @@ status_t EGLUtils::selectConfigForPixelFormat(
}
free(configs);
-
+
if (i<n) {
*outConfig = config;
return NO_ERROR;
@@ -105,10 +126,10 @@ status_t EGLUtils::selectConfigForNativeWindow(
{
int err;
int format;
-
+
if (!window)
return BAD_VALUE;
-
+
if ((err = window->query(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 06fbf5d54920..c91c5948828b 100644
--- a/opengl/tests/include/glTestLib.h
+++ b/opengl/tests/include/glTestLib.h
@@ -24,9 +24,7 @@
#include <GLES2/gl2.h>
#include <GLES2/gl2ext.h>
-//#include <ui/FramebufferNativeWindow.h>
-//#include <ui/GraphicBuffer.h>
-#include <ui/EGLUtils.h>
+#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 052cbd75cfd3..b434fc7efa02 100644
--- a/opengl/tests/lib/glTestLib.cpp
+++ b/opengl/tests/lib/glTestLib.cpp
@@ -26,7 +26,7 @@
#include <GLES2/gl2.h>
#include <GLES2/gl2ext.h>
-#include <ui/EGLUtils.h>
+#include "EGLUtils.h"
#include <utils/Log.h>
#include <testUtil.h>
diff --git a/opengl/tests/linetex/Android.mk b/opengl/tests/linetex/Android.mk
index 6ff248dcce34..261940e4eb40 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 68429409403b..86694921c308 100644
--- a/opengl/tests/linetex/linetex.cpp
+++ b/opengl/tests/linetex/linetex.cpp
@@ -27,7 +27,7 @@
#include <utils/StopWatch.h>
#include <ui/FramebufferNativeWindow.h>
-#include <ui/EGLUtils.h>
+#include "EGLUtils.h"
using namespace android;
diff --git a/opengl/tests/swapinterval/Android.mk b/opengl/tests/swapinterval/Android.mk
index 9a4145eb4874..d014cc94dbc0 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 8ca031bef5d2..a0f4bc4663e5 100644
--- a/opengl/tests/swapinterval/swapinterval.cpp
+++ b/opengl/tests/swapinterval/swapinterval.cpp
@@ -24,7 +24,7 @@
#include <utils/StopWatch.h>
#include <ui/FramebufferNativeWindow.h>
-#include <ui/EGLUtils.h>
+#include "EGLUtils.h"
using namespace android;
diff --git a/opengl/tests/textures/Android.mk b/opengl/tests/textures/Android.mk
index b2fa18557744..fe9f43c406ff 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 cbe8ffddc941..5d3d94e7dab9 100644
--- a/opengl/tests/textures/textures.cpp
+++ b/opengl/tests/textures/textures.cpp
@@ -23,7 +23,7 @@
#include <GLES/glext.h>
#include <ui/FramebufferNativeWindow.h>
-#include <ui/EGLUtils.h>
+#include "EGLUtils.h"
using namespace android;
diff --git a/opengl/tests/tritex/Android.mk b/opengl/tests/tritex/Android.mk
index 6db3f49a99e1..fc544e44c9d3 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 3365ab47ef47..f18348367d26 100644
--- a/opengl/tests/tritex/tritex.cpp
+++ b/opengl/tests/tritex/tritex.cpp
@@ -9,7 +9,7 @@
#include <GLES/glext.h>
#include <ui/FramebufferNativeWindow.h>
-#include <ui/EGLUtils.h>
+#include "EGLUtils.h"
#include <stdio.h>
#include <stdlib.h>
diff --git a/services/surfaceflinger/DisplayHardware/DisplayHardware.cpp b/services/surfaceflinger/DisplayHardware/DisplayHardware.cpp
index 986aec576a0f..cea17f878b8a 100644
--- a/services/surfaceflinger/DisplayHardware/DisplayHardware.cpp
+++ b/services/surfaceflinger/DisplayHardware/DisplayHardware.cpp
@@ -26,7 +26,6 @@
#include <ui/PixelFormat.h>
#include <ui/FramebufferNativeWindow.h>
-#include <ui/EGLUtils.h>
#include <GLES/gl.h>
#include <EGL/egl.h>
@@ -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)",