summaryrefslogtreecommitdiffstats
path: root/graphics/java/android/renderscript/SimpleMesh.java
diff options
context:
space:
mode:
authorJason Sams <rjsams@android.com>2009-12-07 12:40:12 -0800
committerJason Sams <rjsams@android.com>2009-12-07 12:40:12 -0800
commit771bebb94054d06f97284379c93a2620613513c3 (patch)
tree2339a08eab0862a4e11c162c28a4264afbf2a978 /graphics/java/android/renderscript/SimpleMesh.java
parent6d42d80653f2c41f3e72a878a1d9a6f9693b89f7 (diff)
downloadframeworks_base-771bebb94054d06f97284379c93a2620613513c3.zip
frameworks_base-771bebb94054d06f97284379c93a2620613513c3.tar.gz
frameworks_base-771bebb94054d06f97284379c93a2620613513c3.tar.bz2
Add Java exceptions to catch RS calls with no context or no surface.
Diffstat (limited to 'graphics/java/android/renderscript/SimpleMesh.java')
-rw-r--r--graphics/java/android/renderscript/SimpleMesh.java5
1 files changed, 5 insertions, 0 deletions
diff --git a/graphics/java/android/renderscript/SimpleMesh.java b/graphics/java/android/renderscript/SimpleMesh.java
index 3d10e3b..f45074e 100644
--- a/graphics/java/android/renderscript/SimpleMesh.java
+++ b/graphics/java/android/renderscript/SimpleMesh.java
@@ -35,18 +35,22 @@ public class SimpleMesh extends BaseObj {
}
public void bindVertexAllocation(Allocation a, int slot) {
+ mRS.validate();
mRS.nSimpleMeshBindVertex(mID, a.mID, slot);
}
public void bindIndexAllocation(Allocation a) {
+ mRS.validate();
mRS.nSimpleMeshBindIndex(mID, a.mID);
}
public Allocation createVertexAllocation(int slot) {
+ mRS.validate();
return Allocation.createTyped(mRS, mVertexTypes[slot]);
}
public Allocation createIndexAllocation() {
+ mRS.validate();
return Allocation.createTyped(mRS, mIndexType);
}
@@ -162,6 +166,7 @@ public class SimpleMesh extends BaseObj {
}
public SimpleMesh create() {
+ mRS.validate();
SimpleMesh sm = internalCreate(mRS, this);
sm.mVertexTypes = new Type[mVertexTypeCount];
for(int ct=0; ct < mVertexTypeCount; ct++) {