From acf33974b3a870d904e662ae927947460c0d6b3f Mon Sep 17 00:00:00 2001 From: Jamie Gennis Date: Wed, 23 Feb 2011 13:33:46 -0800 Subject: Expand on the SurfaceTexture API docs. This change adds additional documentation explaining how a SurfaceTexture should be used in OpenGL ES. It describes some of the limitations of using the GL_TEXTURE_EXTERNAL_OES texture target. Change-Id: I9d3446a012376166b6c598b827a0aa0e9585d00f --- graphics/java/android/graphics/SurfaceTexture.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/graphics/java/android/graphics/SurfaceTexture.java b/graphics/java/android/graphics/SurfaceTexture.java index 1fc27220af40..712cd1ba3612 100644 --- a/graphics/java/android/graphics/SurfaceTexture.java +++ b/graphics/java/android/graphics/SurfaceTexture.java @@ -44,7 +44,13 @@ import android.os.Message; * be done by transforming (1, 1, 0, 1). * *

The texture object uses the GL_TEXTURE_EXTERNAL_OES texture target, which is defined by the - * OES_EGL_image_external OpenGL ES extension. This limits how the texture may be used. + * {@link http://www.khronos.org/registry/gles/extensions/OES/OES_EGL_image_external.txt + * GL_OES_EGL_image_external} OpenGL ES extension. This limits how the texture may be used. Each + * time the texture is bound it must be bound to the GL_TEXTURE_EXTERNAL_OES target rather than the + * GL_TEXTURE_2D target. Additionally, any OpenGL ES 2.0 shader that samples from the texture must + * declare its use of this extension using, for example, an "#extension GL_OES_EGL_image_external : + * require" directive. Such shaders must also access the texture using the samplerExternalOES GLSL + * sampler type. * *

SurfaceTexture objects may be created on any thread. {@link #updateTexImage} may only be * called on the thread with the OpenGL ES context that contains the texture object. The -- cgit v1.2.3-59-g8ed1b