Loading rs/java/android/renderscript/RenderScript.java +22 −5 Original line number Diff line number Diff line Loading @@ -1386,6 +1386,27 @@ public class RenderScript { return mApplicationContext; } /** * Name of the file that holds the object cache. */ private static String mCachePath; /** * Gets the path to the code cache. */ static synchronized String getCachePath() { if (mCachePath == null) { final String CACHE_PATH = "com.android.renderscript.cache"; if (RenderScriptCacheDir.mCacheDir == null) { throw new RSRuntimeException("RenderScript code cache directory uninitialized."); } File f = new File(RenderScriptCacheDir.mCacheDir, CACHE_PATH); mCachePath = f.getAbsolutePath(); f.mkdirs(); } return mCachePath; } /** * Create a RenderScript context. * Loading Loading @@ -1415,11 +1436,7 @@ public class RenderScript { } // set up cache directory for entire context final String CACHE_PATH = "com.android.renderscript.cache"; File f = new File(RenderScriptCacheDir.mCacheDir, CACHE_PATH); String mCachePath = f.getAbsolutePath(); f.mkdirs(); rs.nContextSetCacheDir(mCachePath); rs.nContextSetCacheDir(RenderScript.getCachePath()); rs.mMessageThread = new MessageThread(rs); rs.mMessageThread.start(); Loading rs/java/android/renderscript/ScriptC.java +2 −23 Original line number Diff line number Diff line Loading @@ -84,13 +84,6 @@ public class ScriptC extends Script { setID(id); } /** * Name of the file that holds the object cache. */ private static final String CACHE_PATH = "com.android.renderscript.cache"; static String mCachePath; private static synchronized long internalCreate(RenderScript rs, Resources resources, int resourceID) { byte[] pgm; int pgmLength; Loading Loading @@ -122,26 +115,12 @@ public class ScriptC extends Script { String resName = resources.getResourceEntryName(resourceID); // Create the RS cache path if we haven't done so already. if (mCachePath == null) { File f = new File(RenderScriptCacheDir.mCacheDir, CACHE_PATH); mCachePath = f.getAbsolutePath(); f.mkdirs(); } // Log.v(TAG, "Create script for resource = " + resName); return rs.nScriptCCreate(resName, mCachePath, pgm, pgmLength); return rs.nScriptCCreate(resName, RenderScript.getCachePath(), pgm, pgmLength); } 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(RenderScriptCacheDir.mCacheDir, CACHE_PATH); mCachePath = f.getAbsolutePath(); f.mkdirs(); } // Log.v(TAG, "Create script for resource = " + resName); return rs.nScriptCCreate(resName, mCachePath, bitcode, bitcode.length); return rs.nScriptCCreate(resName, RenderScript.getCachePath(), bitcode, bitcode.length); } } rs/java/android/renderscript/ScriptGroup.java +1 −1 Original line number Diff line number Diff line Loading @@ -396,7 +396,7 @@ public final class ScriptGroup extends BaseObj { for (int i = 0; i < closureIDs.length; i++) { closureIDs[i] = closures.get(i).getID(rs); } long id = rs.nScriptGroup2Create(name, ScriptC.mCachePath, closureIDs); long id = rs.nScriptGroup2Create(name, RenderScript.getCachePath(), closureIDs); setID(id); } Loading Loading
rs/java/android/renderscript/RenderScript.java +22 −5 Original line number Diff line number Diff line Loading @@ -1386,6 +1386,27 @@ public class RenderScript { return mApplicationContext; } /** * Name of the file that holds the object cache. */ private static String mCachePath; /** * Gets the path to the code cache. */ static synchronized String getCachePath() { if (mCachePath == null) { final String CACHE_PATH = "com.android.renderscript.cache"; if (RenderScriptCacheDir.mCacheDir == null) { throw new RSRuntimeException("RenderScript code cache directory uninitialized."); } File f = new File(RenderScriptCacheDir.mCacheDir, CACHE_PATH); mCachePath = f.getAbsolutePath(); f.mkdirs(); } return mCachePath; } /** * Create a RenderScript context. * Loading Loading @@ -1415,11 +1436,7 @@ public class RenderScript { } // set up cache directory for entire context final String CACHE_PATH = "com.android.renderscript.cache"; File f = new File(RenderScriptCacheDir.mCacheDir, CACHE_PATH); String mCachePath = f.getAbsolutePath(); f.mkdirs(); rs.nContextSetCacheDir(mCachePath); rs.nContextSetCacheDir(RenderScript.getCachePath()); rs.mMessageThread = new MessageThread(rs); rs.mMessageThread.start(); Loading
rs/java/android/renderscript/ScriptC.java +2 −23 Original line number Diff line number Diff line Loading @@ -84,13 +84,6 @@ public class ScriptC extends Script { setID(id); } /** * Name of the file that holds the object cache. */ private static final String CACHE_PATH = "com.android.renderscript.cache"; static String mCachePath; private static synchronized long internalCreate(RenderScript rs, Resources resources, int resourceID) { byte[] pgm; int pgmLength; Loading Loading @@ -122,26 +115,12 @@ public class ScriptC extends Script { String resName = resources.getResourceEntryName(resourceID); // Create the RS cache path if we haven't done so already. if (mCachePath == null) { File f = new File(RenderScriptCacheDir.mCacheDir, CACHE_PATH); mCachePath = f.getAbsolutePath(); f.mkdirs(); } // Log.v(TAG, "Create script for resource = " + resName); return rs.nScriptCCreate(resName, mCachePath, pgm, pgmLength); return rs.nScriptCCreate(resName, RenderScript.getCachePath(), pgm, pgmLength); } 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(RenderScriptCacheDir.mCacheDir, CACHE_PATH); mCachePath = f.getAbsolutePath(); f.mkdirs(); } // Log.v(TAG, "Create script for resource = " + resName); return rs.nScriptCCreate(resName, mCachePath, bitcode, bitcode.length); return rs.nScriptCCreate(resName, RenderScript.getCachePath(), bitcode, bitcode.length); } }
rs/java/android/renderscript/ScriptGroup.java +1 −1 Original line number Diff line number Diff line Loading @@ -396,7 +396,7 @@ public final class ScriptGroup extends BaseObj { for (int i = 0; i < closureIDs.length; i++) { closureIDs[i] = closures.get(i).getID(rs); } long id = rs.nScriptGroup2Create(name, ScriptC.mCachePath, closureIDs); long id = rs.nScriptGroup2Create(name, RenderScript.getCachePath(), closureIDs); setID(id); } Loading