diff options
-rw-r--r-- | opengl/tests/angeles/app-linux.cpp | 4 | ||||
-rw-r--r-- | opengl/tests/copybits/copybits.cpp | 14 | ||||
-rw-r--r-- | opengl/tests/fillrate/fillrate.cpp | 4 | ||||
-rw-r--r-- | opengl/tests/filter/filter.cpp | 6 | ||||
-rw-r--r-- | opengl/tests/finish/finish.cpp | 4 | ||||
-rw-r--r-- | opengl/tests/swapinterval/swapinterval.cpp | 5 | ||||
-rw-r--r-- | opengl/tests/textures/textures.cpp | 4 |
7 files changed, 25 insertions, 16 deletions
diff --git a/opengl/tests/angeles/app-linux.cpp b/opengl/tests/angeles/app-linux.cpp index 9c71693..06fa0c2 100644 --- a/opengl/tests/angeles/app-linux.cpp +++ b/opengl/tests/angeles/app-linux.cpp @@ -133,11 +133,11 @@ static int initGraphics() EGLint w, h; EGLDisplay dpy; + EGLNativeWindowType window = android_createDisplaySurface(); + dpy = eglGetDisplay(EGL_DEFAULT_DISPLAY); eglInitialize(dpy, &majorVersion, &minorVersion); - EGLNativeWindowType window = android_createDisplaySurface(); - status_t err = EGLUtils::selectConfigForNativeWindow( dpy, configAttribs, window, &config); if (err) { diff --git a/opengl/tests/copybits/copybits.cpp b/opengl/tests/copybits/copybits.cpp index f8ca9b2..11dfb6e 100644 --- a/opengl/tests/copybits/copybits.cpp +++ b/opengl/tests/copybits/copybits.cpp @@ -23,6 +23,9 @@ #include <hardware/gralloc.h> #include <hardware/hardware.h> +#include <ui/FramebufferNativeWindow.h> +#include <ui/EGLUtils.h> + #define EGL_EGLEXT_PROTOTYPES #define GL_GLEXT_PROTOTYPES @@ -32,8 +35,6 @@ #include <GLES/gl.h> #include <GLES/glext.h> -extern "C" EGLNativeWindowType android_createDisplaySurface(void); - using namespace android; EGLDisplay eglDisplay; @@ -268,6 +269,8 @@ int init_gl_surface(void) EGL_NONE }; + EGLNativeWindowType window = android_createDisplaySurface(); + printf("init_gl_surface\n"); if ( (eglDisplay = eglGetDisplay(EGL_DEFAULT_DISPLAY)) == EGL_NO_DISPLAY ) { @@ -281,14 +284,15 @@ int init_gl_surface(void) return 0; } - if ( eglChooseConfig(eglDisplay, attrib, &myConfig, 1, &numConfigs) != EGL_TRUE ) + if ( EGLUtils::selectConfigForNativeWindow(eglDisplay, attrib, window, &myConfig) != 0) { - printf("eglChooseConfig failed\n"); + printf("EGLUtils::selectConfigForNativeWindow failed\n"); return 0; } + if ( (eglSurface = eglCreateWindowSurface(eglDisplay, myConfig, - android_createDisplaySurface(), 0)) == EGL_NO_SURFACE ) + window, 0)) == EGL_NO_SURFACE ) { printf("eglCreateWindowSurface failed\n"); return 0; diff --git a/opengl/tests/fillrate/fillrate.cpp b/opengl/tests/fillrate/fillrate.cpp index 4ffbc8b..911d354 100644 --- a/opengl/tests/fillrate/fillrate.cpp +++ b/opengl/tests/fillrate/fillrate.cpp @@ -45,11 +45,11 @@ int main(int argc, char** argv) EGLint w, h; EGLDisplay dpy; + EGLNativeWindowType window = android_createDisplaySurface(); + dpy = eglGetDisplay(EGL_DEFAULT_DISPLAY); eglInitialize(dpy, &majorVersion, &minorVersion); - EGLNativeWindowType window = android_createDisplaySurface(); - status_t err = EGLUtils::selectConfigForNativeWindow( dpy, configAttribs, window, &config); if (err) { diff --git a/opengl/tests/filter/filter.cpp b/opengl/tests/filter/filter.cpp index e82b12d..82aafbf 100644 --- a/opengl/tests/filter/filter.cpp +++ b/opengl/tests/filter/filter.cpp @@ -37,10 +37,14 @@ int main(int argc, char** argv) EGLDisplay dpy; + EGLNativeWindowType window = 0; + if (!usePbuffer) { + window = android_createDisplaySurface(); + } + dpy = eglGetDisplay(EGL_DEFAULT_DISPLAY); eglInitialize(dpy, &majorVersion, &minorVersion); if (!usePbuffer) { - EGLNativeWindowType window = android_createDisplaySurface(); surface = eglCreateWindowSurface(dpy, config, window, NULL); EGLUtils::selectConfigForNativeWindow( dpy, s_configAttribs, window, &config); diff --git a/opengl/tests/finish/finish.cpp b/opengl/tests/finish/finish.cpp index b5b8142..91f5c45 100644 --- a/opengl/tests/finish/finish.cpp +++ b/opengl/tests/finish/finish.cpp @@ -46,11 +46,11 @@ int main(int argc, char** argv) EGLint w, h; EGLDisplay dpy; + EGLNativeWindowType window = android_createDisplaySurface(); + dpy = eglGetDisplay(EGL_DEFAULT_DISPLAY); eglInitialize(dpy, &majorVersion, &minorVersion); - EGLNativeWindowType window = android_createDisplaySurface(); - status_t err = EGLUtils::selectConfigForNativeWindow( dpy, configAttribs, window, &config); if (err) { diff --git a/opengl/tests/swapinterval/swapinterval.cpp b/opengl/tests/swapinterval/swapinterval.cpp index 80a6c21..df53b62 100644 --- a/opengl/tests/swapinterval/swapinterval.cpp +++ b/opengl/tests/swapinterval/swapinterval.cpp @@ -44,12 +44,13 @@ int main(int argc, char** argv) EGLint w, h; EGLDisplay dpy; + + EGLNativeWindowType window = android_createDisplaySurface(); + dpy = eglGetDisplay(EGL_DEFAULT_DISPLAY); eglInitialize(dpy, 0 ,0) ;//&majorVersion, &minorVersion); eglGetConfigs(dpy, NULL, 0, &numConfigs); printf("# configs = %d\n", numConfigs); - - EGLNativeWindowType window = android_createDisplaySurface(); status_t err = EGLUtils::selectConfigForNativeWindow( dpy, configAttribs, window, &config); diff --git a/opengl/tests/textures/textures.cpp b/opengl/tests/textures/textures.cpp index ee92e79..cbe8ffd 100644 --- a/opengl/tests/textures/textures.cpp +++ b/opengl/tests/textures/textures.cpp @@ -42,11 +42,11 @@ int main(int argc, char** argv) EGLint w, h; EGLDisplay dpy; + EGLNativeWindowType window = android_createDisplaySurface(); + dpy = eglGetDisplay(EGL_DEFAULT_DISPLAY); eglInitialize(dpy, &majorVersion, &minorVersion); - EGLNativeWindowType window = android_createDisplaySurface(); - status_t err = EGLUtils::selectConfigForNativeWindow( dpy, configAttribs, window, &config); if (err) { |