summaryrefslogtreecommitdiffstats
path: root/opengl
diff options
context:
space:
mode:
authorJamie Gennis <jgennis@google.com>2011-03-15 13:01:27 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2011-03-15 13:01:27 -0700
commite218208f6aa1f05c691f76a53a8a4d395414978a (patch)
treed58cb9cb6773e27a769d683805edaba20fe56e6c /opengl
parent8390c7cf6838eb8d63b8e38109751e5c7d13599b (diff)
parent0ea44ac0deb5cc95d60dd512c3a8f6a1bb69f5d1 (diff)
downloadframeworks_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')
-rw-r--r--opengl/libs/EGL/egl.cpp10
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)) {