summaryrefslogtreecommitdiffstats
path: root/include/gui/SurfaceTexture.h
diff options
context:
space:
mode:
authorJamie Gennis <jgennis@google.com>2011-09-28 12:13:31 -0700
committerJamie Gennis <jgennis@google.com>2011-09-30 14:19:41 -0700
commit8606fefa219d63d0a0f3df1b9dcf49cfbfa5b3e5 (patch)
treeb2d21dc0e83e944c544937be3bbf91e76ae9e875 /include/gui/SurfaceTexture.h
parentce0a7ade96ddbdcb342e0b382e9d3ea43962cafd (diff)
downloadframeworks_base-8606fefa219d63d0a0f3df1b9dcf49cfbfa5b3e5.zip
frameworks_base-8606fefa219d63d0a0f3df1b9dcf49cfbfa5b3e5.tar.gz
frameworks_base-8606fefa219d63d0a0f3df1b9dcf49cfbfa5b3e5.tar.bz2
SurfaceTexture: parameterize the texture target
This change adds a hack to allow Android Browser to use a SurfaceTexture to stream RGBA images to a GL_TEXTURE_2D texture object. Change-Id: Idb90064d5d4b920959ef3be7451362ac5012460e
Diffstat (limited to 'include/gui/SurfaceTexture.h')
-rw-r--r--include/gui/SurfaceTexture.h12
1 files changed, 11 insertions, 1 deletions
diff --git a/include/gui/SurfaceTexture.h b/include/gui/SurfaceTexture.h
index 926eb9a..e2d6179 100644
--- a/include/gui/SurfaceTexture.h
+++ b/include/gui/SurfaceTexture.h
@@ -20,6 +20,7 @@
#include <EGL/egl.h>
#include <EGL/eglext.h>
#include <GLES2/gl2.h>
+#include <GLES2/gl2ext.h>
#include <gui/ISurfaceTexture.h>
@@ -61,7 +62,8 @@ public:
// tex indicates the name OpenGL texture to which images are to be streamed.
// This texture name cannot be changed once the SurfaceTexture is created.
- SurfaceTexture(GLuint tex, bool allowSynchronousMode = true);
+ SurfaceTexture(GLuint tex, bool allowSynchronousMode = true,
+ GLenum texTarget = GL_TEXTURE_EXTERNAL_OES);
virtual ~SurfaceTexture();
@@ -458,6 +460,14 @@ private:
// member variables are accessed.
mutable Mutex mMutex;
+ // mTexTarget is the GL texture target with which the GL texture object is
+ // associated. It is set in the constructor and never changed. It is
+ // almost always GL_TEXTURE_EXTERNAL_OES except for one use case in Android
+ // Browser. In that case it is set to GL_TEXTURE_2D to allow
+ // glCopyTexSubImage to read from the texture. This is a hack to work
+ // around a GL driver limitation on the number of FBO attachments, which the
+ // browser's tile cache exceeds.
+ const GLenum mTexTarget;
};
// ----------------------------------------------------------------------------