Loading api/current.txt +8 −0 Original line number Diff line number Diff line Loading @@ -20081,6 +20081,14 @@ package android.renderscript { method public void setPriority(android.renderscript.RenderScript.Priority); } public static final class RenderScript.ContextType extends java.lang.Enum { method public static android.renderscript.RenderScript.ContextType valueOf(java.lang.String); method public static final android.renderscript.RenderScript.ContextType[] values(); enum_constant public static final android.renderscript.RenderScript.ContextType DEBUG; enum_constant public static final android.renderscript.RenderScript.ContextType NORMAL; enum_constant public static final android.renderscript.RenderScript.ContextType PROFILE; } public static final class RenderScript.Priority extends java.lang.Enum { method public static android.renderscript.RenderScript.Priority valueOf(java.lang.String); method public static final android.renderscript.RenderScript.Priority[] values(); graphics/java/android/renderscript/RenderScript.java +35 −6 Original line number Diff line number Diff line Loading @@ -102,6 +102,16 @@ public class RenderScript { f.mkdirs(); } public enum ContextType { NORMAL (0), DEBUG (1), PROFILE (2); int mID; ContextType(int id) { mID = id; } } // Methods below are wrapped to protect the non-threadsafe // lockless fifo. Loading @@ -122,9 +132,9 @@ public class RenderScript { stencilMin, stencilPref, samplesMin, samplesPref, samplesQ, dpi); } native int rsnContextCreate(int dev, int ver, int sdkVer); synchronized int nContextCreate(int dev, int ver, int sdkVer) { return rsnContextCreate(dev, ver, sdkVer); native int rsnContextCreate(int dev, int ver, int sdkVer, int contextType); synchronized int nContextCreate(int dev, int ver, int sdkVer, int contextType) { return rsnContextCreate(dev, ver, sdkVer, contextType); } native void rsnContextDestroy(int con); synchronized void nContextDestroy() { Loading Loading @@ -1011,6 +1021,13 @@ public class RenderScript { return mApplicationContext; } /** * @hide */ public static RenderScript create(Context ctx, int sdkVersion) { return create(ctx, sdkVersion, ContextType.NORMAL); } /** * Create a basic RenderScript context. * Loading @@ -1018,11 +1035,11 @@ public class RenderScript { * @param ctx The context. * @return RenderScript */ public static RenderScript create(Context ctx, int sdkVersion) { public static RenderScript create(Context ctx, int sdkVersion, ContextType ct) { RenderScript rs = new RenderScript(ctx); rs.mDev = rs.nDeviceCreate(); rs.mContext = rs.nContextCreate(rs.mDev, 0, sdkVersion); rs.mContext = rs.nContextCreate(rs.mDev, 0, sdkVersion, ct.mID); if (rs.mContext == 0) { throw new RSDriverException("Failed to create RS context."); } Loading @@ -1038,8 +1055,20 @@ public class RenderScript { * @return RenderScript */ public static RenderScript create(Context ctx) { return create(ctx, ContextType.NORMAL); } /** * Create a basic RenderScript context. * * @hide * * @param ctx The context. * @return RenderScript */ public static RenderScript create(Context ctx, ContextType ct) { int v = ctx.getApplicationInfo().targetSdkVersion; return create(ctx, v); return create(ctx, v, ct); } /** Loading graphics/jni/android_renderscript_RenderScript.cpp +3 −3 Original line number Diff line number Diff line Loading @@ -182,10 +182,10 @@ nDeviceSetConfig(JNIEnv *_env, jobject _this, jint dev, jint p, jint value) } static jint nContextCreate(JNIEnv *_env, jobject _this, jint dev, jint ver, jint sdkVer) nContextCreate(JNIEnv *_env, jobject _this, jint dev, jint ver, jint sdkVer, jint ct) { LOG_API("nContextCreate"); return (jint)rsContextCreate((RsDevice)dev, ver, sdkVer); return (jint)rsContextCreate((RsDevice)dev, ver, sdkVer, (RsContextType)ct, false, false); } static jint Loading Loading @@ -1463,7 +1463,7 @@ static JNINativeMethod methods[] = { // All methods below are thread protected in java. {"rsnContextCreate", "(III)I", (void*)nContextCreate }, {"rsnContextCreate", "(IIII)I", (void*)nContextCreate }, {"rsnContextCreateGL", "(IIIIIIIIIIIIIFI)I", (void*)nContextCreateGL }, {"rsnContextFinish", "(I)V", (void*)nContextFinish }, {"rsnContextSetPriority", "(II)V", (void*)nContextSetPriority }, Loading Loading
api/current.txt +8 −0 Original line number Diff line number Diff line Loading @@ -20081,6 +20081,14 @@ package android.renderscript { method public void setPriority(android.renderscript.RenderScript.Priority); } public static final class RenderScript.ContextType extends java.lang.Enum { method public static android.renderscript.RenderScript.ContextType valueOf(java.lang.String); method public static final android.renderscript.RenderScript.ContextType[] values(); enum_constant public static final android.renderscript.RenderScript.ContextType DEBUG; enum_constant public static final android.renderscript.RenderScript.ContextType NORMAL; enum_constant public static final android.renderscript.RenderScript.ContextType PROFILE; } public static final class RenderScript.Priority extends java.lang.Enum { method public static android.renderscript.RenderScript.Priority valueOf(java.lang.String); method public static final android.renderscript.RenderScript.Priority[] values();
graphics/java/android/renderscript/RenderScript.java +35 −6 Original line number Diff line number Diff line Loading @@ -102,6 +102,16 @@ public class RenderScript { f.mkdirs(); } public enum ContextType { NORMAL (0), DEBUG (1), PROFILE (2); int mID; ContextType(int id) { mID = id; } } // Methods below are wrapped to protect the non-threadsafe // lockless fifo. Loading @@ -122,9 +132,9 @@ public class RenderScript { stencilMin, stencilPref, samplesMin, samplesPref, samplesQ, dpi); } native int rsnContextCreate(int dev, int ver, int sdkVer); synchronized int nContextCreate(int dev, int ver, int sdkVer) { return rsnContextCreate(dev, ver, sdkVer); native int rsnContextCreate(int dev, int ver, int sdkVer, int contextType); synchronized int nContextCreate(int dev, int ver, int sdkVer, int contextType) { return rsnContextCreate(dev, ver, sdkVer, contextType); } native void rsnContextDestroy(int con); synchronized void nContextDestroy() { Loading Loading @@ -1011,6 +1021,13 @@ public class RenderScript { return mApplicationContext; } /** * @hide */ public static RenderScript create(Context ctx, int sdkVersion) { return create(ctx, sdkVersion, ContextType.NORMAL); } /** * Create a basic RenderScript context. * Loading @@ -1018,11 +1035,11 @@ public class RenderScript { * @param ctx The context. * @return RenderScript */ public static RenderScript create(Context ctx, int sdkVersion) { public static RenderScript create(Context ctx, int sdkVersion, ContextType ct) { RenderScript rs = new RenderScript(ctx); rs.mDev = rs.nDeviceCreate(); rs.mContext = rs.nContextCreate(rs.mDev, 0, sdkVersion); rs.mContext = rs.nContextCreate(rs.mDev, 0, sdkVersion, ct.mID); if (rs.mContext == 0) { throw new RSDriverException("Failed to create RS context."); } Loading @@ -1038,8 +1055,20 @@ public class RenderScript { * @return RenderScript */ public static RenderScript create(Context ctx) { return create(ctx, ContextType.NORMAL); } /** * Create a basic RenderScript context. * * @hide * * @param ctx The context. * @return RenderScript */ public static RenderScript create(Context ctx, ContextType ct) { int v = ctx.getApplicationInfo().targetSdkVersion; return create(ctx, v); return create(ctx, v, ct); } /** Loading
graphics/jni/android_renderscript_RenderScript.cpp +3 −3 Original line number Diff line number Diff line Loading @@ -182,10 +182,10 @@ nDeviceSetConfig(JNIEnv *_env, jobject _this, jint dev, jint p, jint value) } static jint nContextCreate(JNIEnv *_env, jobject _this, jint dev, jint ver, jint sdkVer) nContextCreate(JNIEnv *_env, jobject _this, jint dev, jint ver, jint sdkVer, jint ct) { LOG_API("nContextCreate"); return (jint)rsContextCreate((RsDevice)dev, ver, sdkVer); return (jint)rsContextCreate((RsDevice)dev, ver, sdkVer, (RsContextType)ct, false, false); } static jint Loading Loading @@ -1463,7 +1463,7 @@ static JNINativeMethod methods[] = { // All methods below are thread protected in java. {"rsnContextCreate", "(III)I", (void*)nContextCreate }, {"rsnContextCreate", "(IIII)I", (void*)nContextCreate }, {"rsnContextCreateGL", "(IIIIIIIIIIIIIFI)I", (void*)nContextCreateGL }, {"rsnContextFinish", "(I)V", (void*)nContextFinish }, {"rsnContextSetPriority", "(II)V", (void*)nContextSetPriority }, Loading