Move cache dir to its own class.

This prevents us from loading the RS static initializer all the time.

Change-Id: I8cea7540e50251aba8c2f199f06f344f991e7d7f
This commit is contained in:
Tim Murray
2015-04-07 13:24:14 -07:00
parent d95e58cb60
commit e1e6c66198
4 changed files with 54 additions and 34 deletions

View File

@@ -124,7 +124,7 @@ public class ScriptC extends Script {
// Create the RS cache path if we haven't done so already.
if (mCachePath == null) {
File f = new File(rs.mCacheDir, CACHE_PATH);
File f = new File(RenderScriptCacheDir.mCacheDir, CACHE_PATH);
mCachePath = f.getAbsolutePath();
f.mkdirs();
}
@@ -135,7 +135,7 @@ public class ScriptC extends Script {
private static synchronized long internalStringCreate(RenderScript rs, String resName, byte[] bitcode) {
// Create the RS cache path if we haven't done so already.
if (mCachePath == null) {
File f = new File(rs.mCacheDir, CACHE_PATH);
File f = new File(RenderScriptCacheDir.mCacheDir, CACHE_PATH);
mCachePath = f.getAbsolutePath();
f.mkdirs();
}