From c7c6364f514e2407d84070e11864ac63d367574d Mon Sep 17 00:00:00 2001 From: Miao Wang Date: Tue, 29 Mar 2016 15:14:21 -0700 Subject: [PATCH 1/3] [RenderScript] Update the documentation of Script.LaunchOptions Bug: 26916665 - Add description of the endArg. - Update the example. - Update the incorrect description. Change-Id: Idd07db5d790e2d6462fff9cb580115ec45cfd4f0 (cherry picked from commit 53fdcfbe63c1d4b2f1cbee6e72a6dd13f41dc1bc) --- rs/java/android/renderscript/Script.java | 29 ++++++++++++------------ 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/rs/java/android/renderscript/Script.java b/rs/java/android/renderscript/Script.java index 84f980dc24cde..815d478c781be 100644 --- a/rs/java/android/renderscript/Script.java +++ b/rs/java/android/renderscript/Script.java @@ -542,21 +542,22 @@ public class Script extends BaseObj { /** * Class for specifying the specifics about how a kernel will be - * launched + * launched. * * This class can specify a potential range of cells on which to * run a kernel. If no set is called for a dimension then this * class will have no impact on that dimension when the kernel * is executed. * - * The forEach launch will operate over the intersection of the - * dimensions. + * The forEach kernel launch will operate over the intersection of + * the dimensions. * * Example: * LaunchOptions with setX(5, 15) * Allocation with dimension X=10, Y=10 - * The resulting forEach run would execute over x = 5 to 10 and - * y = 0 to 10. + * The resulting forEach run would execute over: + * x = 5 to 9 (inclusive) and + * y = 0 to 9 (inclusive). * * */ @@ -570,11 +571,11 @@ public class Script extends BaseObj { private int strategy; /** - * Set the X range. If the end value is set to 0 the X dimension is not - * clipped. + * Set the X range. xstartArg is the lowest coordinate of the range, + * and xendArg-1 is the highest coordinate of the range. * * @param xstartArg Must be >= 0 - * @param xendArg Must be >= xstartArg + * @param xendArg Must be > xstartArg * * @return LaunchOptions */ @@ -588,11 +589,11 @@ public class Script extends BaseObj { } /** - * Set the Y range. If the end value is set to 0 the Y dimension is not - * clipped. + * Set the Y range. ystartArg is the lowest coordinate of the range, + * and yendArg-1 is the highest coordinate of the range. * * @param ystartArg Must be >= 0 - * @param yendArg Must be >= ystartArg + * @param yendArg Must be > ystartArg * * @return LaunchOptions */ @@ -606,11 +607,11 @@ public class Script extends BaseObj { } /** - * Set the Z range. If the end value is set to 0 the Z dimension is not - * clipped. + * Set the Z range. zstartArg is the lowest coordinate of the range, + * and zendArg-1 is the highest coordinate of the range. * * @param zstartArg Must be >= 0 - * @param zendArg Must be >= zstartArg + * @param zendArg Must be > zstartArg * * @return LaunchOptions */ From e58ed9b16d67a1c80888ffa6f6ed62d54ed12cae Mon Sep 17 00:00:00 2001 From: Miao Wang Date: Tue, 29 Mar 2016 15:29:10 -0700 Subject: [PATCH 2/3] [RenderScript] Fix IntrinsicConvolve documentation. Bug: 25117120 - Better format. - Typo fixes. Change-Id: Ic6f8d1dacecdaf9993dd8298de7a801f5fd2a937 (cherry picked from commit 3d23dce43330b9c8f3fba34ef9515dca7912768a) --- .../android/renderscript/ScriptIntrinsicConvolve3x3.java | 9 ++++----- .../android/renderscript/ScriptIntrinsicConvolve5x5.java | 8 ++++---- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/rs/java/android/renderscript/ScriptIntrinsicConvolve3x3.java b/rs/java/android/renderscript/ScriptIntrinsicConvolve3x3.java index 76da781004d83..339e0e9dc9757 100644 --- a/rs/java/android/renderscript/ScriptIntrinsicConvolve3x3.java +++ b/rs/java/android/renderscript/ScriptIntrinsicConvolve3x3.java @@ -32,10 +32,9 @@ public final class ScriptIntrinsicConvolve3x3 extends ScriptIntrinsic { * Supported elements types are {@link Element#U8}, {@link * Element#U8_2}, {@link Element#U8_3}, {@link Element#U8_4}, * {@link Element#F32}, {@link Element#F32_2}, {@link - * Element#F32_3}, and {@link Element#F32_4} - * - * The default coefficients are. + * Element#F32_3}, and {@link Element#F32_4}. * + *

The default coefficients are: * *

[ 0, 0, 0 ] *

[ 0, 1, 0 ] @@ -67,7 +66,7 @@ public final class ScriptIntrinsicConvolve3x3 extends ScriptIntrinsic { } /** - * Set the input of the blur. + * Set the input of the 3x3 convolve. * Must match the element type supplied during create. * * @param ain The input allocation. @@ -80,7 +79,7 @@ public final class ScriptIntrinsicConvolve3x3 extends ScriptIntrinsic { /** * Set the coefficients for the convolve. * - * The convolve layout is + *

The convolve layout is: * *

[ 0, 1, 2 ] *

[ 3, 4, 5 ] diff --git a/rs/java/android/renderscript/ScriptIntrinsicConvolve5x5.java b/rs/java/android/renderscript/ScriptIntrinsicConvolve5x5.java index 2d37600dc4920..a288cee407f03 100644 --- a/rs/java/android/renderscript/ScriptIntrinsicConvolve5x5.java +++ b/rs/java/android/renderscript/ScriptIntrinsicConvolve5x5.java @@ -32,9 +32,9 @@ public final class ScriptIntrinsicConvolve5x5 extends ScriptIntrinsic { * Supported elements types are {@link Element#U8}, {@link * Element#U8_2}, {@link Element#U8_3}, {@link Element#U8_4}, * {@link Element#F32}, {@link Element#F32_2}, {@link - * Element#F32_3}, and {@link Element#F32_4} + * Element#F32_3}, and {@link Element#F32_4}. * - * The default coefficients are. + *

The default coefficients are: * *

[ 0, 0, 0, 0, 0 ] *

[ 0, 0, 0, 0, 0 ] @@ -66,7 +66,7 @@ public final class ScriptIntrinsicConvolve5x5 extends ScriptIntrinsic { } /** - * Set the input of the blur. + * Set the input of the 5x5 convolve. * Must match the element type supplied during create. * * @param ain The input allocation. @@ -79,7 +79,7 @@ public final class ScriptIntrinsicConvolve5x5 extends ScriptIntrinsic { /** * Set the coefficients for the convolve. * - * The convolve layout is + *

The convolve layout is: * *

[ 0, 1, 2, 3, 4 ] *

[ 5, 6, 7, 8, 9 ] From ebfcdb935e86efcd7cda7b94785519647e135292 Mon Sep 17 00:00:00 2001 From: Miao Wang Date: Tue, 29 Mar 2016 15:56:55 -0700 Subject: [PATCH 3/3] [RenderScript] Update documentation for Allocation.setAutoPadding(). Bug: 26862970 Change-Id: Iaa88ac0266e5d2cac2837f1d13353aacc6177274 (cherry picked from commit 9ee7607615563c6b480968470e69cb58d0996cb8) --- rs/java/android/renderscript/Allocation.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/rs/java/android/renderscript/Allocation.java b/rs/java/android/renderscript/Allocation.java index 57c45a763e414..b9c5738a0936d 100644 --- a/rs/java/android/renderscript/Allocation.java +++ b/rs/java/android/renderscript/Allocation.java @@ -296,8 +296,13 @@ public class Allocation extends BaseObj { } /** - * Enable/Disable AutoPadding for Vec3 elements. - * By default: Diabled. + * Enable/Disable AutoPadding for Vec3 Elements. + * + *

Vec3 Elements, such as {@link Element#U8_3} are treated as Vec4 Elements + * with the fourth vector element used as padding. Enabling the AutoPadding feature + * will automatically add/remove the padding when you copy to/from an Allocation + * with a Vec3 Element. + *

By default: Disabled. * * @param useAutoPadding True: enable AutoPadding; False: disable AutoPadding *