summaryrefslogtreecommitdiff
path: root/rs/java/android/renderscript/RenderScript.java
diff options
context:
space:
mode:
Diffstat (limited to 'rs/java/android/renderscript/RenderScript.java')
-rw-r--r--rs/java/android/renderscript/RenderScript.java28
1 files changed, 27 insertions, 1 deletions
diff --git a/rs/java/android/renderscript/RenderScript.java b/rs/java/android/renderscript/RenderScript.java
index 8b1a0324956a..a2967e8a2c47 100644
--- a/rs/java/android/renderscript/RenderScript.java
+++ b/rs/java/android/renderscript/RenderScript.java
@@ -30,6 +30,8 @@ import android.os.SystemProperties;
import android.os.Trace;
import java.util.ArrayList;
+// TODO: Clean up the whitespace that separates methods in this class.
+
/**
* This class provides access to a RenderScript context, which controls RenderScript
* initialization, resource management, and teardown. An instance of the RenderScript
@@ -88,6 +90,21 @@ public class RenderScript {
*/
public static final int CREATE_FLAG_LOW_POWER = 0x0004;
+ /**
+ * @hide
+ * Context creation flag which instructs the implementation to wait for
+ * a debugger to be attached before continuing execution.
+ */
+ public static final int CREATE_FLAG_WAIT_FOR_ATTACH = 0x0008;
+
+ /**
+ * @hide
+ * Context creation flag which specifies that optimization level 0 is
+ * passed to the device compiler upon execution of the RenderScript kernel.
+ * The default optimization level is 3.
+ */
+ public static final int CREATE_FLAG_OPT_LEVEL_0 = 0x0010;
+
/*
* Detect the bitness of the VM to allow FieldPacker to do the right thing.
*/
@@ -726,6 +743,14 @@ public class RenderScript {
rsnScriptForEach(mContext, id, slot, ains, aout, params, limits);
}
+ native void rsnScriptReduce(long con, long id, int slot, long ain,
+ long aout, int[] limits);
+ synchronized void nScriptReduce(long id, int slot, long ain, long aout,
+ int[] limits) {
+ validate();
+ rsnScriptReduce(mContext, id, slot, ain, aout, limits);
+ }
+
native void rsnScriptInvokeV(long con, long id, int slot, byte[] params);
synchronized void nScriptInvokeV(long id, int slot, byte[] params) {
validate();
@@ -1356,7 +1381,8 @@ public class RenderScript {
return null;
}
- if ((flags & ~(CREATE_FLAG_LOW_LATENCY | CREATE_FLAG_LOW_POWER)) != 0) {
+ if ((flags & ~(CREATE_FLAG_LOW_LATENCY | CREATE_FLAG_LOW_POWER |
+ CREATE_FLAG_WAIT_FOR_ATTACH | CREATE_FLAG_OPT_LEVEL_0)) != 0) {
throw new RSIllegalArgumentException("Invalid flags passed.");
}