From 6ef57d7b368ebbac5f2b27c36a9032fee1cda8b1 Mon Sep 17 00:00:00 2001 From: Andy McFadden Date: Wed, 5 Mar 2014 15:06:53 -0800 Subject: 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 --- opengl/tests/gl_basic/gl_basic.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'opengl/tests/gl_basic/gl_basic.cpp') diff --git a/opengl/tests/gl_basic/gl_basic.cpp b/opengl/tests/gl_basic/gl_basic.cpp index 23ce934..e50d88f 100644 --- a/opengl/tests/gl_basic/gl_basic.cpp +++ b/opengl/tests/gl_basic/gl_basic.cpp @@ -5,8 +5,8 @@ #include #include -#include -#include "EGLUtils.h" +#include +#include #include @@ -23,7 +23,7 @@ GLuint texture; #define FIXED_ONE 0x10000 #define ITERATIONS 50 -int init_gl_surface(void); +int init_gl_surface(const WindowSurface& windowSurface); void free_gl_surface(void); void init_scene(void); void render(); @@ -194,7 +194,8 @@ int main(int argc, char **argv) int q; int start, end; printf("Initializing EGL...\n"); - if(!init_gl_surface()) + WindowSurface windowSurface; + if(!init_gl_surface(windowSurface)) { printf("GL initialisation failed - exiting\n"); return 0; @@ -209,7 +210,7 @@ int main(int argc, char **argv) return 0; } -int init_gl_surface(void) +int init_gl_surface(const WindowSurface& windowSurface) { EGLint numConfigs = 1; EGLConfig myConfig = {0}; @@ -236,7 +237,7 @@ int init_gl_surface(void) return 0; } - EGLNativeWindowType window = android_createDisplaySurface(); + EGLNativeWindowType window = windowSurface.getSurface(); EGLUtils::selectConfigForNativeWindow(eglDisplay, attrib, window, &myConfig); if ( (eglSurface = eglCreateWindowSurface(eglDisplay, myConfig, -- cgit v1.1