summaryrefslogtreecommitdiffstats
path: root/rs/java
diff options
context:
space:
mode:
authorJason Sams <jsams@google.com>2014-01-15 01:23:50 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2014-01-15 01:23:51 +0000
commitbdc223a7f2b84ecacac0487b48d8005a24739668 (patch)
treea8558e03c63e4be6162b42ebdce065d1a757c599 /rs/java
parent3a43aa9cef79324dd149a47c5a73ce1fa8ed95b3 (diff)
parent9eb8b3ae097bceb13490341c615ffac6e85bdc7d (diff)
downloadframeworks_base-bdc223a7f2b84ecacac0487b48d8005a24739668.zip
frameworks_base-bdc223a7f2b84ecacac0487b48d8005a24739668.tar.gz
frameworks_base-bdc223a7f2b84ecacac0487b48d8005a24739668.tar.bz2
Merge "Check that bound allocations are 1D"
Diffstat (limited to 'rs/java')
-rw-r--r--rs/java/android/renderscript/Script.java7
1 files changed, 7 insertions, 0 deletions
diff --git a/rs/java/android/renderscript/Script.java b/rs/java/android/renderscript/Script.java
index 5ab18f7..a1f2287 100644
--- a/rs/java/android/renderscript/Script.java
+++ b/rs/java/android/renderscript/Script.java
@@ -188,6 +188,13 @@ public class Script extends BaseObj {
public void bindAllocation(Allocation va, int slot) {
mRS.validate();
if (va != null) {
+ if (mRS.getApplicationContext().getApplicationInfo().targetSdkVersion >= 20) {
+ final Type t = va.mType;
+ if (t.hasMipmaps() || t.hasFaces() || (t.getY() != 0) || (t.getZ() != 0)) {
+ throw new RSIllegalArgumentException(
+ "API 20+ only allows simple 1D allocations to be used with bind.");
+ }
+ }
mRS.nScriptBindAllocation(getID(mRS), va.getID(mRS), slot);
} else {
mRS.nScriptBindAllocation(getID(mRS), 0, slot);