diff options
| author | 2011-03-15 11:39:24 -0700 | |
|---|---|---|
| committer | 2011-03-15 11:39:24 -0700 | |
| commit | 7a4ac6d0ff6f53edfc59d756cbdeeec5750c8ef3 (patch) | |
| tree | 445ba1c3d421649c368af25e7212406a28fd1bbc /opengl | |
| parent | 993b519082ae4c327eec83af5f504e3245755b71 (diff) | |
| parent | 5c0c93a8c49b4053744efb8953b915fa7f0923a5 (diff) | |
Merge "SurfaceTexture: disallow unsupported uses." into honeycomb-mr1
Diffstat (limited to 'opengl')
| -rw-r--r-- | opengl/libs/EGL/egl.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/opengl/libs/EGL/egl.cpp b/opengl/libs/EGL/egl.cpp index 3d5a4d16f6..f4a16509ed 100644 --- a/opengl/libs/EGL/egl.cpp +++ b/opengl/libs/EGL/egl.cpp @@ -1094,6 +1094,16 @@ EGLSurface eglCreateWindowSurface( EGLDisplay dpy, EGLConfig config, EGLConfig iConfig = dp->configs[intptr_t(config)].config; EGLint format; + // for now fail if the window is not a Surface. + int type = -1; + ANativeWindow* anw = reinterpret_cast<ANativeWindow*>(window); + if ((anw->query(window, NATIVE_WINDOW_CONCRETE_TYPE, &type) != 0) || + (type == NATIVE_WINDOW_SURFACE_TEXTURE_CLIENT)) { + LOGE("native window is a SurfaceTextureClient (currently " + "unsupported)"); + return setError(EGL_BAD_NATIVE_WINDOW, EGL_NO_SURFACE); + } + // set the native window's buffers format to match this config if (cnx->egl.eglGetConfigAttrib(iDpy, iConfig, EGL_NATIVE_VISUAL_ID, &format)) { |