summaryrefslogtreecommitdiffstats
path: root/graphics/java
diff options
context:
space:
mode:
authorShih-wei Liao <sliao@google.com>2010-12-20 20:45:56 +0800
committerShih-wei Liao <sliao@google.com>2010-12-20 21:02:32 +0800
commiteeca435dc6134a285b9bbb832cd6a1a88f34e85f (patch)
tree0c7650ef80ade830a7892e867afe777a64187780 /graphics/java
parentb70c82dc45f62a1c257a80e7aa9e0ecfe063c1be (diff)
downloadframeworks_base-eeca435dc6134a285b9bbb832cd6a1a88f34e85f.zip
frameworks_base-eeca435dc6134a285b9bbb832cd6a1a88f34e85f.tar.gz
frameworks_base-eeca435dc6134a285b9bbb832cd6a1a88f34e85f.tar.bz2
Stale cache management to address a P1 bug # 3296131.
Change-Id: I593f35a91c4a14c055828f8989fe01b9e7790039
Diffstat (limited to 'graphics/java')
-rw-r--r--graphics/java/android/renderscript/RenderScript.java6
-rw-r--r--graphics/java/android/renderscript/ScriptC.java10
2 files changed, 11 insertions, 5 deletions
diff --git a/graphics/java/android/renderscript/RenderScript.java b/graphics/java/android/renderscript/RenderScript.java
index 0b7262b..16ad55a 100644
--- a/graphics/java/android/renderscript/RenderScript.java
+++ b/graphics/java/android/renderscript/RenderScript.java
@@ -417,9 +417,9 @@ public class RenderScript {
synchronized void nScriptCSetScript(byte[] script, int offset, int length) {
rsnScriptCSetScript(mContext, script, offset, length);
}
- native int rsnScriptCCreate(int con, String val, String cacheDir);
- synchronized int nScriptCCreate(String resName, String cacheDir) {
- return rsnScriptCCreate(mContext, resName, cacheDir);
+ native int rsnScriptCCreate(int con, String packageName, String resName, String cacheDir);
+ synchronized int nScriptCCreate(String packageName, String resName, String cacheDir) {
+ return rsnScriptCCreate(mContext, packageName, resName, cacheDir);
}
native void rsnSamplerBegin(int con);
diff --git a/graphics/java/android/renderscript/ScriptC.java b/graphics/java/android/renderscript/ScriptC.java
index b10247c..c1e4358 100644
--- a/graphics/java/android/renderscript/ScriptC.java
+++ b/graphics/java/android/renderscript/ScriptC.java
@@ -77,8 +77,14 @@ public class ScriptC extends Script {
rs.nScriptCBegin();
rs.nScriptCSetScript(pgm, 0, pgmLength);
- Log.v(TAG, "Create script for resource = " + resources.getResourceName(resourceID));
+
+ // E.g, /system/apps/Fountain.apk
+ String packageName = rs.getApplicationContext().getPackageResourcePath();
+ // For res/raw/fountain.bc, it wil be /com.android.fountain:raw/fountain
+ String resName = resources.getResourceName(resourceID);
String cacheDir = rs.getApplicationContext().getCacheDir().toString();
- return rs.nScriptCCreate(resources.getResourceName(resourceID), cacheDir);
+
+ Log.v(TAG, "Create script for resource = " + resName);
+ return rs.nScriptCCreate(packageName, resName, cacheDir);
}
}