diff options
| author | 2012-03-05 08:29:57 -0800 | |
|---|---|---|
| committer | 2012-03-05 08:29:57 -0800 | |
| commit | e7de7258edf8eab68172e1dcd0d7984e5849dc08 (patch) | |
| tree | 2afdae242545e21badfccd47e215bc139c8341c2 | |
| parent | eb00769e8983a02397db26a5413147a975b47c1f (diff) | |
| parent | eb8b1fe91faa6ecaf1fb119bd557f96bde9f6bbc (diff) | |
Merge "Using surface texture as a default renderscript surface."
| -rw-r--r-- | libs/rs/driver/rsdGL.cpp | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/libs/rs/driver/rsdGL.cpp b/libs/rs/driver/rsdGL.cpp index 1b12235248c9..5103878a2e29 100644 --- a/libs/rs/driver/rsdGL.cpp +++ b/libs/rs/driver/rsdGL.cpp @@ -41,6 +41,8 @@ #include "rsdVertexArray.h" #include "rsdFrameBufferObj.h" +#include <gui/SurfaceTextureClient.h> + using namespace android; using namespace android::renderscript; @@ -299,14 +301,15 @@ bool rsdGLInit(const Context *rsc) { } gGLContextCount++; + sp<SurfaceTexture> st(new SurfaceTexture(123)); + sp<SurfaceTextureClient> stc(new SurfaceTextureClient(st)); + dc->gl.egl.surfaceDefault = eglCreateWindowSurface(dc->gl.egl.display, dc->gl.egl.config, + static_cast<ANativeWindow*>(stc.get()), + NULL); - EGLint pbuffer_attribs[] = { EGL_WIDTH, 1, EGL_HEIGHT, 1, EGL_NONE }; - rsc->setWatchdogGL("eglCreatePbufferSurface", __LINE__, __FILE__); - dc->gl.egl.surfaceDefault = eglCreatePbufferSurface(dc->gl.egl.display, dc->gl.egl.config, - pbuffer_attribs); - checkEglError("eglCreatePbufferSurface"); + checkEglError("eglCreateWindowSurface"); if (dc->gl.egl.surfaceDefault == EGL_NO_SURFACE) { - ALOGE("eglCreatePbufferSurface returned EGL_NO_SURFACE"); + ALOGE("eglCreateWindowSurface returned EGL_NO_SURFACE"); rsdGLShutdown(rsc); rsc->setWatchdogGL(NULL, 0, NULL); return false; |