Loading graphics/java/android/renderscript/RenderScript.java +3 −8 Original line number Diff line number Diff line Loading @@ -83,11 +83,7 @@ public class RenderScript { native void nContextInitToClient(int con); native void nContextDeinitToClient(int con); /** * Name of the file that holds the object cache. */ private static final String CACHE_PATH = "com.android.renderscript.cache"; static String mCachePath; static File mCacheDir; /** * Sets the directory to use as a persistent storage for the Loading @@ -97,9 +93,8 @@ public class RenderScript { * @param cacheDir A directory the current process can write to */ public static void setupDiskCache(File cacheDir) { File f = new File(cacheDir, CACHE_PATH); mCachePath = f.getAbsolutePath(); f.mkdirs(); // Defer creation of cache path to nScriptCCreate(). mCacheDir = cacheDir; } public enum ContextType { Loading graphics/java/android/renderscript/ScriptC.java +13 −1 Original line number Diff line number Diff line Loading @@ -64,6 +64,12 @@ public class ScriptC extends Script { rs.addAllocSizeForGC(mGCSize); } /** * 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 int internalCreate(RenderScript rs, Resources resources, int resourceID) { byte[] pgm; Loading Loading @@ -96,7 +102,13 @@ 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(rs.mCacheDir, CACHE_PATH); mCachePath = f.getAbsolutePath(); f.mkdirs(); } Log.v(TAG, "Create script for resource = " + resName); return rs.nScriptCCreate(resName, rs.mCachePath, pgm, pgmLength); return rs.nScriptCCreate(resName, mCachePath, pgm, pgmLength); } } Loading
graphics/java/android/renderscript/RenderScript.java +3 −8 Original line number Diff line number Diff line Loading @@ -83,11 +83,7 @@ public class RenderScript { native void nContextInitToClient(int con); native void nContextDeinitToClient(int con); /** * Name of the file that holds the object cache. */ private static final String CACHE_PATH = "com.android.renderscript.cache"; static String mCachePath; static File mCacheDir; /** * Sets the directory to use as a persistent storage for the Loading @@ -97,9 +93,8 @@ public class RenderScript { * @param cacheDir A directory the current process can write to */ public static void setupDiskCache(File cacheDir) { File f = new File(cacheDir, CACHE_PATH); mCachePath = f.getAbsolutePath(); f.mkdirs(); // Defer creation of cache path to nScriptCCreate(). mCacheDir = cacheDir; } public enum ContextType { Loading
graphics/java/android/renderscript/ScriptC.java +13 −1 Original line number Diff line number Diff line Loading @@ -64,6 +64,12 @@ public class ScriptC extends Script { rs.addAllocSizeForGC(mGCSize); } /** * 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 int internalCreate(RenderScript rs, Resources resources, int resourceID) { byte[] pgm; Loading Loading @@ -96,7 +102,13 @@ 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(rs.mCacheDir, CACHE_PATH); mCachePath = f.getAbsolutePath(); f.mkdirs(); } Log.v(TAG, "Create script for resource = " + resName); return rs.nScriptCCreate(resName, rs.mCachePath, pgm, pgmLength); return rs.nScriptCCreate(resName, mCachePath, pgm, pgmLength); } }