diff options
author | Jamie Gennis <jgennis@google.com> | 2011-03-15 13:01:27 -0700 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2011-03-15 13:01:27 -0700 |
commit | e218208f6aa1f05c691f76a53a8a4d395414978a (patch) | |
tree | d58cb9cb6773e27a769d683805edaba20fe56e6c /opengl/libs/EGL/egl.cpp | |
parent | 8390c7cf6838eb8d63b8e38109751e5c7d13599b (diff) | |
parent | 0ea44ac0deb5cc95d60dd512c3a8f6a1bb69f5d1 (diff) | |
download | frameworks_base-e218208f6aa1f05c691f76a53a8a4d395414978a.zip frameworks_base-e218208f6aa1f05c691f76a53a8a4d395414978a.tar.gz frameworks_base-e218208f6aa1f05c691f76a53a8a4d395414978a.tar.bz2 |
am 0ea44ac0: am 00f47af8: Merge "SurfaceTexture: disallow unsupported uses." into honeycomb-mr1
* commit '0ea44ac0deb5cc95d60dd512c3a8f6a1bb69f5d1':
SurfaceTexture: disallow unsupported uses.
Diffstat (limited to 'opengl/libs/EGL/egl.cpp')
-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 861d7ac..7ce86b3 100644 --- a/opengl/libs/EGL/egl.cpp +++ b/opengl/libs/EGL/egl.cpp @@ -1130,6 +1130,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)) { |