diff options
author | Mathias Agopian <mathias@google.com> | 2011-11-14 11:49:42 -0800 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2011-11-14 11:49:42 -0800 |
commit | c93a151fde7d616c22b86ae458b3d015e3820d5e (patch) | |
tree | 1637c0bf5c8e8b4457393532214238209e810620 /graphics | |
parent | cde433c5f75fd4ac2ab31e9fc34654750d1e83f8 (diff) | |
parent | b89d88f531ee39927f8f554baaae5ecc9101ba9d (diff) | |
download | frameworks_base-c93a151fde7d616c22b86ae458b3d015e3820d5e.zip frameworks_base-c93a151fde7d616c22b86ae458b3d015e3820d5e.tar.gz frameworks_base-c93a151fde7d616c22b86ae458b3d015e3820d5e.tar.bz2 |
Merge "Define, document, and test the behavior of very large SurfaceTextures" into ics-mr1
Diffstat (limited to 'graphics')
-rw-r--r-- | graphics/java/android/graphics/SurfaceTexture.java | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/graphics/java/android/graphics/SurfaceTexture.java b/graphics/java/android/graphics/SurfaceTexture.java index 29fab11..0521e69 100644 --- a/graphics/java/android/graphics/SurfaceTexture.java +++ b/graphics/java/android/graphics/SurfaceTexture.java @@ -17,6 +17,7 @@ package android.graphics; import java.lang.ref.WeakReference; + import android.os.Handler; import android.os.Looper; import android.os.Message; @@ -141,6 +142,12 @@ public class SurfaceTexture { * android.view.Surface#lockCanvas} is called. For OpenGL ES, the EGLSurface should be * destroyed (via eglDestroySurface), made not-current (via eglMakeCurrent), and then recreated * (via eglCreateWindowSurface) to ensure that the new default size has taken effect. + * + * The width and height parameters must be no greater than the minimum of + * GL_MAX_VIEWPORT_DIMS and GL_MAX_TEXTURE_SIZE (see + * {@link javax.microedition.khronos.opengles.GL10#glGetIntegerv glGetIntegerv}). + * An error due to invalid dimensions might not be reported until + * updateTexImage() is called. */ public void setDefaultBufferSize(int width, int height) { nativeSetDefaultBufferSize(width, height); @@ -152,7 +159,10 @@ public class SurfaceTexture { * implicitly bind its texture to the GL_TEXTURE_EXTERNAL_OES texture target. */ public void updateTexImage() { - nativeUpdateTexImage(); + int err = nativeUpdateTexImage(); + if (err != 0) { + throw new RuntimeException("Error during updateTexImage (see logs)"); + } } /** @@ -258,7 +268,7 @@ public class SurfaceTexture { private native void nativeGetTransformMatrix(float[] mtx); private native long nativeGetTimestamp(); private native void nativeSetDefaultBufferSize(int width, int height); - private native void nativeUpdateTexImage(); + private native int nativeUpdateTexImage(); private native int nativeGetQueuedCount(); private native void nativeRelease(); |