From 37e40657e2948a4e6788946aad536d0747c89aef Mon Sep 17 00:00:00 2001 From: Eino-Ville Talvala Date: Thu, 1 Sep 2011 18:17:33 -0700 Subject: [PATCH] Replace pBuffer with a SurfaceTexture as default dummy surface. PBuffers may not support needed recording extensions, so the dummy used to create a GL context needs to be replaced. Bug: 4510826 Change-Id: I25f7ec8a8e24ff9feb3d6f5a5a998c6a56018a98 --- mca/filterfw/native/core/gl_env.cpp | 10 ++++++---- mca/filterfw/native/core/gl_env.h | 8 +++++++- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/mca/filterfw/native/core/gl_env.cpp b/mca/filterfw/native/core/gl_env.cpp index a31e900c..b475795f 100644 --- a/mca/filterfw/native/core/gl_env.cpp +++ b/mca/filterfw/native/core/gl_env.cpp @@ -159,10 +159,12 @@ bool GLEnv::InitWithNewContext() { return false; } - // Create dummy surface - EGLint pb_attribs[] = { EGL_WIDTH, 1, EGL_HEIGHT, 1, EGL_NONE }; - surfaces_[0] = SurfaceWindowPair(eglCreatePbufferSurface(display(), config, pb_attribs), NULL); - if (CheckEGLError("eglCreatePbufferSurface")) return false; + // Create dummy surface using a SurfaceTexture + sp st = new SurfaceTexture(0, false); + window_ = new SurfaceTextureClient(st); + + surfaces_[0] = SurfaceWindowPair(eglCreateWindowSurface(display(), config, window_.get(), NULL), NULL); + if (CheckEGLError("eglCreateWindowSurface")) return false; // Create context EGLint context_attribs[] = { EGL_CONTEXT_CLIENT_VERSION, 2, EGL_NONE }; diff --git a/mca/filterfw/native/core/gl_env.h b/mca/filterfw/native/core/gl_env.h index 3ff92cff..587c064e 100644 --- a/mca/filterfw/native/core/gl_env.h +++ b/mca/filterfw/native/core/gl_env.h @@ -27,6 +27,9 @@ #include #include +#include +#include + namespace android { namespace filterfw { @@ -230,7 +233,10 @@ class GLEnv { int context_id_; int surface_id_; - // The maximum suface id used. + // Dummy surface for context + sp window_; + + // The maximum surface id used. int max_surface_id_; // These bools keep track of which objects this GLEnv has created (and -- 2.11.0