summaryrefslogtreecommitdiff
path: root/graphics/java/android/renderscript/Script.java
diff options
context:
space:
mode:
authorJason Sams <jsams@google.com>2012-04-03 15:36:36 -0700
committerJason Sams <jsams@google.com>2012-04-03 15:36:36 -0700
commite07694b24f7d12d72b084b6651356681ebd0efd6 (patch)
treee5cbb853579a105f5910c1c6640358e0cf69b5d9 /graphics/java/android/renderscript/Script.java
parent991c8733c3b990b88edf5cf223aebe3d1c71b7f0 (diff)
Validate context when using RS objects.
BUG=6035422 Change-Id: I8586be0085b36767289e1f634111c0ff076cec3c
Diffstat (limited to 'graphics/java/android/renderscript/Script.java')
-rw-r--r--graphics/java/android/renderscript/Script.java32
1 files changed, 16 insertions, 16 deletions
diff --git a/graphics/java/android/renderscript/Script.java b/graphics/java/android/renderscript/Script.java
index d00c428f73a0..4f59ae3c2970 100644
--- a/graphics/java/android/renderscript/Script.java
+++ b/graphics/java/android/renderscript/Script.java
@@ -26,7 +26,7 @@ public class Script extends BaseObj {
* @param slot
*/
protected void invoke(int slot) {
- mRS.nScriptInvoke(getID(), slot);
+ mRS.nScriptInvoke(getID(mRS), slot);
}
/**
@@ -37,9 +37,9 @@ public class Script extends BaseObj {
*/
protected void invoke(int slot, FieldPacker v) {
if (v != null) {
- mRS.nScriptInvokeV(getID(), slot, v.getData());
+ mRS.nScriptInvokeV(getID(mRS), slot, v.getData());
} else {
- mRS.nScriptInvoke(getID(), slot);
+ mRS.nScriptInvoke(getID(mRS), slot);
}
}
@@ -58,17 +58,17 @@ public class Script extends BaseObj {
}
int in_id = 0;
if (ain != null) {
- in_id = ain.getID();
+ in_id = ain.getID(mRS);
}
int out_id = 0;
if (aout != null) {
- out_id = aout.getID();
+ out_id = aout.getID(mRS);
}
byte[] params = null;
if (v != null) {
params = v.getData();
}
- mRS.nScriptForEach(getID(), slot, in_id, out_id, params);
+ mRS.nScriptForEach(getID(mRS), slot, in_id, out_id, params);
}
@@ -86,9 +86,9 @@ public class Script extends BaseObj {
public void bindAllocation(Allocation va, int slot) {
mRS.validate();
if (va != null) {
- mRS.nScriptBindAllocation(getID(), va.getID(), slot);
+ mRS.nScriptBindAllocation(getID(mRS), va.getID(mRS), slot);
} else {
- mRS.nScriptBindAllocation(getID(), 0, slot);
+ mRS.nScriptBindAllocation(getID(mRS), 0, slot);
}
}
@@ -99,7 +99,7 @@ public class Script extends BaseObj {
* @param v
*/
public void setVar(int index, float v) {
- mRS.nScriptSetVarF(getID(), index, v);
+ mRS.nScriptSetVarF(getID(mRS), index, v);
}
/**
@@ -109,7 +109,7 @@ public class Script extends BaseObj {
* @param v
*/
public void setVar(int index, double v) {
- mRS.nScriptSetVarD(getID(), index, v);
+ mRS.nScriptSetVarD(getID(mRS), index, v);
}
/**
@@ -119,7 +119,7 @@ public class Script extends BaseObj {
* @param v
*/
public void setVar(int index, int v) {
- mRS.nScriptSetVarI(getID(), index, v);
+ mRS.nScriptSetVarI(getID(mRS), index, v);
}
/**
@@ -129,7 +129,7 @@ public class Script extends BaseObj {
* @param v
*/
public void setVar(int index, long v) {
- mRS.nScriptSetVarJ(getID(), index, v);
+ mRS.nScriptSetVarJ(getID(mRS), index, v);
}
/**
@@ -139,7 +139,7 @@ public class Script extends BaseObj {
* @param v
*/
public void setVar(int index, boolean v) {
- mRS.nScriptSetVarI(getID(), index, v ? 1 : 0);
+ mRS.nScriptSetVarI(getID(mRS), index, v ? 1 : 0);
}
/**
@@ -149,7 +149,7 @@ public class Script extends BaseObj {
* @param o
*/
public void setVar(int index, BaseObj o) {
- mRS.nScriptSetVarObj(getID(), index, (o == null) ? 0 : o.getID());
+ mRS.nScriptSetVarObj(getID(mRS), index, (o == null) ? 0 : o.getID(mRS));
}
/**
@@ -159,13 +159,13 @@ public class Script extends BaseObj {
* @param v
*/
public void setVar(int index, FieldPacker v) {
- mRS.nScriptSetVarV(getID(), index, v.getData());
+ mRS.nScriptSetVarV(getID(mRS), index, v.getData());
}
public void setTimeZone(String timeZone) {
mRS.validate();
try {
- mRS.nScriptSetTimeZone(getID(), timeZone.getBytes("UTF-8"));
+ mRS.nScriptSetTimeZone(getID(mRS), timeZone.getBytes("UTF-8"));
} catch (java.io.UnsupportedEncodingException e) {
throw new RuntimeException(e);
}