summaryrefslogtreecommitdiffstats
path: root/graphics
diff options
context:
space:
mode:
authorMathias Agopian <mathias@google.com>2011-11-14 11:49:42 -0800
committerAndroid (Google) Code Review <android-gerrit@google.com>2011-11-14 11:49:42 -0800
commitc93a151fde7d616c22b86ae458b3d015e3820d5e (patch)
tree1637c0bf5c8e8b4457393532214238209e810620 /graphics
parentcde433c5f75fd4ac2ab31e9fc34654750d1e83f8 (diff)
parentb89d88f531ee39927f8f554baaae5ecc9101ba9d (diff)
downloadframeworks_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.java14
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();