diff options
Diffstat (limited to 'rs/java/android/renderscript')
| -rw-r--r-- | rs/java/android/renderscript/Allocation.java | 38 | ||||
| -rw-r--r-- | rs/java/android/renderscript/Element.java | 18 | ||||
| -rw-r--r-- | rs/java/android/renderscript/FileA3D.java | 3 | ||||
| -rw-r--r-- | rs/java/android/renderscript/Mesh.java | 6 | ||||
| -rw-r--r-- | rs/java/android/renderscript/RenderScript.java | 10 | ||||
| -rw-r--r-- | rs/java/android/renderscript/Script.java | 27 | ||||
| -rw-r--r-- | rs/java/android/renderscript/Type.java | 23 |
7 files changed, 60 insertions, 65 deletions
diff --git a/rs/java/android/renderscript/Allocation.java b/rs/java/android/renderscript/Allocation.java index 523c8fb..c4daaa9 100644 --- a/rs/java/android/renderscript/Allocation.java +++ b/rs/java/android/renderscript/Allocation.java @@ -802,7 +802,7 @@ public class Allocation extends BaseObj { /** * This is only intended to be used by auto-generated code reflected from - * the RenderScript script files. + * the RenderScript script files and should not be used by developers. * * @param xoff * @param component_number @@ -813,9 +813,8 @@ public class Allocation extends BaseObj { } /** - * @hide * This is only intended to be used by auto-generated code reflected from - * the RenderScript script files. + * the RenderScript script files and should not be used by developers. * * @param xoff * @param yoff @@ -1247,8 +1246,11 @@ public class Allocation extends BaseObj { } /** - * @hide + * Copy a rectangular region from the array into the allocation. + * The array is assumed to be tightly packed. * + * The data type of the array is not required to be the same as + * the element data type. */ private void copy3DRangeFromUnchecked(int xoff, int yoff, int zoff, int w, int h, int d, Object array, Element.DataType dt, int arrayLen) { @@ -1277,7 +1279,6 @@ public class Allocation extends BaseObj { } /** - * @hide * Copy a rectangular region from the array into the allocation. * The array is assumed to be tightly packed. * @@ -1298,7 +1299,6 @@ public class Allocation extends BaseObj { } /** - * @hide * Copy a rectangular region into the allocation from another * allocation. * @@ -1415,7 +1415,6 @@ public class Allocation extends BaseObj { } /** - * @hide * This is only intended to be used by auto-generated code reflected from * the RenderScript script files and should not be used by developers. * @@ -1423,7 +1422,7 @@ public class Allocation extends BaseObj { * @param yoff * @param zoff * @param component_number - * @param array + * @param fp */ public void copyToFieldPacker(int xoff, int yoff, int zoff, int component_number, FieldPacker fp) { mRS.validate(); @@ -1501,7 +1500,6 @@ public class Allocation extends BaseObj { } /** - * @hide * Copy part of this Allocation into an array. This method does not * guarantee that the Allocation is compatible with the input buffer. * @@ -1516,7 +1514,6 @@ public class Allocation extends BaseObj { } /** - * @hide * Copy part of this Allocation into an array. This method does not * guarantee that the Allocation is compatible with the input buffer. * @@ -1529,7 +1526,6 @@ public class Allocation extends BaseObj { } /** - * @hide * Copy part of this Allocation into an array. This method does not * guarantee that the Allocation is compatible with the input buffer. * @@ -1542,7 +1538,6 @@ public class Allocation extends BaseObj { } /** - * @hide * Copy part of this Allocation into an array. This method does not * guarantee that the Allocation is compatible with the input buffer. * @@ -1555,7 +1550,6 @@ public class Allocation extends BaseObj { } /** - * @hide * Copy part of this Allocation into an array. This method does not * guarantee that the Allocation is compatible with the input buffer. * @@ -1569,7 +1563,6 @@ public class Allocation extends BaseObj { /** - * @hide * Copy part of this Allocation into an array. This method does not * and will generate exceptions if the Allocation type does not * match the component type of the array passed in. @@ -1585,7 +1578,6 @@ public class Allocation extends BaseObj { } /** - * @hide * Copy part of this Allocation into an array. This method does not * and will generate exceptions if the Allocation type is not a 32 bit * integer type. @@ -1600,7 +1592,6 @@ public class Allocation extends BaseObj { } /** - * @hide * Copy part of this Allocation into an array. This method does not * and will generate exceptions if the Allocation type is not a 16 bit * integer type. @@ -1615,7 +1606,6 @@ public class Allocation extends BaseObj { } /** - * @hide * Copy part of this Allocation into an array. This method does not * and will generate exceptions if the Allocation type is not an 8 bit * integer type. @@ -1630,7 +1620,6 @@ public class Allocation extends BaseObj { } /** - * @hide * Copy part of this Allocation into an array. This method does not * and will generate exceptions if the Allocation type is not a 32 bit float * type. @@ -1671,7 +1660,6 @@ public class Allocation extends BaseObj { } /** - * @hide * Copy from a rectangular region in this Allocation into an array. * * @param xoff X offset of the region to copy in this Allocation @@ -1687,7 +1675,6 @@ public class Allocation extends BaseObj { } /** - * @hide * Copy from a rectangular region in this Allocation into an array. * * @param xoff X offset of the region to copy in this Allocation @@ -1703,7 +1690,6 @@ public class Allocation extends BaseObj { } /** - * @hide * Copy from a rectangular region in this Allocation into an array. * * @param xoff X offset of the region to copy in this Allocation @@ -1719,7 +1705,6 @@ public class Allocation extends BaseObj { } /** - * @hide * Copy from a rectangular region in this Allocation into an array. * * @param xoff X offset of the region to copy in this Allocation @@ -1735,7 +1720,6 @@ public class Allocation extends BaseObj { } /** - * @hide * Copy from a rectangular region in this Allocation into an array. * * @param xoff X offset of the region to copy in this Allocation @@ -1752,8 +1736,11 @@ public class Allocation extends BaseObj { /** - * @hide + * Copy from a rectangular region in this Allocation into an array. + * The array is assumed to be tightly packed. * + * The data type of the array is not required to be the same as + * the element data type. */ private void copy3DRangeToUnchecked(int xoff, int yoff, int zoff, int w, int h, int d, Object array, Element.DataType dt, int arrayLen) { @@ -1780,8 +1767,7 @@ public class Allocation extends BaseObj { Trace.traceEnd(RenderScript.TRACE_TAG); } - /** - * @hide + /* * Copy from a rectangular region in this Allocation into an array. * * @param xoff X offset of the region to copy in this Allocation diff --git a/rs/java/android/renderscript/Element.java b/rs/java/android/renderscript/Element.java index 287b3f1..4b3e30f 100644 --- a/rs/java/android/renderscript/Element.java +++ b/rs/java/android/renderscript/Element.java @@ -114,13 +114,11 @@ public class Element extends BaseObj { * MATRIX the three matrix types contain FLOAT_32 elements and are treated * as 32 bits for alignment purposes. * - * RS_* objects. 32 bit opaque handles. + * RS_* objects: opaque handles with implementation dependent + * sizes. */ public enum DataType { NONE (0, 0), - /** - * @hide - */ FLOAT_16 (1, 2), FLOAT_32 (2, 4), FLOAT_64 (3, 8), @@ -389,9 +387,6 @@ public class Element extends BaseObj { return rs.mElement_I64; } - /** - * @hide - */ public static Element F16(RenderScript rs) { if(rs.mElement_F16 == null) { rs.mElement_F16 = createUser(rs, DataType.FLOAT_16); @@ -533,9 +528,6 @@ public class Element extends BaseObj { return rs.mElement_RGBA_8888; } - /** - * @hide - */ public static Element F16_2(RenderScript rs) { if(rs.mElement_HALF_2 == null) { rs.mElement_HALF_2 = createVector(rs, DataType.FLOAT_16, 2); @@ -543,9 +535,6 @@ public class Element extends BaseObj { return rs.mElement_HALF_2; } - /** - * @hide - */ public static Element F16_3(RenderScript rs) { if(rs.mElement_FLOAT_3 == null) { rs.mElement_FLOAT_3 = createVector(rs, DataType.FLOAT_16, 3); @@ -553,9 +542,6 @@ public class Element extends BaseObj { return rs.mElement_HALF_3; } - /** - * @hide - */ public static Element F16_4(RenderScript rs) { if(rs.mElement_HALF_4 == null) { rs.mElement_HALF_4 = createVector(rs, DataType.FLOAT_16, 4); diff --git a/rs/java/android/renderscript/FileA3D.java b/rs/java/android/renderscript/FileA3D.java index 4164810..9d8f162 100644 --- a/rs/java/android/renderscript/FileA3D.java +++ b/rs/java/android/renderscript/FileA3D.java @@ -145,6 +145,9 @@ public class FileA3D extends BaseObj { case MESH: entry.mLoadedObj = new Mesh(objectID, rs); break; + + default: + throw new RSRuntimeException("Unrecognized object type in file."); } entry.mLoadedObj.updateFromNative(); diff --git a/rs/java/android/renderscript/Mesh.java b/rs/java/android/renderscript/Mesh.java index 5b4cadb..13c8e1c 100644 --- a/rs/java/android/renderscript/Mesh.java +++ b/rs/java/android/renderscript/Mesh.java @@ -363,6 +363,9 @@ public class Mesh extends BaseObj { alloc = Allocation.createTyped(mRS, entry.t, mUsage); } else if(entry.e != null) { alloc = Allocation.createSized(mRS, entry.e, entry.size, mUsage); + } else { + // Should never happen because the builder will always set one + throw new IllegalStateException("Builder corrupt, no valid element in entry."); } vertexBuffers[ct] = alloc; vtx[ct] = alloc.getID(mRS); @@ -375,6 +378,9 @@ public class Mesh extends BaseObj { alloc = Allocation.createTyped(mRS, entry.t, mUsage); } else if(entry.e != null) { alloc = Allocation.createSized(mRS, entry.e, entry.size, mUsage); + } else { + // Should never happen because the builder will always set one + throw new IllegalStateException("Builder corrupt, no valid element in entry."); } long allocID = (alloc == null) ? 0 : alloc.getID(mRS); indexBuffers[ct] = alloc; diff --git a/rs/java/android/renderscript/RenderScript.java b/rs/java/android/renderscript/RenderScript.java index e8e942c..7ef17a7 100644 --- a/rs/java/android/renderscript/RenderScript.java +++ b/rs/java/android/renderscript/RenderScript.java @@ -139,7 +139,8 @@ public class RenderScript { * Returns an identifier that can be used to identify a particular * minor version of RS. * - * @hide + * @return The minor RenderScript version number + * */ public static long getMinorID() { return sMinorID; @@ -1321,7 +1322,6 @@ public class RenderScript { /** * Create a RenderScript context. * - * @hide * @param ctx The context. * @return RenderScript */ @@ -1418,14 +1418,13 @@ public class RenderScript { /** * Gets or creates a RenderScript context of the specified type. * - * @hide * @param ctx The context. * @param ct The type of context to be created. * @param sdkVersion The target SDK Version. * @param flags The OR of the CREATE_FLAG_* options desired * @return RenderScript */ - public static RenderScript create(Context ctx, int sdkVersion, ContextType ct, int flags) { + private static RenderScript create(Context ctx, int sdkVersion, ContextType ct, int flags) { if (sdkVersion < 23) { return internalCreate(ctx, sdkVersion, ct, flags); } @@ -1448,8 +1447,6 @@ public class RenderScript { } /** - * @hide - * * Releases all the process contexts. This is the same as * calling .destroy() on each unique context retreived with * create(...). If no contexts have been created this @@ -1486,7 +1483,6 @@ public class RenderScript { * * If you need a single context please use create() * - * @hide * @param ctx The context. * @return RenderScript */ diff --git a/rs/java/android/renderscript/Script.java b/rs/java/android/renderscript/Script.java index 65056ac..6a1efee 100644 --- a/rs/java/android/renderscript/Script.java +++ b/rs/java/android/renderscript/Script.java @@ -66,7 +66,6 @@ public class Script extends BaseObj { } /** - * @hide Pending API review * InvokeID is an identifier for an invoke function. It is used * as an identifier for ScriptGroup creation. * @@ -86,7 +85,6 @@ public class Script extends BaseObj { private final SparseArray<InvokeID> mIIDs = new SparseArray<InvokeID>(); /** - * @hide Pending API review * Only to be used by generated reflected classes. */ protected InvokeID createInvokeID(int slot) { @@ -222,22 +220,21 @@ public class Script extends BaseObj { /** * Only intended for use by generated reflected code. - * - * @hide */ protected void forEach(int slot, Allocation[] ains, Allocation aout, FieldPacker v) { + + // FieldPacker is kept here to support regular params in the future. forEach(slot, ains, aout, v, null); } /** * Only intended for use by generated reflected code. - * - * @hide */ protected void forEach(int slot, Allocation[] ains, Allocation aout, FieldPacker v, LaunchOptions sc) { // TODO: Is this necessary if nScriptForEach calls validate as well? + // FieldPacker is kept here to support regular params in the future. mRS.validate(); if (ains != null) { for (Allocation ain : ains) { @@ -476,7 +473,23 @@ public class Script extends BaseObj { /** - * Class used to specify clipping for a kernel launch. + * Class for specifying the specifics about how a kernel will be + * 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. + * + * 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. + * * */ public static final class LaunchOptions { diff --git a/rs/java/android/renderscript/Type.java b/rs/java/android/renderscript/Type.java index a58e42c..cc9b58b 100644 --- a/rs/java/android/renderscript/Type.java +++ b/rs/java/android/renderscript/Type.java @@ -150,24 +150,29 @@ public class Type extends BaseObj { } /** - * @hide - */ - public int getArray(int dim) { - if ((dim < 0) || (dim >= mMaxArrays)) { + * Return the dimension of the specified array. + * + * @param arrayNum The array dimension to query + * @return int + */ + public int getArray(int arrayNum) { + if ((arrayNum < 0) || (arrayNum >= mMaxArrays)) { throw new RSIllegalArgumentException("Array dimension out of range."); } - if (mArrays == null || dim >= mArrays.length) { + if (mArrays == null || arrayNum >= mArrays.length) { // Dimension in range but no array for that dimension allocated return 0; } - return mArrays[dim]; + return mArrays[arrayNum]; } /** - * @hide - */ + * Return the number of array dimensions. + * + * @return int + */ public int getArrayCount() { if (mArrays != null) return mArrays.length; return 0; @@ -377,7 +382,7 @@ public class Type extends BaseObj { } /** - * @hide + * Adds an array dimension to the builder * * @param dim * @param value |
