diff options
-rw-r--r-- | rs/java/android/renderscript/RenderScript.java | 6 | ||||
-rw-r--r-- | rs/java/android/renderscript/ScriptGroup2.java | 9 | ||||
-rw-r--r-- | rs/jni/android_renderscript_RenderScript.cpp | 11 |
3 files changed, 11 insertions, 15 deletions
diff --git a/rs/java/android/renderscript/RenderScript.java b/rs/java/android/renderscript/RenderScript.java index 271fe05..f37519e 100644 --- a/rs/java/android/renderscript/RenderScript.java +++ b/rs/java/android/renderscript/RenderScript.java @@ -330,10 +330,10 @@ public class RenderScript { rsnClosureSetGlobal(mContext, closureID, fieldID, value, size); } - native long rsnScriptGroup2Create(long con, long[] closures); - synchronized long nScriptGroup2Create(long[] closures) { + native long rsnScriptGroup2Create(long con, String cachePath, long[] closures); + synchronized long nScriptGroup2Create(String cachePath, long[] closures) { validate(); - return rsnScriptGroup2Create(mContext, closures); + return rsnScriptGroup2Create(mContext, 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 dcad787..366039e 100644 --- a/rs/java/android/renderscript/ScriptGroup2.java +++ b/rs/java/android/renderscript/ScriptGroup2.java @@ -8,9 +8,6 @@ import java.util.List; import java.util.Map; /** - @hide Pending Android public API approval. - */ -/** ****************************** You have tried to change the API from what has been previously approved. @@ -240,12 +237,10 @@ public class ScriptGroup2 extends BaseObj { for (int i = 0; i < closureIDs.length; i++) { closureIDs[i] = closures.get(i).getID(rs); } - long id = rs.nScriptGroup2Create(closureIDs); + long id = rs.nScriptGroup2Create(ScriptC.mCachePath, closureIDs); setID(id); } - // TODO: If this was reflected method, we could enforce the number of - // arguments. public Object[] execute(Object... inputs) { if (inputs.length < mInputs.size()) { Log.e(TAG, this.toString() + " receives " + inputs.length + " inputs, " + @@ -309,8 +304,6 @@ public class ScriptGroup2 extends BaseObj { } public ScriptGroup2 create(Future... outputs) { - // TODO: Save all script groups that have been created and return one that was - // saved and matches the outputs. ScriptGroup2 ret = new ScriptGroup2(mRS, mClosures, mInputs, outputs); return ret; } diff --git a/rs/jni/android_renderscript_RenderScript.cpp b/rs/jni/android_renderscript_RenderScript.cpp index 06f4def..cbcba39 100644 --- a/rs/jni/android_renderscript_RenderScript.cpp +++ b/rs/jni/android_renderscript_RenderScript.cpp @@ -258,7 +258,9 @@ nClosureSetGlobal(JNIEnv *_env, jobject _this, jlong con, jlong closureID, static long nScriptGroup2Create(JNIEnv *_env, jobject _this, jlong con, - jlongArray closureArray) { + jstring cacheDir, jlongArray closureArray) { + AutoJavaStringToUTF8 cacheDirUTF(_env, cacheDir); + jlong* jClosures = _env->GetLongArrayElements(closureArray, nullptr); jsize numClosures = _env->GetArrayLength(closureArray); RsClosure* closures = (RsClosure*)alloca(sizeof(RsClosure) * numClosures); @@ -266,8 +268,9 @@ nScriptGroup2Create(JNIEnv *_env, jobject _this, jlong con, closures[i] = (RsClosure)jClosures[i]; } - return (jlong)(uintptr_t)rsScriptGroup2Create((RsContext)con, closures, - numClosures); + return (jlong)(uintptr_t)rsScriptGroup2Create( + (RsContext)con, cacheDirUTF.c_str(), cacheDirUTF.length(), + closures, numClosures); } static void @@ -2008,7 +2011,7 @@ static JNINativeMethod methods[] = { {"rsnScriptKernelIDCreate", "(JJII)J", (void*)nScriptKernelIDCreate }, {"rsnScriptFieldIDCreate", "(JJI)J", (void*)nScriptFieldIDCreate }, {"rsnScriptGroupCreate", "(J[J[J[J[J[J)J", (void*)nScriptGroupCreate }, -{"rsnScriptGroup2Create", "(J[J)J", (void*)nScriptGroup2Create }, +{"rsnScriptGroup2Create", "(JLjava/lang/String;[J)J", (void*)nScriptGroup2Create }, {"rsnScriptGroupSetInput", "(JJJJ)V", (void*)nScriptGroupSetInput }, {"rsnScriptGroupSetOutput", "(JJJJ)V", (void*)nScriptGroupSetOutput }, {"rsnScriptGroupExecute", "(JJ)V", (void*)nScriptGroupExecute }, |