Loading graphics/java/android/renderscript/RenderScript.java +17 −10 Original line number Diff line number Diff line Loading @@ -87,6 +87,7 @@ public class RenderScript { * Name of the file that holds the object cache. */ private static final String CACHE_PATH = "com.android.renderscript.cache"; static String mCachePath; /** * Sets the directory to use as a persistent storage for the Loading @@ -95,8 +96,6 @@ public class RenderScript { * @hide * @param cacheDir A directory the current process can write to */ static String mCachePath; public static void setupDiskCache(File cacheDir) { File f = new File(cacheDir, CACHE_PATH); mCachePath = f.getAbsolutePath(); Loading Loading @@ -905,8 +904,10 @@ public class RenderScript { } RenderScript(Context ctx) { if (ctx != null) { mApplicationContext = ctx.getApplicationContext(); } } /** * Gets the application context associated with the RenderScript context. Loading @@ -917,21 +918,16 @@ public class RenderScript { return mApplicationContext; } static int getTargetSdkVersion(Context ctx) { return ctx.getApplicationInfo().targetSdkVersion; } /** * Create a basic RenderScript context. * * @hide * @param ctx The context. * @return RenderScript */ public static RenderScript create(Context ctx) { public static RenderScript create(Context ctx, int sdkVersion) { RenderScript rs = new RenderScript(ctx); int sdkVersion = getTargetSdkVersion(ctx); rs.mDev = rs.nDeviceCreate(); rs.mContext = rs.nContextCreate(rs.mDev, 0, sdkVersion); if (rs.mContext == 0) { Loading @@ -942,6 +938,17 @@ public class RenderScript { return rs; } /** * Create a basic RenderScript context. * * @param ctx The context. * @return RenderScript */ public static RenderScript create(Context ctx) { int v = ctx.getApplicationInfo().targetSdkVersion; return create(ctx, v); } /** * Print the currently available debugging information about the state of * the RS context to the log. Loading graphics/java/android/renderscript/RenderScriptGL.java +1 −1 Original line number Diff line number Diff line Loading @@ -166,7 +166,7 @@ public class RenderScriptGL extends RenderScript { super(ctx); mSurfaceConfig = new SurfaceConfig(sc); int sdkVersion = getTargetSdkVersion(ctx); int sdkVersion = ctx.getApplicationInfo().targetSdkVersion; mWidth = 0; mHeight = 0; Loading Loading
graphics/java/android/renderscript/RenderScript.java +17 −10 Original line number Diff line number Diff line Loading @@ -87,6 +87,7 @@ public class RenderScript { * Name of the file that holds the object cache. */ private static final String CACHE_PATH = "com.android.renderscript.cache"; static String mCachePath; /** * Sets the directory to use as a persistent storage for the Loading @@ -95,8 +96,6 @@ public class RenderScript { * @hide * @param cacheDir A directory the current process can write to */ static String mCachePath; public static void setupDiskCache(File cacheDir) { File f = new File(cacheDir, CACHE_PATH); mCachePath = f.getAbsolutePath(); Loading Loading @@ -905,8 +904,10 @@ public class RenderScript { } RenderScript(Context ctx) { if (ctx != null) { mApplicationContext = ctx.getApplicationContext(); } } /** * Gets the application context associated with the RenderScript context. Loading @@ -917,21 +918,16 @@ public class RenderScript { return mApplicationContext; } static int getTargetSdkVersion(Context ctx) { return ctx.getApplicationInfo().targetSdkVersion; } /** * Create a basic RenderScript context. * * @hide * @param ctx The context. * @return RenderScript */ public static RenderScript create(Context ctx) { public static RenderScript create(Context ctx, int sdkVersion) { RenderScript rs = new RenderScript(ctx); int sdkVersion = getTargetSdkVersion(ctx); rs.mDev = rs.nDeviceCreate(); rs.mContext = rs.nContextCreate(rs.mDev, 0, sdkVersion); if (rs.mContext == 0) { Loading @@ -942,6 +938,17 @@ public class RenderScript { return rs; } /** * Create a basic RenderScript context. * * @param ctx The context. * @return RenderScript */ public static RenderScript create(Context ctx) { int v = ctx.getApplicationInfo().targetSdkVersion; return create(ctx, v); } /** * Print the currently available debugging information about the state of * the RS context to the log. Loading
graphics/java/android/renderscript/RenderScriptGL.java +1 −1 Original line number Diff line number Diff line Loading @@ -166,7 +166,7 @@ public class RenderScriptGL extends RenderScript { super(ctx); mSurfaceConfig = new SurfaceConfig(sc); int sdkVersion = getTargetSdkVersion(ctx); int sdkVersion = ctx.getApplicationInfo().targetSdkVersion; mWidth = 0; mHeight = 0; Loading