diff options
author | Yang Ni <yangni@google.com> | 2015-04-14 16:50:22 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2015-04-14 16:50:22 +0000 |
commit | 0933905375790eb850334b53fd6d0981bd40e007 (patch) | |
tree | d862be6358f6a2b18055b9eca9002959db7bf333 | |
parent | 73e056d3931b419c2653eb7365fb72b50a9a36c3 (diff) | |
parent | 6ca1e45aab5b4a1b229c6493780a04976db12817 (diff) | |
download | frameworks_base-0933905375790eb850334b53fd6d0981bd40e007.zip frameworks_base-0933905375790eb850334b53fd6d0981bd40e007.tar.gz frameworks_base-0933905375790eb850334b53fd6d0981bd40e007.tar.bz2 |
am 6ca1e45a: am 8704ae46: Merge "Add name to ScriptGroup2.Builder.create() method"
* commit '6ca1e45aab5b4a1b229c6493780a04976db12817':
Add name to ScriptGroup2.Builder.create() method
-rw-r--r-- | rs/java/android/renderscript/RenderScript.java | 8 | ||||
-rw-r--r-- | rs/java/android/renderscript/ScriptGroup2.java | 8 | ||||
-rw-r--r-- | rs/jni/android_renderscript_RenderScript.cpp | 8 |
3 files changed, 15 insertions, 9 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; } diff --git a/rs/jni/android_renderscript_RenderScript.cpp b/rs/jni/android_renderscript_RenderScript.cpp index 676d94f..ba194ee 100644 --- a/rs/jni/android_renderscript_RenderScript.cpp +++ b/rs/jni/android_renderscript_RenderScript.cpp @@ -423,8 +423,9 @@ nClosureSetGlobal(JNIEnv *_env, jobject _this, jlong con, jlong closureID, } static long -nScriptGroup2Create(JNIEnv *_env, jobject _this, jlong con, +nScriptGroup2Create(JNIEnv *_env, jobject _this, jlong con, jstring name, jstring cacheDir, jlongArray closureArray) { + AutoJavaStringToUTF8 nameUTF(_env, name); AutoJavaStringToUTF8 cacheDirUTF(_env, cacheDir); jlong* jClosures = _env->GetLongArrayElements(closureArray, nullptr); @@ -435,7 +436,8 @@ nScriptGroup2Create(JNIEnv *_env, jobject _this, jlong con, } return (jlong)(uintptr_t)rsScriptGroup2Create( - (RsContext)con, cacheDirUTF.c_str(), cacheDirUTF.length(), + (RsContext)con, nameUTF.c_str(), nameUTF.length(), + cacheDirUTF.c_str(), cacheDirUTF.length(), closures, numClosures); } @@ -2414,7 +2416,7 @@ static JNINativeMethod methods[] = { {"rsnScriptInvokeIDCreate", "(JJI)J", (void*)nScriptInvokeIDCreate }, {"rsnScriptFieldIDCreate", "(JJI)J", (void*)nScriptFieldIDCreate }, {"rsnScriptGroupCreate", "(J[J[J[J[J[J)J", (void*)nScriptGroupCreate }, -{"rsnScriptGroup2Create", "(JLjava/lang/String;[J)J", (void*)nScriptGroup2Create }, +{"rsnScriptGroup2Create", "(JLjava/lang/String;Ljava/lang/String;[J)J", (void*)nScriptGroup2Create }, {"rsnScriptGroupSetInput", "(JJJJ)V", (void*)nScriptGroupSetInput }, {"rsnScriptGroupSetOutput", "(JJJJ)V", (void*)nScriptGroupSetOutput }, {"rsnScriptGroupExecute", "(JJ)V", (void*)nScriptGroupExecute }, |