Add Java exceptions to catch RS calls with no context or no surface.

This commit is contained in:
Jason Sams
2009-12-07 12:40:12 -08:00
parent 6d42d80653
commit 771bebb940
11 changed files with 71 additions and 0 deletions

View File

@ -242,6 +242,18 @@ public class RenderScript {
}
}
void validate() {
if (mContext == 0) {
throw new IllegalStateException("Calling RS with no Context active.");
}
}
void validateSurface() {
if (mSurface == null) {
throw new IllegalStateException("Uploading data to GL with no surface.");
}
}
public void contextSetPriority(Priority p) {
nContextSetPriority(p.mID);
}