From 35be56cce821d86f69026398ff9433e2d173b02f Mon Sep 17 00:00:00 2001 From: Yang Ni Date: Thu, 2 Apr 2015 17:47:56 -0700 Subject: 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 --- rs/java/android/renderscript/RenderScript.java | 8 +++++--- rs/java/android/renderscript/ScriptGroup2.java | 8 +++++--- 2 files changed, 10 insertions(+), 6 deletions(-) (limited to 'rs/java/android') 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 mClosures; List mInputs; Future[] mOutputs; @@ -299,9 +300,10 @@ public class ScriptGroup2 extends BaseObj { super(id, rs); } - ScriptGroup2(RenderScript rs, List closures, + ScriptGroup2(RenderScript rs, String name, List closures, List 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; } -- cgit v1.1