summaryrefslogtreecommitdiffstats
path: root/rs
diff options
context:
space:
mode:
authorYang Ni <yangni@google.com>2015-02-03 06:27:39 +0000
committerandroid-build-merger <android-build-merger@google.com>2015-02-03 06:27:39 +0000
commit712e38eaba012904a515dc84d1edda4dab563dcc (patch)
treedbed727b9383e5f00b875f2e572cb4eef6f8d7eb /rs
parente9557d7d2728d1c77e4d173e8f6d954eeeb69357 (diff)
parent29fe5ef179a4a7de15360650353c6196f9350b07 (diff)
downloadframeworks_base-712e38eaba012904a515dc84d1edda4dab563dcc.zip
frameworks_base-712e38eaba012904a515dc84d1edda4dab563dcc.tar.gz
frameworks_base-712e38eaba012904a515dc84d1edda4dab563dcc.tar.bz2
Merge "Pass in code cache directory when creating a script group." automerge: 9559ce7
automerge: 29fe5ef * commit '29fe5ef179a4a7de15360650353c6196f9350b07': Pass in code cache directory when creating a script group.
Diffstat (limited to 'rs')
-rw-r--r--rs/java/android/renderscript/RenderScript.java6
-rw-r--r--rs/java/android/renderscript/ScriptGroup2.java9
-rw-r--r--rs/jni/android_renderscript_RenderScript.cpp11
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 },