summaryrefslogtreecommitdiffstats
path: root/opengl/java/android
diff options
context:
space:
mode:
authorJack Palevich <jackpal@google.com>2011-02-02 21:16:53 -0800
committerJack Palevich <jackpal@google.com>2011-02-02 21:16:53 -0800
commit5f89f510f327228d4ba2261aff7e8faa7d3715aa (patch)
tree8f94af6ab17533e3c424b6ed1188190a93c17843 /opengl/java/android
parent944170f2cf3456a9885e998516120f053e2496d1 (diff)
downloadframeworks_base-5f89f510f327228d4ba2261aff7e8faa7d3715aa.zip
frameworks_base-5f89f510f327228d4ba2261aff7e8faa7d3715aa.tar.gz
frameworks_base-5f89f510f327228d4ba2261aff7e8faa7d3715aa.tar.bz2
Throw an exception when trying to upload a recycled bitmap.
Previously we would upload garbage. Change-Id: Id785792a16f9d24685687f4e6b64ec893ccad225
Diffstat (limited to 'opengl/java/android')
-rw-r--r--opengl/java/android/opengl/GLUtils.java3
1 files changed, 3 insertions, 0 deletions
diff --git a/opengl/java/android/opengl/GLUtils.java b/opengl/java/android/opengl/GLUtils.java
index e150c19..2f17072 100644
--- a/opengl/java/android/opengl/GLUtils.java
+++ b/opengl/java/android/opengl/GLUtils.java
@@ -142,6 +142,9 @@ public final class GLUtils {
if (bitmap == null) {
throw new NullPointerException("texImage2D can't be used with a null Bitmap");
}
+ if (bitmap.isRecycled()) {
+ throw new IllegalArgumentException("bitmap is recycled");
+ }
if (native_texImage2D(target, level, -1, bitmap, -1, border)!=0) {
throw new IllegalArgumentException("invalid Bitmap format");
}