diff options
author | Andy McFadden <fadden@android.com> | 2014-03-05 15:06:53 -0800 |
---|---|---|
committer | Andy McFadden <fadden@android.com> | 2014-03-06 16:46:59 -0800 |
commit | 6ef57d7b368ebbac5f2b27c36a9032fee1cda8b1 (patch) | |
tree | b3d4b6f7b16a28d4759711e1f79c6aa19d033449 /opengl/tests/angeles | |
parent | c0c6a0cd4cc2121ffb61576482758aa542acf215 (diff) | |
download | frameworks_native-6ef57d7b368ebbac5f2b27c36a9032fee1cda8b1.zip frameworks_native-6ef57d7b368ebbac5f2b27c36a9032fee1cda8b1.tar.gz frameworks_native-6ef57d7b368ebbac5f2b27c36a9032fee1cda8b1.tar.bz2 |
Restore old OpenGL tests
These tests call android_createDisplaySurface() to get a
FramebufferNativeWindow that is passed to EGL. This relies on the
existence of the framebuffer HAL, which is not supported on many
recent devices.
This change adds a new "window surface" object that the tests
can use to get a window from SurfaceFlinger instead. All tests
except for the HWC tests now appear to do things.
The HWC tests don't do anything useful, but they no longer depend
on the android_createDisplaySurface() function.
Bug 13323813
Change-Id: I2cbfbacb3452fb658c29e945b0c7ae7c94c1a4ba
Diffstat (limited to 'opengl/tests/angeles')
-rw-r--r-- | opengl/tests/angeles/Android.mk | 3 | ||||
-rw-r--r-- | opengl/tests/angeles/app-linux.cpp | 11 |
2 files changed, 8 insertions, 6 deletions
diff --git a/opengl/tests/angeles/Android.mk b/opengl/tests/angeles/Android.mk index ae4f76d..c78224e 100644 --- a/opengl/tests/angeles/Android.mk +++ b/opengl/tests/angeles/Android.mk @@ -3,7 +3,8 @@ 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_SHARED_LIBRARIES := libEGL libGLESv1_CM libui libgui libutils +LOCAL_STATIC_LIBRARIES += libglTest LOCAL_C_INCLUDES += $(call include-path-for, opengl-tests-includes) LOCAL_MODULE:= angeles LOCAL_MODULE_TAGS := optional diff --git a/opengl/tests/angeles/app-linux.cpp b/opengl/tests/angeles/app-linux.cpp index 6ac68a2..e490351 100644 --- a/opengl/tests/angeles/app-linux.cpp +++ b/opengl/tests/angeles/app-linux.cpp @@ -52,8 +52,8 @@ #include <EGL/egl.h> #include <GLES/gl.h> -#include <ui/FramebufferNativeWindow.h> -#include "EGLUtils.h" +#include <EGLUtils.h> +#include <WindowSurface.h> using namespace android; @@ -118,7 +118,7 @@ static void checkEGLErrors() fprintf(stderr, "EGL Error: 0x%04x\n", (int)error); } -static int initGraphics(unsigned samples) +static int initGraphics(unsigned samples, const WindowSurface& windowSurface) { EGLint configAttribs[] = { EGL_DEPTH_SIZE, 16, @@ -135,7 +135,7 @@ static int initGraphics(unsigned samples) EGLint w, h; EGLDisplay dpy; - EGLNativeWindowType window = android_createDisplaySurface(); + EGLNativeWindowType window = windowSurface.getSurface(); dpy = eglGetDisplay(EGL_DEFAULT_DISPLAY); eglInitialize(dpy, &majorVersion, &minorVersion); @@ -193,7 +193,8 @@ int main(int argc, char *argv[]) printf("Multisample enabled: GL_SAMPLES = %u\n", samples); } - if (!initGraphics(samples)) + WindowSurface windowSurface; + if (!initGraphics(samples, windowSurface)) { fprintf(stderr, "Graphics initialization failed.\n"); return EXIT_FAILURE; |