summaryrefslogtreecommitdiffstats
path: root/rs/java/android
diff options
context:
space:
mode:
authorYang Ni <yangni@google.com>2015-04-02 17:47:56 -0700
committerYang Ni <yangni@google.com>2015-04-13 17:24:44 -0700
commit35be56cce821d86f69026398ff9433e2d173b02f (patch)
tree09e39a548309294db1e9470de38fbd9a65399262 /rs/java/android
parent3afca74a2a40b4e957630909fe5df76aa550da69 (diff)
downloadframeworks_base-35be56cce821d86f69026398ff9433e2d173b02f.zip
frameworks_base-35be56cce821d86f69026398ff9433e2d173b02f.tar.gz
frameworks_base-35be56cce821d86f69026398ff9433e2d173b02f.tar.bz2
Add name to ScriptGroup2.Builder.create() method
This name will be used to name the .so file generated for the script group with fused kernels. Change-Id: I46e351c8412740512f56b7915b14f36183c6eeaf
Diffstat (limited to 'rs/java/android')
-rw-r--r--rs/java/android/renderscript/RenderScript.java8
-rw-r--r--rs/java/android/renderscript/ScriptGroup2.java8
2 files changed, 10 insertions, 6 deletions
diff --git a/rs/java/android/renderscript/RenderScript.java b/rs/java/android/renderscript/RenderScript.java
index 126b8c7..9f3348c 100644
--- a/rs/java/android/renderscript/RenderScript.java
+++ b/rs/java/android/renderscript/RenderScript.java
@@ -332,10 +332,12 @@ public class RenderScript {
rsnClosureSetGlobal(mContext, closureID, fieldID, value, size);
}
- native long rsnScriptGroup2Create(long con, String cachePath, long[] closures);
- synchronized long nScriptGroup2Create(String cachePath, long[] closures) {
+ native long rsnScriptGroup2Create(long con, String name, String cachePath,
+ long[] closures);
+ synchronized long nScriptGroup2Create(String name, String cachePath,
+ long[] closures) {
validate();
- return rsnScriptGroup2Create(mContext, cachePath, closures);
+ return rsnScriptGroup2Create(mContext, name, cachePath, closures);
}
native void rsnScriptGroup2Execute(long con, long groupID);
diff --git a/rs/java/android/renderscript/ScriptGroup2.java b/rs/java/android/renderscript/ScriptGroup2.java
index 9b92611..417bbee 100644
--- a/rs/java/android/renderscript/ScriptGroup2.java
+++ b/rs/java/android/renderscript/ScriptGroup2.java
@@ -289,6 +289,7 @@ public class ScriptGroup2 extends BaseObj {
}
}
+ String mName;
List<Closure> mClosures;
List<UnboundValue> mInputs;
Future[] mOutputs;
@@ -299,9 +300,10 @@ public class ScriptGroup2 extends BaseObj {
super(id, rs);
}
- ScriptGroup2(RenderScript rs, List<Closure> closures,
+ ScriptGroup2(RenderScript rs, String name, List<Closure> closures,
List<UnboundValue> inputs, Future[] outputs) {
super(0, rs);
+ mName = name;
mClosures = closures;
mInputs = inputs;
mOutputs = outputs;
@@ -310,7 +312,7 @@ public class ScriptGroup2 extends BaseObj {
for (int i = 0; i < closureIDs.length; i++) {
closureIDs[i] = closures.get(i).getID(rs);
}
- long id = rs.nScriptGroup2Create(ScriptC.mCachePath, closureIDs);
+ long id = rs.nScriptGroup2Create(name, ScriptC.mCachePath, closureIDs);
setID(id);
}
@@ -417,7 +419,7 @@ public class ScriptGroup2 extends BaseObj {
!name.equals(name.replaceAll("[^a-zA-Z0-9-]", "_"))) {
throw new RSIllegalArgumentException("invalid script group name");
}
- ScriptGroup2 ret = new ScriptGroup2(mRS, mClosures, mInputs, outputs);
+ ScriptGroup2 ret = new ScriptGroup2(mRS, name, mClosures, mInputs, outputs);
return ret;
}