Merge "Docs plus removing some junk per API review." into honeycomb

This commit is contained in:
Alex Sakhartchouk
2011-01-13 16:27:23 -08:00
committed by Android (Google) Code Review
12 changed files with 107 additions and 166 deletions

View File

@@ -168910,52 +168910,6 @@
> >
</method> </method>
</class> </class>
<class name="FileA3D.ClassID"
extends="java.lang.Enum"
abstract="false"
static="true"
final="true"
deprecated="not deprecated"
visibility="public"
>
<method name="toClassID"
return="android.renderscript.FileA3D.ClassID"
abstract="false"
native="false"
synchronized="false"
static="true"
final="false"
deprecated="not deprecated"
visibility="public"
>
<parameter name="intID" type="int">
</parameter>
</method>
<method name="valueOf"
return="android.renderscript.FileA3D.ClassID"
abstract="false"
native="false"
synchronized="false"
static="true"
final="false"
deprecated="not deprecated"
visibility="public"
>
<parameter name="name" type="java.lang.String">
</parameter>
</method>
<method name="values"
return="android.renderscript.FileA3D.ClassID[]"
abstract="false"
native="false"
synchronized="false"
static="true"
final="true"
deprecated="not deprecated"
visibility="public"
>
</method>
</class>
<class name="FileA3D.EntryType" <class name="FileA3D.EntryType"
extends="java.lang.Enum" extends="java.lang.Enum"
abstract="false" abstract="false"
@@ -168997,17 +168951,6 @@
deprecated="not deprecated" deprecated="not deprecated"
visibility="public" visibility="public"
> >
<method name="getClassID"
return="android.renderscript.FileA3D.ClassID"
abstract="false"
native="false"
synchronized="false"
static="false"
final="false"
deprecated="not deprecated"
visibility="public"
>
</method>
<method name="getEntryType" <method name="getEntryType"
return="android.renderscript.FileA3D.EntryType" return="android.renderscript.FileA3D.EntryType"
abstract="false" abstract="false"

View File

@@ -169039,52 +169039,6 @@
> >
</method> </method>
</class> </class>
<class name="FileA3D.ClassID"
extends="java.lang.Enum"
abstract="false"
static="true"
final="true"
deprecated="not deprecated"
visibility="public"
>
<method name="toClassID"
return="android.renderscript.FileA3D.ClassID"
abstract="false"
native="false"
synchronized="false"
static="true"
final="false"
deprecated="not deprecated"
visibility="public"
>
<parameter name="intID" type="int">
</parameter>
</method>
<method name="valueOf"
return="android.renderscript.FileA3D.ClassID"
abstract="false"
native="false"
synchronized="false"
static="true"
final="false"
deprecated="not deprecated"
visibility="public"
>
<parameter name="name" type="java.lang.String">
</parameter>
</method>
<method name="values"
return="android.renderscript.FileA3D.ClassID[]"
abstract="false"
native="false"
synchronized="false"
static="true"
final="true"
deprecated="not deprecated"
visibility="public"
>
</method>
</class>
<class name="FileA3D.EntryType" <class name="FileA3D.EntryType"
extends="java.lang.Enum" extends="java.lang.Enum"
abstract="false" abstract="false"
@@ -169126,17 +169080,6 @@
deprecated="not deprecated" deprecated="not deprecated"
visibility="public" visibility="public"
> >
<method name="getClassID"
return="android.renderscript.FileA3D.ClassID"
abstract="false"
native="false"
synchronized="false"
static="false"
final="false"
deprecated="not deprecated"
visibility="public"
>
</method>
<method name="getEntryType" <method name="getEntryType"
return="android.renderscript.FileA3D.EntryType" return="android.renderscript.FileA3D.EntryType"
abstract="false" abstract="false"

View File

@@ -503,7 +503,7 @@ public class Allocation extends BaseObj {
* Creates a renderscript allocation with the size specified by * Creates a renderscript allocation with the size specified by
* the type and no mipmaps generated by default * the type and no mipmaps generated by default
* *
* @param rs * @param rs Context to which the allocation will belong.
* @param type renderscript type describing data layout * @param type renderscript type describing data layout
* @param usage bit field specifying how the allocation is * @param usage bit field specifying how the allocation is
* utilized * utilized
@@ -519,7 +519,7 @@ public class Allocation extends BaseObj {
* the size specified by the type and no mipmaps generated by * the size specified by the type and no mipmaps generated by
* default * default
* *
* @param rs * @param rs Context to which the allocation will belong.
* @param type renderscript type describing data layout * @param type renderscript type describing data layout
* *
* @return allocation * @return allocation
@@ -532,7 +532,7 @@ public class Allocation extends BaseObj {
* Creates a renderscript allocation with a specified number of * Creates a renderscript allocation with a specified number of
* given elements * given elements
* *
* @param rs * @param rs Context to which the allocation will belong.
* @param e describes what each element of an allocation is * @param e describes what each element of an allocation is
* @param count specifies the number of element in the allocation * @param count specifies the number of element in the allocation
* @param usage bit field specifying how the allocation is * @param usage bit field specifying how the allocation is
@@ -558,7 +558,7 @@ public class Allocation extends BaseObj {
* Creates a renderscript allocation with a specified number of * Creates a renderscript allocation with a specified number of
* given elements * given elements
* *
* @param rs * @param rs Context to which the allocation will belong.
* @param e describes what each element of an allocation is * @param e describes what each element of an allocation is
* @param count specifies the number of element in the allocation * @param count specifies the number of element in the allocation
* *
@@ -598,7 +598,7 @@ public class Allocation extends BaseObj {
/** /**
* Creates a renderscript allocation from a bitmap * Creates a renderscript allocation from a bitmap
* *
* @param rs * @param rs Context to which the allocation will belong.
* @param b bitmap source for the allocation data * @param b bitmap source for the allocation data
* @param mips specifies desired mipmap behaviour for the * @param mips specifies desired mipmap behaviour for the
* allocation * allocation
@@ -625,7 +625,7 @@ public class Allocation extends BaseObj {
* Creates a non-mipmapped renderscript allocation to use as a * Creates a non-mipmapped renderscript allocation to use as a
* graphics texture * graphics texture
* *
* @param rs * @param rs Context to which the allocation will belong.
* @param b bitmap source for the allocation data * @param b bitmap source for the allocation data
* *
* @return renderscript allocation containing bitmap data * @return renderscript allocation containing bitmap data
@@ -641,7 +641,7 @@ public class Allocation extends BaseObj {
* horizontal list of cube faces. Each individual face must be * horizontal list of cube faces. Each individual face must be
* the same size and power of 2 * the same size and power of 2
* *
* @param rs * @param rs Context to which the allocation will belong.
* @param b bitmap with cubemap faces layed out in the following * @param b bitmap with cubemap faces layed out in the following
* format: right, left, top, bottom, front, back * format: right, left, top, bottom, front, back
* @param mips specifies desired mipmap behaviour for the cubemap * @param mips specifies desired mipmap behaviour for the cubemap
@@ -690,7 +690,7 @@ public class Allocation extends BaseObj {
* of cube faces. Each individual face must be the same size and * of cube faces. Each individual face must be the same size and
* power of 2 * power of 2
* *
* @param rs * @param rs Context to which the allocation will belong.
* @param b bitmap with cubemap faces layed out in the following * @param b bitmap with cubemap faces layed out in the following
* format: right, left, top, bottom, front, back * format: right, left, top, bottom, front, back
* *
@@ -708,7 +708,7 @@ public class Allocation extends BaseObj {
* the cube faces. All the faces must be the same size and * the cube faces. All the faces must be the same size and
* power of 2 * power of 2
* *
* @param rs * @param rs Context to which the allocation will belong.
* @param xpos cubemap face in the positive x direction * @param xpos cubemap face in the positive x direction
* @param xneg cubemap face in the negative x direction * @param xneg cubemap face in the negative x direction
* @param ypos cubemap face in the positive y direction * @param ypos cubemap face in the positive y direction
@@ -776,7 +776,7 @@ public class Allocation extends BaseObj {
* the cube faces. All the faces must be the same size and * the cube faces. All the faces must be the same size and
* power of 2 * power of 2
* *
* @param rs * @param rs Context to which the allocation will belong.
* @param xpos cubemap face in the positive x direction * @param xpos cubemap face in the positive x direction
* @param xneg cubemap face in the negative x direction * @param xneg cubemap face in the negative x direction
* @param ypos cubemap face in the positive y direction * @param ypos cubemap face in the positive y direction
@@ -803,7 +803,7 @@ public class Allocation extends BaseObj {
* Creates a renderscript allocation from the bitmap referenced * Creates a renderscript allocation from the bitmap referenced
* by resource id * by resource id
* *
* @param rs * @param rs Context to which the allocation will belong.
* @param res application resources * @param res application resources
* @param id resource id to load the data from * @param id resource id to load the data from
* @param mips specifies desired mipmap behaviour for the * @param mips specifies desired mipmap behaviour for the
@@ -831,7 +831,7 @@ public class Allocation extends BaseObj {
* Creates a non-mipmapped renderscript allocation to use as a * Creates a non-mipmapped renderscript allocation to use as a
* graphics texture from the bitmap referenced by resource id * graphics texture from the bitmap referenced by resource id
* *
* @param rs * @param rs Context to which the allocation will belong.
* @param res application resources * @param res application resources
* @param id resource id to load the data from * @param id resource id to load the data from
* *
@@ -850,7 +850,7 @@ public class Allocation extends BaseObj {
* Creates a renderscript allocation containing string data * Creates a renderscript allocation containing string data
* encoded in UTF-8 format * encoded in UTF-8 format
* *
* @param rs * @param rs Context to which the allocation will belong.
* @param str string to create the allocation from * @param str string to create the allocation from
* @param usage bit field specifying how the allocaiton is * @param usage bit field specifying how the allocaiton is
* utilized * utilized

View File

@@ -28,22 +28,22 @@ import android.util.Log;
import android.util.TypedValue; import android.util.TypedValue;
/** /**
* FileA3D allows users to load renderscript objects from files
* or resources stored on disk. It could be used to load items
* such as 3d geometry data converted a renderscript format from
* content creation tools. Currently only meshes are supported
* in FileA3D.
*
* When successfully loaded, FileA3D will contain a list of
* index entries for all the objects stored inside it.
* *
**/ **/
public class FileA3D extends BaseObj { public class FileA3D extends BaseObj {
// This will go away in the clean up pass, /**
// trying to avoid multiproject submits * Specifies what renderscript object type is contained within
public enum ClassID { * the FileA3D IndexEntry
**/
UNKNOWN,
MESH;
public static ClassID toClassID(int intID) {
return ClassID.values()[intID];
}
}
public enum EntryType { public enum EntryType {
UNKNOWN (0), UNKNOWN (0),
@@ -59,34 +59,48 @@ public class FileA3D extends BaseObj {
} }
} }
// Read only class with index entries /**
* IndexEntry contains information about one of the renderscript
* objects inside the file's index. It could be used to query the
* object's type and name and load the object itself if
* necessary.
*/
public static class IndexEntry { public static class IndexEntry {
RenderScript mRS; RenderScript mRS;
int mIndex; int mIndex;
int mID; int mID;
String mName; String mName;
ClassID mClassID;
EntryType mEntryType; EntryType mEntryType;
BaseObj mLoadedObj; BaseObj mLoadedObj;
/**
* @return name of a renderscript object the index entry
* describes
*/
public String getName() { public String getName() {
return mName; return mName;
} }
public ClassID getClassID() { /**
return mClassID; * @return type of a renderscript object the index entry
} * describes
*/
public EntryType getEntryType() { public EntryType getEntryType() {
return mEntryType; return mEntryType;
} }
/**
* @return renderscript object described by the entry
*/
public BaseObj getObject() { public BaseObj getObject() {
mRS.validate(); mRS.validate();
BaseObj obj = internalCreate(mRS, this); BaseObj obj = internalCreate(mRS, this);
return obj; return obj;
} }
/**
* @return renderscript mesh object described by the entry
*/
public Mesh getMesh() { public Mesh getMesh() {
return (Mesh)getObject(); return (Mesh)getObject();
} }
@@ -122,7 +136,6 @@ public class FileA3D extends BaseObj {
mID = id; mID = id;
mName = name; mName = name;
mEntryType = type; mEntryType = type;
mClassID = mEntryType == EntryType.MESH ? ClassID.MESH : ClassID.UNKNOWN;
mLoadedObj = null; mLoadedObj = null;
} }
} }
@@ -152,6 +165,9 @@ public class FileA3D extends BaseObj {
} }
} }
/**
* @return the numberof objects stored inside a FileA3D
*/
public int getIndexEntryCount() { public int getIndexEntryCount() {
if(mFileEntries == null) { if(mFileEntries == null) {
return 0; return 0;
@@ -159,6 +175,12 @@ public class FileA3D extends BaseObj {
return mFileEntries.length; return mFileEntries.length;
} }
/**
* Returns an index entry from the list of all objects inside
* FileA3D
*
* @param index number of the entry from the list to return
*/
public IndexEntry getIndexEntry(int index) { public IndexEntry getIndexEntry(int index) {
if(getIndexEntryCount() == 0 || index < 0 || index >= mFileEntries.length) { if(getIndexEntryCount() == 0 || index < 0 || index >= mFileEntries.length) {
return null; return null;
@@ -166,6 +188,14 @@ public class FileA3D extends BaseObj {
return mFileEntries[index]; return mFileEntries[index];
} }
/**
* Creates a FileA3D object from an asset stored on disk
*
* @param rs Context to which the object will belong.
* @param mgr asset manager used to load asset
* @param path location of the file to load
*
*/
static public FileA3D createFromAsset(RenderScript rs, AssetManager mgr, String path) { static public FileA3D createFromAsset(RenderScript rs, AssetManager mgr, String path) {
rs.validate(); rs.validate();
int fileId = rs.nFileA3DCreateFromAsset(mgr, path); int fileId = rs.nFileA3DCreateFromAsset(mgr, path);
@@ -178,6 +208,13 @@ public class FileA3D extends BaseObj {
return fa3d; return fa3d;
} }
/**
* Creates a FileA3D object from a file stored on disk
*
* @param rs Context to which the object will belong.
* @param path location of the file to load
*
*/
static public FileA3D createFromFile(RenderScript rs, String path) { static public FileA3D createFromFile(RenderScript rs, String path) {
int fileId = rs.nFileA3DCreateFromFile(path); int fileId = rs.nFileA3DCreateFromFile(path);
@@ -189,10 +226,25 @@ public class FileA3D extends BaseObj {
return fa3d; return fa3d;
} }
/**
* Creates a FileA3D object from a file stored on disk
*
* @param rs Context to which the object will belong.
* @param path location of the file to load
*
*/
static public FileA3D createFromFile(RenderScript rs, File path) { static public FileA3D createFromFile(RenderScript rs, File path) {
return createFromFile(rs, path.getAbsolutePath()); return createFromFile(rs, path.getAbsolutePath());
} }
/**
* Creates a FileA3D object from an application resource
*
* @param rs Context to which the object will belong.
* @param res resource manager used for loading
* @param id resource to create FileA3D from
*
*/
static public FileA3D createFromResource(RenderScript rs, Resources res, int id) { static public FileA3D createFromResource(RenderScript rs, Resources res, int id) {
rs.validate(); rs.validate();

View File

@@ -172,7 +172,7 @@ public class Mesh extends BaseObj {
/** /**
* Creates builder object * Creates builder object
* @param rs * @param rs Context to which the mesh will belong.
* @param usage specifies how the mesh allocations are to be * @param usage specifies how the mesh allocations are to be
* handled, whether they need to be uploaded to a * handled, whether they need to be uploaded to a
* buffer on the gpu, maintain a cpu copy, etc * buffer on the gpu, maintain a cpu copy, etc
@@ -512,7 +512,7 @@ public class Mesh extends BaseObj {
public static final int TEXTURE_0 = 0x0100; public static final int TEXTURE_0 = 0x0100;
/** /**
* @param rs * @param rs Context to which the mesh will belong.
* @param vtxSize specifies whether the vertex is a float2 or * @param vtxSize specifies whether the vertex is a float2 or
* float3 * float3
* @param flags bitfield that is a combination of COLOR, NORMAL, * @param flags bitfield that is a combination of COLOR, NORMAL,

View File

@@ -36,7 +36,7 @@ public class ProgramFragment extends Program {
/** /**
* Create a builder object. * Create a builder object.
* *
* @param rs * @param rs Context to which the program will belong.
*/ */
public Builder(RenderScript rs) { public Builder(RenderScript rs) {
super(rs); super(rs);

View File

@@ -194,7 +194,7 @@ public class ProgramFragmentFixedFunction extends ProgramFragment {
/** /**
* Creates a builder for fixed function fragment program * Creates a builder for fixed function fragment program
* *
* @param rs * @param rs Context to which the program will belong.
*/ */
public Builder(RenderScript rs) { public Builder(RenderScript rs) {
mRS = rs; mRS = rs;

View File

@@ -149,7 +149,7 @@ public class ProgramStore extends BaseObj {
* - incoming pixels override the value stored in the color * - incoming pixels override the value stored in the color
* buffer if it passes the depth test * buffer if it passes the depth test
* *
* @param rs * @param rs Context to which the program will belong.
**/ **/
public static ProgramStore BLEND_NONE_DEPTH_TEST(RenderScript rs) { public static ProgramStore BLEND_NONE_DEPTH_TEST(RenderScript rs) {
if(rs.mProgramStore_BLEND_NONE_DEPTH_TEST == null) { if(rs.mProgramStore_BLEND_NONE_DEPTH_TEST == null) {
@@ -170,7 +170,7 @@ public class ProgramStore extends BaseObj {
* - incoming pixels override the value stored in the color * - incoming pixels override the value stored in the color
* buffer * buffer
* *
* @param rs * @param rs Context to which the program will belong.
**/ **/
public static ProgramStore BLEND_NONE_DEPTH_NONE(RenderScript rs) { public static ProgramStore BLEND_NONE_DEPTH_NONE(RenderScript rs) {
if(rs.mProgramStore_BLEND_NONE_DEPTH_NO_DEPTH == null) { if(rs.mProgramStore_BLEND_NONE_DEPTH_NO_DEPTH == null) {
@@ -194,7 +194,7 @@ public class ProgramStore extends BaseObj {
* following formula * following formula
* Final.RGB = Source.RGB * Source.A + Dest.RGB * (1 - Source.A) * Final.RGB = Source.RGB * Source.A + Dest.RGB * (1 - Source.A)
* *
* @param rs * @param rs Context to which the program will belong.
**/ **/
public static ProgramStore BLEND_ALPHA_DEPTH_TEST(RenderScript rs) { public static ProgramStore BLEND_ALPHA_DEPTH_TEST(RenderScript rs) {
if(rs.mProgramStore_BLEND_ALPHA_DEPTH_TEST == null) { if(rs.mProgramStore_BLEND_ALPHA_DEPTH_TEST == null) {
@@ -216,7 +216,7 @@ public class ProgramStore extends BaseObj {
* (Dest) using the following formula * (Dest) using the following formula
* Final.RGB = Source.RGB * Source.A + Dest.RGB * (1 - Source.A) * Final.RGB = Source.RGB * Source.A + Dest.RGB * (1 - Source.A)
* *
* @param rs * @param rs Context to which the program will belong.
**/ **/
public static ProgramStore BLEND_ALPHA_DEPTH_NONE(RenderScript rs) { public static ProgramStore BLEND_ALPHA_DEPTH_NONE(RenderScript rs) {
if(rs.mProgramStore_BLEND_ALPHA_DEPTH_NO_DEPTH == null) { if(rs.mProgramStore_BLEND_ALPHA_DEPTH_NO_DEPTH == null) {

View File

@@ -46,7 +46,7 @@ public class ProgramVertex extends Program {
/** /**
* Create a builder object. * Create a builder object.
* *
* @param rs * @param rs Context to which the program will belong.
*/ */
public Builder(RenderScript rs) { public Builder(RenderScript rs) {
super(rs); super(rs);

View File

@@ -105,7 +105,7 @@ public class ProgramVertexFixedFunction extends ProgramVertex {
/** /**
* Creates a builder for fixed function vertex program * Creates a builder for fixed function vertex program
* *
* @param rs * @param rs Context to which the program will belong.
*/ */
public Builder(RenderScript rs) { public Builder(RenderScript rs) {
mRS = rs; mRS = rs;
@@ -196,9 +196,9 @@ public class ProgramVertexFixedFunction extends ProgramVertex {
private FieldPacker mIOBuffer; private FieldPacker mIOBuffer;
/** /**
* Creates buffer to store fixed function emulation matrices * Creates a buffer to store fixed function emulation matrices
* *
* @param rs * @param rs Context to which the allocation will belong.
**/ **/
public Constants(RenderScript rs) { public Constants(RenderScript rs) {
Type constInputType = ProgramVertexFixedFunction.Builder.getConstantInputType(rs); Type constInputType = ProgramVertexFixedFunction.Builder.getConstantInputType(rs);

View File

@@ -56,7 +56,7 @@ public class Sampler extends BaseObj {
* Retrieve a sampler with min and mag set to nearest and wrap modes set to * Retrieve a sampler with min and mag set to nearest and wrap modes set to
* clamp. * clamp.
* *
* @param rs * @param rs Context to which the sampler will belong.
* *
* @return Sampler * @return Sampler
*/ */
@@ -76,7 +76,7 @@ public class Sampler extends BaseObj {
* Retrieve a sampler with min and mag set to linear and wrap modes set to * Retrieve a sampler with min and mag set to linear and wrap modes set to
* clamp. * clamp.
* *
* @param rs * @param rs Context to which the sampler will belong.
* *
* @return Sampler * @return Sampler
*/ */
@@ -96,7 +96,7 @@ public class Sampler extends BaseObj {
* Retrieve a sampler with ag set to linear, min linear mipmap linear, and * Retrieve a sampler with ag set to linear, min linear mipmap linear, and
* to and wrap modes set to clamp. * to and wrap modes set to clamp.
* *
* @param rs * @param rs Context to which the sampler will belong.
* *
* @return Sampler * @return Sampler
*/ */
@@ -116,7 +116,7 @@ public class Sampler extends BaseObj {
* Retrieve a sampler with min and mag set to nearest and wrap modes set to * Retrieve a sampler with min and mag set to nearest and wrap modes set to
* wrap. * wrap.
* *
* @param rs * @param rs Context to which the sampler will belong.
* *
* @return Sampler * @return Sampler
*/ */
@@ -136,7 +136,7 @@ public class Sampler extends BaseObj {
* Retrieve a sampler with min and mag set to nearest and wrap modes set to * Retrieve a sampler with min and mag set to nearest and wrap modes set to
* wrap. * wrap.
* *
* @param rs * @param rs Context to which the sampler will belong.
* *
* @return Sampler * @return Sampler
*/ */
@@ -156,7 +156,7 @@ public class Sampler extends BaseObj {
* Retrieve a sampler with ag set to linear, min linear mipmap linear, and * Retrieve a sampler with ag set to linear, min linear mipmap linear, and
* to and wrap modes set to wrap. * to and wrap modes set to wrap.
* *
* @param rs * @param rs Context to which the sampler will belong.
* *
* @return Sampler * @return Sampler
*/ */

View File

@@ -119,11 +119,12 @@ public:
mutable const ObjectBase * mObjHead; mutable const ObjectBase * mObjHead;
bool ext_OES_texture_npot() const {return mGL.OES_texture_npot;} bool ext_OES_texture_npot() const {return mGL.OES_texture_npot;}
bool ext_GL_NV_texture_npot_2D_mipmap() const {return false;} bool ext_GL_NV_texture_npot_2D_mipmap() const {return mGL.GL_NV_texture_npot_2D_mipmap;}
float ext_texture_max_aniso() const {return 1.0f;} float ext_texture_max_aniso() const {return mGL.EXT_texture_max_aniso; }
uint32_t getMaxFragmentTextures() const {return mGL.mMaxFragmentTextureImageUnits;} uint32_t getMaxFragmentTextures() const {return mGL.mMaxFragmentTextureImageUnits;}
uint32_t getMaxFragmentUniformVectors() const {return mGL.mMaxFragmentUniformVectors;} uint32_t getMaxFragmentUniformVectors() const {return mGL.mMaxFragmentUniformVectors;}
uint32_t getMaxVertexUniformVectors() const {return mGL.mMaxVertexUniformVectors;} uint32_t getMaxVertexUniformVectors() const {return mGL.mMaxVertexUniformVectors;}
uint32_t getMaxVertexAttributes() const {return mGL.mMaxVertexAttribs;}
protected: protected:
@@ -147,6 +148,8 @@ protected:
int32_t mMaxVertexTextureUnits; int32_t mMaxVertexTextureUnits;
bool OES_texture_npot; bool OES_texture_npot;
bool GL_NV_texture_npot_2D_mipmap;
float EXT_texture_max_aniso;
} mGL; } mGL;
}; };