summaryrefslogtreecommitdiffstats
path: root/graphics
diff options
context:
space:
mode:
authorJamie Gennis <jgennis@google.com>2012-04-06 09:06:28 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2012-04-06 09:06:28 -0700
commit335a6625b6540ad21feaeae3a4f593f86e200019 (patch)
tree9259866ff2153c1818857e80920ebcb4382a6598 /graphics
parentaca9ef4ded2fc4215a8e64036fb170ac334b3f46 (diff)
parent2af3524beb75150d347accc925022daa53b4a789 (diff)
downloadframeworks_base-335a6625b6540ad21feaeae3a4f593f86e200019.zip
frameworks_base-335a6625b6540ad21feaeae3a4f593f86e200019.tar.gz
frameworks_base-335a6625b6540ad21feaeae3a4f593f86e200019.tar.bz2
Merge changes Iac9cc917,I8eed4b0d
* changes: TextureView: add setSurfaceTexture method SurfaceTexture: add GL context attach & detach
Diffstat (limited to 'graphics')
-rw-r--r--graphics/java/android/graphics/SurfaceTexture.java28
1 files changed, 27 insertions, 1 deletions
diff --git a/graphics/java/android/graphics/SurfaceTexture.java b/graphics/java/android/graphics/SurfaceTexture.java
index 0521e69..e101581 100644
--- a/graphics/java/android/graphics/SurfaceTexture.java
+++ b/graphics/java/android/graphics/SurfaceTexture.java
@@ -161,7 +161,31 @@ public class SurfaceTexture {
public void updateTexImage() {
int err = nativeUpdateTexImage();
if (err != 0) {
- throw new RuntimeException("Error during updateTexImage (see logs)");
+ throw new RuntimeException("Error during updateTexImage (see logcat for details)");
+ }
+ }
+
+ /**
+ * Detach the SurfaceTexture from the OpenGL ES context with which it is currently associated.
+ * This can be used to change from one OpenGL ES context to another.
+ *
+ * @hide
+ */
+ public void detachFromGLContext() {
+ int err = nativeDetachFromGLContext();
+ if (err != 0) {
+ throw new RuntimeException("Error during detachFromGLContext (see logcat for details)");
+ }
+ }
+
+ /**
+ *
+ * @hide
+ */
+ public void attachToGLContext(int texName) {
+ int err = nativeAttachToGLContext(texName);
+ if (err != 0) {
+ throw new RuntimeException("Error during detachFromGLContext (see logcat for details)");
}
}
@@ -269,6 +293,8 @@ public class SurfaceTexture {
private native long nativeGetTimestamp();
private native void nativeSetDefaultBufferSize(int width, int height);
private native int nativeUpdateTexImage();
+ private native int nativeDetachFromGLContext();
+ private native int nativeAttachToGLContext(int texName);
private native int nativeGetQueuedCount();
private native void nativeRelease();