diff options
| author | 2014-07-09 07:39:38 -0700 | |
|---|---|---|
| committer | 2014-07-09 07:39:38 -0700 | |
| commit | 48ba506dfa591d0bcd79a088457eb95a9bd4c575 (patch) | |
| tree | fdef187efdaa55a0f67a4fb5e1d553d358a10f4a /rs/java | |
| parent | f32b3de8c931060875ed6fa1dbb87b67048d8552 (diff) | |
| parent | 31012e2cef3f36183bcfd243278e969b29360c3e (diff) | |
resolved conflicts for merge of 31012e2c to master
Change-Id: I2e24e0457570d7d856293637a553f0242a97a83b
Diffstat (limited to 'rs/java')
7 files changed, 79 insertions, 13 deletions
diff --git a/rs/java/android/renderscript/RenderScript.java b/rs/java/android/renderscript/RenderScript.java index 44de480e033f..340efef875a3 100644 --- a/rs/java/android/renderscript/RenderScript.java +++ b/rs/java/android/renderscript/RenderScript.java @@ -630,6 +630,29 @@ public class RenderScript { } } + /** + * Multi-input code. + * + */ + + // @hide + native void rsnScriptForEachMultiClipped(long con, long id, int slot, long[] ains, long aout, byte[] params, + int xstart, int xend, int ystart, int yend, int zstart, int zend); + // @hide + native void rsnScriptForEachMultiClipped(long con, long id, int slot, long[] ains, long aout, + int xstart, int xend, int ystart, int yend, int zstart, int zend); + + // @hide + synchronized void nScriptForEachMultiClipped(long id, int slot, long[] ains, long aout, byte[] params, + int xstart, int xend, int ystart, int yend, int zstart, int zend) { + validate(); + if (params == null) { + rsnScriptForEachMultiClipped(mContext, id, slot, ains, aout, xstart, xend, ystart, yend, zstart, zend); + } else { + rsnScriptForEachMultiClipped(mContext, id, slot, ains, aout, params, xstart, xend, ystart, yend, zstart, zend); + } + } + native void rsnScriptInvokeV(long con, long id, int slot, byte[] params); synchronized void nScriptInvokeV(long id, int slot, byte[] params) { validate(); diff --git a/rs/java/android/renderscript/Script.java b/rs/java/android/renderscript/Script.java index 0e46f94a583e..c49ef948db97 100644 --- a/rs/java/android/renderscript/Script.java +++ b/rs/java/android/renderscript/Script.java @@ -182,6 +182,54 @@ public class Script extends BaseObj { mRS.nScriptForEachClipped(getID(mRS), slot, in_id, out_id, params, sc.xstart, sc.xend, sc.ystart, sc.yend, sc.zstart, sc.zend); } + /** + * Only intended for use by generated reflected code. + * + * @hide + */ + protected void forEach(int slot, Allocation[] ains, Allocation aout, FieldPacker v) { + forEach(slot, ains, aout, v, new LaunchOptions()); + } + + /** + * Only intended for use by generated reflected code. + * + * @hide + */ + protected void forEach(int slot, Allocation[] ains, Allocation aout, FieldPacker v, LaunchOptions sc) { + mRS.validate(); + + for (Allocation ain : ains) { + mRS.validateObject(ain); + } + + mRS.validateObject(aout); + if (ains == null && aout == null) { + throw new RSIllegalArgumentException( + "At least one of ain or aout is required to be non-null."); + } + + if (sc == null) { + forEach(slot, ains, aout, v); + return; + } + + long[] in_ids = new long[ains.length]; + for (int index = 0; index < ains.length; ++index) { + in_ids[index] = ains[index].getID(mRS); + } + + long out_id = 0; + if (aout != null) { + out_id = aout.getID(mRS); + } + byte[] params = null; + if (v != null) { + params = v.getData(); + } + mRS.nScriptForEachMultiClipped(getID(mRS), slot, in_ids, out_id, params, sc.xstart, sc.xend, sc.ystart, sc.yend, sc.zstart, sc.zend); + } + Script(long id, RenderScript rs) { super(id, rs); } @@ -477,4 +525,3 @@ public class Script extends BaseObj { } } - diff --git a/rs/java/android/renderscript/ScriptIntrinsicBlur.java b/rs/java/android/renderscript/ScriptIntrinsicBlur.java index e7e33b8d884f..5c4edd3ae9d8 100644 --- a/rs/java/android/renderscript/ScriptIntrinsicBlur.java +++ b/rs/java/android/renderscript/ScriptIntrinsicBlur.java @@ -84,7 +84,7 @@ public final class ScriptIntrinsicBlur extends ScriptIntrinsic { * type. */ public void forEach(Allocation aout) { - forEach(aout, null); + forEach(0, (Allocation) null, aout, null); } /** @@ -96,7 +96,7 @@ public final class ScriptIntrinsicBlur extends ScriptIntrinsic { * @param opt LaunchOptions for clipping */ public void forEach(Allocation aout, Script.LaunchOptions opt) { - forEach(0, null, aout, null, opt); + forEach(0, (Allocation) null, aout, null, opt); } @@ -118,4 +118,3 @@ public final class ScriptIntrinsicBlur extends ScriptIntrinsic { return createFieldID(1, null); } } - diff --git a/rs/java/android/renderscript/ScriptIntrinsicConvolve3x3.java b/rs/java/android/renderscript/ScriptIntrinsicConvolve3x3.java index fb91fdceddd9..76da781004d8 100644 --- a/rs/java/android/renderscript/ScriptIntrinsicConvolve3x3.java +++ b/rs/java/android/renderscript/ScriptIntrinsicConvolve3x3.java @@ -106,7 +106,7 @@ public final class ScriptIntrinsicConvolve3x3 extends ScriptIntrinsic { * type. */ public void forEach(Allocation aout) { - forEach(aout, null); + forEach(0, (Allocation) null, aout, null); } /** @@ -118,7 +118,7 @@ public final class ScriptIntrinsicConvolve3x3 extends ScriptIntrinsic { * @param opt LaunchOptions for clipping */ public void forEach(Allocation aout, Script.LaunchOptions opt) { - forEach(0, null, aout, null, opt); + forEach(0, (Allocation) null, aout, null, opt); } /** @@ -140,4 +140,3 @@ public final class ScriptIntrinsicConvolve3x3 extends ScriptIntrinsic { } } - diff --git a/rs/java/android/renderscript/ScriptIntrinsicConvolve5x5.java b/rs/java/android/renderscript/ScriptIntrinsicConvolve5x5.java index 035756031e51..2d37600dc492 100644 --- a/rs/java/android/renderscript/ScriptIntrinsicConvolve5x5.java +++ b/rs/java/android/renderscript/ScriptIntrinsicConvolve5x5.java @@ -107,7 +107,7 @@ public final class ScriptIntrinsicConvolve5x5 extends ScriptIntrinsic { * type. */ public void forEach(Allocation aout) { - forEach(aout, null); + forEach(0, (Allocation) null, aout, null); } /** @@ -119,7 +119,7 @@ public final class ScriptIntrinsicConvolve5x5 extends ScriptIntrinsic { * @param opt LaunchOptions for clipping */ public void forEach(Allocation aout, Script.LaunchOptions opt) { - forEach(0, null, aout, null, opt); + forEach(0, (Allocation) null, aout, null, opt); } @@ -141,4 +141,3 @@ public final class ScriptIntrinsicConvolve5x5 extends ScriptIntrinsic { return createFieldID(1, null); } } - diff --git a/rs/java/android/renderscript/ScriptIntrinsicResize.java b/rs/java/android/renderscript/ScriptIntrinsicResize.java index fe566990d7b6..d6764ccab75e 100644 --- a/rs/java/android/renderscript/ScriptIntrinsicResize.java +++ b/rs/java/android/renderscript/ScriptIntrinsicResize.java @@ -95,7 +95,7 @@ public final class ScriptIntrinsicResize extends ScriptIntrinsic { * @param opt LaunchOptions for clipping */ public void forEach_bicubic(Allocation aout, Script.LaunchOptions opt) { - forEach(0, null, aout, null, opt); + forEach(0, (Allocation) null, aout, null, opt); } /** @@ -109,4 +109,3 @@ public final class ScriptIntrinsicResize extends ScriptIntrinsic { } - diff --git a/rs/java/android/renderscript/ScriptIntrinsicYuvToRGB.java b/rs/java/android/renderscript/ScriptIntrinsicYuvToRGB.java index f942982583bf..e64c91103c8f 100644 --- a/rs/java/android/renderscript/ScriptIntrinsicYuvToRGB.java +++ b/rs/java/android/renderscript/ScriptIntrinsicYuvToRGB.java @@ -66,7 +66,7 @@ public final class ScriptIntrinsicYuvToRGB extends ScriptIntrinsic { * type. */ public void forEach(Allocation aout) { - forEach(0, null, aout, null); + forEach(0, (Allocation) null, aout, null); } /** |