diff options
author | Shih-wei Liao <sliao@google.com> | 2010-11-08 01:33:59 -0800 |
---|---|---|
committer | Shih-wei Liao <sliao@google.com> | 2010-11-18 00:03:23 -0800 |
commit | a914f340ae5b267dc3ab36c1156c795b8fa18f5d (patch) | |
tree | 57050355fb1457ad8cbe27d7a8f657b9902cd85a /graphics | |
parent | 4daaeafd278d22ec9013d1cdaade562044ee907e (diff) | |
download | frameworks_base-a914f340ae5b267dc3ab36c1156c795b8fa18f5d.zip frameworks_base-a914f340ae5b267dc3ab36c1156c795b8fa18f5d.tar.gz frameworks_base-a914f340ae5b267dc3ab36c1156c795b8fa18f5d.tar.bz2 |
Add caching support of BCC binaries.
Change-Id: I1e75bb84d88319cb6f1bbe6d907cf6e8ed546142
Diffstat (limited to 'graphics')
-rw-r--r-- | graphics/java/android/renderscript/RenderScript.java | 9 | ||||
-rw-r--r-- | graphics/java/android/renderscript/ScriptC.java | 4 | ||||
-rw-r--r-- | graphics/jni/android_renderscript_RenderScript.cpp | 7 |
3 files changed, 9 insertions, 11 deletions
diff --git a/graphics/java/android/renderscript/RenderScript.java b/graphics/java/android/renderscript/RenderScript.java index 20949a4..dcf86e3 100644 --- a/graphics/java/android/renderscript/RenderScript.java +++ b/graphics/java/android/renderscript/RenderScript.java @@ -402,9 +402,9 @@ public class RenderScript { synchronized void nScriptCSetScript(byte[] script, int offset, int length) { rsnScriptCSetScript(mContext, script, offset, length); } - native int rsnScriptCCreate(int con); - synchronized int nScriptCCreate() { - return rsnScriptCCreate(mContext); + native int rsnScriptCCreate(int con, String val); + synchronized int nScriptCCreate(String val) { + return rsnScriptCCreate(mContext, val); } native void rsnSamplerBegin(int con); @@ -814,6 +814,3 @@ public class RenderScript { return 0; } } - - - diff --git a/graphics/java/android/renderscript/ScriptC.java b/graphics/java/android/renderscript/ScriptC.java index 44fc5fd..64ed75b 100644 --- a/graphics/java/android/renderscript/ScriptC.java +++ b/graphics/java/android/renderscript/ScriptC.java @@ -75,7 +75,7 @@ public class ScriptC extends Script { rs.nScriptCBegin(); rs.nScriptCSetScript(pgm, 0, pgmLength); - return rs.nScriptCCreate(); + Log.v(TAG, "Create script for resource = " + resources.getResourceName(resourceID)); + return rs.nScriptCCreate(resources.getResourceName(resourceID)); } } - diff --git a/graphics/jni/android_renderscript_RenderScript.cpp b/graphics/jni/android_renderscript_RenderScript.cpp index 8888459..1cc4386 100644 --- a/graphics/jni/android_renderscript_RenderScript.cpp +++ b/graphics/jni/android_renderscript_RenderScript.cpp @@ -954,10 +954,11 @@ exit: } static jint -nScriptCCreate(JNIEnv *_env, jobject _this, RsContext con) +nScriptCCreate(JNIEnv *_env, jobject _this, RsContext con, jstring resName) { LOG_API("nScriptCCreate, con(%p)", con); - return (jint)rsScriptCCreate(con); + const char* resNameUTF = _env->GetStringUTFChars(resName, NULL); + return (jint)rsScriptCCreate(con, resNameUTF); } // --------------------------------------------------------------------------- @@ -1346,7 +1347,7 @@ static JNINativeMethod methods[] = { {"rsnScriptCBegin", "(I)V", (void*)nScriptCBegin }, {"rsnScriptCSetScript", "(I[BII)V", (void*)nScriptCSetScript }, -{"rsnScriptCCreate", "(I)I", (void*)nScriptCCreate }, +{"rsnScriptCCreate", "(ILjava/lang/String;)I", (void*)nScriptCCreate }, {"rsnProgramStoreBegin", "(III)V", (void*)nProgramStoreBegin }, {"rsnProgramStoreDepthFunc", "(II)V", (void*)nProgramStoreDepthFunc }, |