Merge "Add @UnsupportedAppUsage annotations"

This commit is contained in:
Treehugger Robot
2018-08-06 12:11:30 +00:00
committed by Gerrit Code Review
19 changed files with 115 additions and 90 deletions

View File

@@ -4254,96 +4254,6 @@ Landroid/R$styleable;->View_visibility:I
Landroid/R$styleable;->Window:[I Landroid/R$styleable;->Window:[I
Landroid/R$styleable;->Window_windowBackground:I Landroid/R$styleable;->Window_windowBackground:I
Landroid/R$styleable;->Window_windowFrame:I Landroid/R$styleable;->Window_windowFrame:I
Landroid/renderscript/BaseObj;->mRS:Landroid/renderscript/RenderScript;
Landroid/renderscript/Element;->createUser(Landroid/renderscript/RenderScript;Landroid/renderscript/Element$DataType;)Landroid/renderscript/Element;
Landroid/renderscript/FileA3D$EntryType;->MESH:Landroid/renderscript/FileA3D$EntryType;
Landroid/renderscript/FileA3D$IndexEntry;->getEntryType()Landroid/renderscript/FileA3D$EntryType;
Landroid/renderscript/FileA3D$IndexEntry;->getObject()Landroid/renderscript/BaseObj;
Landroid/renderscript/FileA3D;->createFromResource(Landroid/renderscript/RenderScript;Landroid/content/res/Resources;I)Landroid/renderscript/FileA3D;
Landroid/renderscript/FileA3D;->getIndexEntry(I)Landroid/renderscript/FileA3D$IndexEntry;
Landroid/renderscript/Font$Style;->ITALIC:Landroid/renderscript/Font$Style;
Landroid/renderscript/Font;->create(Landroid/renderscript/RenderScript;Landroid/content/res/Resources;Ljava/lang/String;Landroid/renderscript/Font$Style;F)Landroid/renderscript/Font;
Landroid/renderscript/Matrix4f;->mMat:[F
Landroid/renderscript/Mesh$AllocationBuilder;-><init>(Landroid/renderscript/RenderScript;)V
Landroid/renderscript/Mesh$AllocationBuilder;->addIndexSetAllocation(Landroid/renderscript/Allocation;Landroid/renderscript/Mesh$Primitive;)Landroid/renderscript/Mesh$AllocationBuilder;
Landroid/renderscript/Mesh$AllocationBuilder;->addIndexSetType(Landroid/renderscript/Mesh$Primitive;)Landroid/renderscript/Mesh$AllocationBuilder;
Landroid/renderscript/Mesh$AllocationBuilder;->addVertexAllocation(Landroid/renderscript/Allocation;)Landroid/renderscript/Mesh$AllocationBuilder;
Landroid/renderscript/Mesh$AllocationBuilder;->create()Landroid/renderscript/Mesh;
Landroid/renderscript/Mesh$Primitive;->POINT:Landroid/renderscript/Mesh$Primitive;
Landroid/renderscript/Mesh$Primitive;->TRIANGLE:Landroid/renderscript/Mesh$Primitive;
Landroid/renderscript/Mesh$TriangleMeshBuilder;-><init>(Landroid/renderscript/RenderScript;II)V
Landroid/renderscript/Mesh$TriangleMeshBuilder;->addTriangle(III)Landroid/renderscript/Mesh$TriangleMeshBuilder;
Landroid/renderscript/Mesh$TriangleMeshBuilder;->addVertex(FF)Landroid/renderscript/Mesh$TriangleMeshBuilder;
Landroid/renderscript/Mesh$TriangleMeshBuilder;->create(Z)Landroid/renderscript/Mesh;
Landroid/renderscript/Mesh;->getVertexAllocation(I)Landroid/renderscript/Allocation;
Landroid/renderscript/Program$BaseProgramBuilder;-><init>(Landroid/renderscript/RenderScript;)V
Landroid/renderscript/Program$BaseProgramBuilder;->mConstantCount:I
Landroid/renderscript/Program$BaseProgramBuilder;->mConstants:[Landroid/renderscript/Type;
Landroid/renderscript/Program$BaseProgramBuilder;->mInputCount:I
Landroid/renderscript/Program$BaseProgramBuilder;->mInputs:[Landroid/renderscript/Element;
Landroid/renderscript/Program$BaseProgramBuilder;->mOutputCount:I
Landroid/renderscript/Program$BaseProgramBuilder;->mOutputs:[Landroid/renderscript/Element;
Landroid/renderscript/Program$BaseProgramBuilder;->mRS:Landroid/renderscript/RenderScript;
Landroid/renderscript/Program$BaseProgramBuilder;->mShader:Ljava/lang/String;
Landroid/renderscript/Program$BaseProgramBuilder;->mTextureCount:I
Landroid/renderscript/Program$TextureType;->TEXTURE_2D:Landroid/renderscript/Program$TextureType;
Landroid/renderscript/ProgramFragment$Builder;-><init>(Landroid/renderscript/RenderScript;)V
Landroid/renderscript/ProgramFragment$Builder;->create()Landroid/renderscript/ProgramFragment;
Landroid/renderscript/ProgramFragmentFixedFunction$Builder$EnvMode;->MODULATE:Landroid/renderscript/ProgramFragmentFixedFunction$Builder$EnvMode;
Landroid/renderscript/ProgramFragmentFixedFunction$Builder$EnvMode;->REPLACE:Landroid/renderscript/ProgramFragmentFixedFunction$Builder$EnvMode;
Landroid/renderscript/ProgramFragmentFixedFunction$Builder$Format;->ALPHA:Landroid/renderscript/ProgramFragmentFixedFunction$Builder$Format;
Landroid/renderscript/ProgramFragmentFixedFunction$Builder$Format;->RGB:Landroid/renderscript/ProgramFragmentFixedFunction$Builder$Format;
Landroid/renderscript/ProgramFragmentFixedFunction$Builder$Format;->RGBA:Landroid/renderscript/ProgramFragmentFixedFunction$Builder$Format;
Landroid/renderscript/ProgramFragmentFixedFunction$Builder;-><init>(Landroid/renderscript/RenderScript;)V
Landroid/renderscript/ProgramFragmentFixedFunction$Builder;->create()Landroid/renderscript/ProgramFragmentFixedFunction;
Landroid/renderscript/ProgramFragmentFixedFunction$Builder;->setTexture(Landroid/renderscript/ProgramFragmentFixedFunction$Builder$EnvMode;Landroid/renderscript/ProgramFragmentFixedFunction$Builder$Format;I)Landroid/renderscript/ProgramFragmentFixedFunction$Builder;
Landroid/renderscript/ProgramFragmentFixedFunction$Builder;->setVaryingColor(Z)Landroid/renderscript/ProgramFragmentFixedFunction$Builder;
Landroid/renderscript/ProgramRaster$Builder;-><init>(Landroid/renderscript/RenderScript;)V
Landroid/renderscript/ProgramRaster$Builder;->create()Landroid/renderscript/ProgramRaster;
Landroid/renderscript/ProgramRaster$Builder;->setPointSpriteEnabled(Z)Landroid/renderscript/ProgramRaster$Builder;
Landroid/renderscript/ProgramStore$BlendDstFunc;->ONE:Landroid/renderscript/ProgramStore$BlendDstFunc;
Landroid/renderscript/ProgramStore$BlendDstFunc;->ONE_MINUS_SRC_ALPHA:Landroid/renderscript/ProgramStore$BlendDstFunc;
Landroid/renderscript/ProgramStore$BlendDstFunc;->ZERO:Landroid/renderscript/ProgramStore$BlendDstFunc;
Landroid/renderscript/ProgramStore$BlendSrcFunc;->ONE:Landroid/renderscript/ProgramStore$BlendSrcFunc;
Landroid/renderscript/ProgramStore$BlendSrcFunc;->SRC_ALPHA:Landroid/renderscript/ProgramStore$BlendSrcFunc;
Landroid/renderscript/ProgramStore$Builder;-><init>(Landroid/renderscript/RenderScript;)V
Landroid/renderscript/ProgramStore$Builder;->create()Landroid/renderscript/ProgramStore;
Landroid/renderscript/ProgramStore$Builder;->setBlendFunc(Landroid/renderscript/ProgramStore$BlendSrcFunc;Landroid/renderscript/ProgramStore$BlendDstFunc;)Landroid/renderscript/ProgramStore$Builder;
Landroid/renderscript/ProgramStore$Builder;->setDepthFunc(Landroid/renderscript/ProgramStore$DepthFunc;)Landroid/renderscript/ProgramStore$Builder;
Landroid/renderscript/ProgramStore$Builder;->setDepthMaskEnabled(Z)Landroid/renderscript/ProgramStore$Builder;
Landroid/renderscript/ProgramStore$Builder;->setDitherEnabled(Z)Landroid/renderscript/ProgramStore$Builder;
Landroid/renderscript/ProgramStore$DepthFunc;->ALWAYS:Landroid/renderscript/ProgramStore$DepthFunc;
Landroid/renderscript/ProgramStore$DepthFunc;->LESS:Landroid/renderscript/ProgramStore$DepthFunc;
Landroid/renderscript/ProgramStore;->BLEND_ALPHA_DEPTH_NONE(Landroid/renderscript/RenderScript;)Landroid/renderscript/ProgramStore;
Landroid/renderscript/ProgramVertex$Builder;-><init>(Landroid/renderscript/RenderScript;)V
Landroid/renderscript/ProgramVertex$Builder;->addInput(Landroid/renderscript/Element;)Landroid/renderscript/ProgramVertex$Builder;
Landroid/renderscript/ProgramVertex$Builder;->create()Landroid/renderscript/ProgramVertex;
Landroid/renderscript/ProgramVertexFixedFunction$Builder;-><init>(Landroid/renderscript/RenderScript;)V
Landroid/renderscript/ProgramVertexFixedFunction$Builder;->create()Landroid/renderscript/ProgramVertexFixedFunction;
Landroid/renderscript/ProgramVertexFixedFunction$Constants;-><init>(Landroid/renderscript/RenderScript;)V
Landroid/renderscript/ProgramVertexFixedFunction$Constants;->setProjection(Landroid/renderscript/Matrix4f;)V
Landroid/renderscript/ProgramVertexFixedFunction;->bindConstants(Landroid/renderscript/ProgramVertexFixedFunction$Constants;)V
Landroid/renderscript/RenderScript;->create(Landroid/content/Context;I)Landroid/renderscript/RenderScript;
Landroid/renderscript/RenderScript;->create(Landroid/content/Context;ILandroid/renderscript/RenderScript$ContextType;I)Landroid/renderscript/RenderScript;
Landroid/renderscript/RenderScript;->getMinorID()J
Landroid/renderscript/RenderScript;->mMessageCallback:Landroid/renderscript/RenderScript$RSMessageHandler;
Landroid/renderscript/RenderScript;->nScriptCCreate(Ljava/lang/String;Ljava/lang/String;[BI)J
Landroid/renderscript/RenderScript;->sPointerSize:I
Landroid/renderscript/RenderScript;->validate()V
Landroid/renderscript/RenderScriptCacheDir;->mCacheDir:Ljava/io/File;
Landroid/renderscript/RenderScriptCacheDir;->setupDiskCache(Ljava/io/File;)V
Landroid/renderscript/RenderScriptGL$SurfaceConfig;-><init>()V
Landroid/renderscript/RenderScriptGL$SurfaceConfig;->setDepth(II)V
Landroid/renderscript/RenderScriptGL;-><init>(Landroid/content/Context;Landroid/renderscript/RenderScriptGL$SurfaceConfig;)V
Landroid/renderscript/RenderScriptGL;->bindProgramRaster(Landroid/renderscript/ProgramRaster;)V
Landroid/renderscript/RenderScriptGL;->bindProgramStore(Landroid/renderscript/ProgramStore;)V
Landroid/renderscript/RenderScriptGL;->bindProgramVertex(Landroid/renderscript/ProgramVertex;)V
Landroid/renderscript/RenderScriptGL;->bindRootScript(Landroid/renderscript/Script;)V
Landroid/renderscript/RenderScriptGL;->setSurface(Landroid/view/SurfaceHolder;II)V
Landroid/renderscript/RSSurfaceView;-><init>(Landroid/content/Context;)V
Landroid/renderscript/RSSurfaceView;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;)V
Landroid/renderscript/Script$Builder;-><init>(Landroid/renderscript/RenderScript;)V
Landroid/renderscript/Script$Builder;->mRS:Landroid/renderscript/RenderScript;
Landroid/security/Credentials;->convertToPem([Ljava/security/cert/Certificate;)[B Landroid/security/Credentials;->convertToPem([Ljava/security/cert/Certificate;)[B
Landroid/security/Credentials;->getInstance()Landroid/security/Credentials; Landroid/security/Credentials;->getInstance()Landroid/security/Credentials;
Landroid/security/Credentials;->install(Landroid/content/Context;Ljava/lang/String;[B)V Landroid/security/Credentials;->install(Landroid/content/Context;Ljava/lang/String;[B)V

View File

@@ -16,6 +16,7 @@
package android.renderscript; package android.renderscript;
import android.annotation.UnsupportedAppUsage;
import dalvik.system.CloseGuard; import dalvik.system.CloseGuard;
import java.util.concurrent.locks.ReentrantReadWriteLock; import java.util.concurrent.locks.ReentrantReadWriteLock;
@@ -73,6 +74,7 @@ public class BaseObj {
final CloseGuard guard = CloseGuard.get(); final CloseGuard guard = CloseGuard.get();
private boolean mDestroyed; private boolean mDestroyed;
private String mName; private String mName;
@UnsupportedAppUsage
RenderScript mRS; RenderScript mRS;
/** /**

View File

@@ -16,6 +16,8 @@
package android.renderscript; package android.renderscript;
import android.annotation.UnsupportedAppUsage;
/** /**
* <p>An Element represents one item within an {@link * <p>An Element represents one item within an {@link
* android.renderscript.Allocation}. An Element is roughly equivalent to a C * android.renderscript.Allocation}. An Element is roughly equivalent to a C
@@ -1146,6 +1148,7 @@ public class Element extends BaseObj {
* @param dt The DataType for the new element. * @param dt The DataType for the new element.
* @return Element * @return Element
*/ */
@UnsupportedAppUsage
static Element createUser(RenderScript rs, DataType dt) { static Element createUser(RenderScript rs, DataType dt) {
DataKind dk = DataKind.USER; DataKind dk = DataKind.USER;
boolean norm = false; boolean norm = false;

View File

@@ -19,6 +19,7 @@ package android.renderscript;
import java.io.File; import java.io.File;
import java.io.InputStream; import java.io.InputStream;
import android.annotation.UnsupportedAppUsage;
import android.content.res.AssetManager; import android.content.res.AssetManager;
import android.content.res.Resources; import android.content.res.Resources;
@@ -53,6 +54,7 @@ public class FileA3D extends BaseObj {
* @deprecated in API 16 * @deprecated in API 16
* RenderScript Mesh object * RenderScript Mesh object
**/ **/
@UnsupportedAppUsage
MESH (1); MESH (1);
int mID; int mID;
@@ -100,6 +102,7 @@ public class FileA3D extends BaseObj {
* @return type of a renderscript object the index entry * @return type of a renderscript object the index entry
* describes * describes
*/ */
@UnsupportedAppUsage
public EntryType getEntryType() { public EntryType getEntryType() {
return mEntryType; return mEntryType;
} }
@@ -109,6 +112,7 @@ public class FileA3D extends BaseObj {
* Used to load the object described by the index entry * Used to load the object described by the index entry
* @return base renderscript object described by the entry * @return base renderscript object described by the entry
*/ */
@UnsupportedAppUsage
public BaseObj getObject() { public BaseObj getObject() {
mRS.validate(); mRS.validate();
BaseObj obj = internalCreate(mRS, this); BaseObj obj = internalCreate(mRS, this);
@@ -212,6 +216,7 @@ public class FileA3D extends BaseObj {
* *
* @return entry in the a3d file described by the index * @return entry in the a3d file described by the index
*/ */
@UnsupportedAppUsage
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;
@@ -284,6 +289,7 @@ public class FileA3D extends BaseObj {
* *
* @return a3d file containing renderscript objects * @return a3d file containing renderscript objects
*/ */
@UnsupportedAppUsage
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

@@ -23,6 +23,7 @@ import java.util.Map;
import android.os.Environment; import android.os.Environment;
import android.annotation.UnsupportedAppUsage;
import android.content.res.AssetManager; import android.content.res.AssetManager;
import android.content.res.Resources; import android.content.res.Resources;
@@ -85,6 +86,7 @@ public class Font extends BaseObj {
/** /**
* @deprecated in API 16 * @deprecated in API 16
*/ */
@UnsupportedAppUsage
ITALIC, ITALIC,
/** /**
* @deprecated in API 16 * @deprecated in API 16
@@ -236,6 +238,7 @@ public class Font extends BaseObj {
* *
* Returns default font if no match could be found. * Returns default font if no match could be found.
*/ */
@UnsupportedAppUsage
static public Font create(RenderScript rs, Resources res, String familyName, Style fontStyle, float pointSize) { static public Font create(RenderScript rs, Resources res, String familyName, Style fontStyle, float pointSize) {
String fileName = getFontFileName(familyName, fontStyle); String fileName = getFontFileName(familyName, fontStyle);
String fontPath = Environment.getRootDirectory().getAbsolutePath(); String fontPath = Environment.getRootDirectory().getAbsolutePath();

View File

@@ -16,6 +16,7 @@
package android.renderscript; package android.renderscript;
import android.annotation.UnsupportedAppUsage;
import java.lang.Math; import java.lang.Math;
@@ -489,5 +490,6 @@ public class Matrix4f {
} }
} }
@UnsupportedAppUsage
final float[] mMat; final float[] mMat;
} }

View File

@@ -16,6 +16,7 @@
package android.renderscript; package android.renderscript;
import android.annotation.UnsupportedAppUsage;
import java.util.Vector; import java.util.Vector;
/** /**
@@ -49,6 +50,7 @@ public class Mesh extends BaseObj {
* @deprecated in API 16 * @deprecated in API 16
* Vertex data will be rendered as a series of points * Vertex data will be rendered as a series of points
*/ */
@UnsupportedAppUsage
POINT (0), POINT (0),
/** /**
* @deprecated in API 16 * @deprecated in API 16
@@ -64,6 +66,7 @@ public class Mesh extends BaseObj {
* @deprecated in API 16 * @deprecated in API 16
* Vertices will be rendered as individual triangles * Vertices will be rendered as individual triangles
*/ */
@UnsupportedAppUsage
TRIANGLE (3), TRIANGLE (3),
/** /**
* @deprecated in API 16 * @deprecated in API 16
@@ -111,6 +114,7 @@ public class Mesh extends BaseObj {
* @return vertex data allocation at the given index * @return vertex data allocation at the given index
* *
**/ **/
@UnsupportedAppUsage
public Allocation getVertexAllocation(int slot) { public Allocation getVertexAllocation(int slot) {
return mVertexBuffers[slot]; return mVertexBuffers[slot];
} }
@@ -424,6 +428,7 @@ public class Mesh extends BaseObj {
/** /**
* @deprecated in API 16 * @deprecated in API 16
**/ **/
@UnsupportedAppUsage
public AllocationBuilder(RenderScript rs) { public AllocationBuilder(RenderScript rs) {
mRS = rs; mRS = rs;
mVertexTypeCount = 0; mVertexTypeCount = 0;
@@ -458,6 +463,7 @@ public class Mesh extends BaseObj {
* *
* @return this * @return this
**/ **/
@UnsupportedAppUsage
public AllocationBuilder addVertexAllocation(Allocation a) throws IllegalStateException { public AllocationBuilder addVertexAllocation(Allocation a) throws IllegalStateException {
if (mVertexTypeCount >= mVertexTypes.length) { if (mVertexTypeCount >= mVertexTypes.length) {
throw new IllegalStateException("Max vertex types exceeded."); throw new IllegalStateException("Max vertex types exceeded.");
@@ -479,6 +485,7 @@ public class Mesh extends BaseObj {
* *
* @return this * @return this
**/ **/
@UnsupportedAppUsage
public AllocationBuilder addIndexSetAllocation(Allocation a, Primitive p) { public AllocationBuilder addIndexSetAllocation(Allocation a, Primitive p) {
Entry indexType = new Entry(); Entry indexType = new Entry();
indexType.a = a; indexType.a = a;
@@ -495,6 +502,7 @@ public class Mesh extends BaseObj {
* *
* @return this * @return this
**/ **/
@UnsupportedAppUsage
public AllocationBuilder addIndexSetType(Primitive p) { public AllocationBuilder addIndexSetType(Primitive p) {
Entry indexType = new Entry(); Entry indexType = new Entry();
indexType.a = null; indexType.a = null;
@@ -508,6 +516,7 @@ public class Mesh extends BaseObj {
* Create a Mesh object from the current state of the builder * Create a Mesh object from the current state of the builder
* *
**/ **/
@UnsupportedAppUsage
public Mesh create() { public Mesh create() {
mRS.validate(); mRS.validate();
@@ -596,6 +605,7 @@ public class Mesh extends BaseObj {
* channels are present in the mesh * channels are present in the mesh
* *
**/ **/
@UnsupportedAppUsage
public TriangleMeshBuilder(RenderScript rs, int vtxSize, int flags) { public TriangleMeshBuilder(RenderScript rs, int vtxSize, int flags) {
mRS = rs; mRS = rs;
mVtxCount = 0; mVtxCount = 0;
@@ -652,6 +662,7 @@ public class Mesh extends BaseObj {
* @return this * @return this
* *
**/ **/
@UnsupportedAppUsage
public TriangleMeshBuilder addVertex(float x, float y) { public TriangleMeshBuilder addVertex(float x, float y) {
if (mVtxSize != 2) { if (mVtxSize != 2) {
throw new IllegalStateException("add mistmatch with declared components."); throw new IllegalStateException("add mistmatch with declared components.");
@@ -757,6 +768,7 @@ public class Mesh extends BaseObj {
* *
* @return this * @return this
**/ **/
@UnsupportedAppUsage
public TriangleMeshBuilder addTriangle(int idx1, int idx2, int idx3) { public TriangleMeshBuilder addTriangle(int idx1, int idx2, int idx3) {
if((idx1 >= mMaxIndex) || (idx1 < 0) || if((idx1 >= mMaxIndex) || (idx1 < 0) ||
(idx2 >= mMaxIndex) || (idx2 < 0) || (idx2 >= mMaxIndex) || (idx2 < 0) ||
@@ -789,6 +801,7 @@ public class Mesh extends BaseObj {
* accessible memory * accessible memory
* *
**/ **/
@UnsupportedAppUsage
public Mesh create(boolean uploadToBufferObject) { public Mesh create(boolean uploadToBufferObject) {
Element.Builder b = new Element.Builder(mRS); Element.Builder b = new Element.Builder(mRS);
b.add(Element.createVector(mRS, b.add(Element.createVector(mRS,

View File

@@ -21,6 +21,7 @@ import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.io.UnsupportedEncodingException; import java.io.UnsupportedEncodingException;
import android.annotation.UnsupportedAppUsage;
import android.content.res.Resources; import android.content.res.Resources;
import android.util.Log; import android.util.Log;
@@ -45,6 +46,7 @@ public class Program extends BaseObj {
* *
**/ **/
public enum TextureType { public enum TextureType {
@UnsupportedAppUsage
TEXTURE_2D (0), TEXTURE_2D (0),
TEXTURE_CUBE (1); TEXTURE_CUBE (1);
@@ -199,20 +201,30 @@ public class Program extends BaseObj {
public static class BaseProgramBuilder { public static class BaseProgramBuilder {
@UnsupportedAppUsage
RenderScript mRS; RenderScript mRS;
@UnsupportedAppUsage
Element mInputs[]; Element mInputs[];
@UnsupportedAppUsage
Element mOutputs[]; Element mOutputs[];
@UnsupportedAppUsage
Type mConstants[]; Type mConstants[];
Type mTextures[]; Type mTextures[];
TextureType mTextureTypes[]; TextureType mTextureTypes[];
String mTextureNames[]; String mTextureNames[];
@UnsupportedAppUsage
int mInputCount; int mInputCount;
@UnsupportedAppUsage
int mOutputCount; int mOutputCount;
@UnsupportedAppUsage
int mConstantCount; int mConstantCount;
@UnsupportedAppUsage
int mTextureCount; int mTextureCount;
@UnsupportedAppUsage
String mShader; String mShader;
@UnsupportedAppUsage
protected BaseProgramBuilder(RenderScript rs) { protected BaseProgramBuilder(RenderScript rs) {
mRS = rs; mRS = rs;
mInputs = new Element[MAX_INPUT]; mInputs = new Element[MAX_INPUT];

View File

@@ -16,6 +16,8 @@
package android.renderscript; package android.renderscript;
import android.annotation.UnsupportedAppUsage;
/** /**
* @hide * @hide
@@ -50,6 +52,7 @@ public class ProgramFragment extends Program {
* *
* @param rs Context to which the program will belong. * @param rs Context to which the program will belong.
*/ */
@UnsupportedAppUsage
public Builder(RenderScript rs) { public Builder(RenderScript rs) {
super(rs); super(rs);
} }
@@ -60,6 +63,7 @@ public class ProgramFragment extends Program {
* *
* @return ProgramFragment * @return ProgramFragment
*/ */
@UnsupportedAppUsage
public ProgramFragment create() { public ProgramFragment create() {
mRS.validate(); mRS.validate();
long[] tmp = new long[(mInputCount + mOutputCount + mConstantCount + mTextureCount) * 2]; long[] tmp = new long[(mInputCount + mOutputCount + mConstantCount + mTextureCount) * 2];

View File

@@ -16,6 +16,8 @@
package android.renderscript; package android.renderscript;
import android.annotation.UnsupportedAppUsage;
/** /**
* @hide * @hide
@@ -102,10 +104,12 @@ public class ProgramFragmentFixedFunction extends ProgramFragment {
/** /**
* @deprecated in API 16 * @deprecated in API 16
**/ **/
@UnsupportedAppUsage
REPLACE (1), REPLACE (1),
/** /**
* @deprecated in API 16 * @deprecated in API 16
**/ **/
@UnsupportedAppUsage
MODULATE (2), MODULATE (2),
/** /**
* @deprecated in API 16 * @deprecated in API 16
@@ -128,6 +132,7 @@ public class ProgramFragmentFixedFunction extends ProgramFragment {
/** /**
* @deprecated in API 16 * @deprecated in API 16
**/ **/
@UnsupportedAppUsage
ALPHA (1), ALPHA (1),
/** /**
* @deprecated in API 16 * @deprecated in API 16
@@ -136,10 +141,12 @@ public class ProgramFragmentFixedFunction extends ProgramFragment {
/** /**
* @deprecated in API 16 * @deprecated in API 16
**/ **/
@UnsupportedAppUsage
RGB (3), RGB (3),
/** /**
* @deprecated in API 16 * @deprecated in API 16
**/ **/
@UnsupportedAppUsage
RGBA (4); RGBA (4);
int mID; int mID;
@@ -228,6 +235,7 @@ public class ProgramFragmentFixedFunction extends ProgramFragment {
* *
* @param rs Context to which the program will belong. * @param rs Context to which the program will belong.
*/ */
@UnsupportedAppUsage
public Builder(RenderScript rs) { public Builder(RenderScript rs) {
mRS = rs; mRS = rs;
mSlots = new Slot[MAX_TEXTURE]; mSlots = new Slot[MAX_TEXTURE];
@@ -248,6 +256,7 @@ public class ProgramFragmentFixedFunction extends ProgramFragment {
* *
* @return this * @return this
*/ */
@UnsupportedAppUsage
public Builder setTexture(EnvMode env, Format fmt, int slot) public Builder setTexture(EnvMode env, Format fmt, int slot)
throws IllegalArgumentException { throws IllegalArgumentException {
if((slot < 0) || (slot >= MAX_TEXTURE)) { if((slot < 0) || (slot >= MAX_TEXTURE)) {
@@ -277,6 +286,7 @@ public class ProgramFragmentFixedFunction extends ProgramFragment {
* fragment shader * fragment shader
* *
**/ **/
@UnsupportedAppUsage
public Builder setVaryingColor(boolean enable) { public Builder setVaryingColor(boolean enable) {
mVaryingColorEnable = enable; mVaryingColorEnable = enable;
return this; return this;
@@ -288,6 +298,7 @@ public class ProgramFragmentFixedFunction extends ProgramFragment {
* state of the builder. * state of the builder.
* *
*/ */
@UnsupportedAppUsage
public ProgramFragmentFixedFunction create() { public ProgramFragmentFixedFunction create() {
InternalBuilder sb = new InternalBuilder(mRS); InternalBuilder sb = new InternalBuilder(mRS);
mNumTextures = 0; mNumTextures = 0;

View File

@@ -16,6 +16,8 @@
package android.renderscript; package android.renderscript;
import android.annotation.UnsupportedAppUsage;
/** /**
* @hide * @hide
@@ -124,6 +126,7 @@ public class ProgramRaster extends BaseObj {
/** /**
* @deprecated in API 16 * @deprecated in API 16
*/ */
@UnsupportedAppUsage
public Builder(RenderScript rs) { public Builder(RenderScript rs) {
mRS = rs; mRS = rs;
mPointSprite = false; mPointSprite = false;
@@ -133,6 +136,7 @@ public class ProgramRaster extends BaseObj {
/** /**
* @deprecated in API 16 * @deprecated in API 16
*/ */
@UnsupportedAppUsage
public Builder setPointSpriteEnabled(boolean enable) { public Builder setPointSpriteEnabled(boolean enable) {
mPointSprite = enable; mPointSprite = enable;
return this; return this;
@@ -149,6 +153,7 @@ public class ProgramRaster extends BaseObj {
/** /**
* @deprecated in API 16 * @deprecated in API 16
*/ */
@UnsupportedAppUsage
public ProgramRaster create() { public ProgramRaster create() {
mRS.validate(); mRS.validate();
long id = mRS.nProgramRasterCreate(mPointSprite, mCullMode.mID); long id = mRS.nProgramRasterCreate(mPointSprite, mCullMode.mID);

View File

@@ -16,6 +16,8 @@
package android.renderscript; package android.renderscript;
import android.annotation.UnsupportedAppUsage;
/** /**
* @hide * @hide
@@ -45,11 +47,13 @@ public class ProgramStore extends BaseObj {
/** /**
* Always drawn * Always drawn
*/ */
@UnsupportedAppUsage
ALWAYS (0), ALWAYS (0),
/** /**
* Drawn if the incoming depth value is less than that in the * Drawn if the incoming depth value is less than that in the
* depth buffer * depth buffer
*/ */
@UnsupportedAppUsage
LESS (1), LESS (1),
/** /**
* Drawn if the incoming depth value is less or equal to that in * Drawn if the incoming depth value is less or equal to that in
@@ -93,9 +97,11 @@ public class ProgramStore extends BaseObj {
*/ */
public enum BlendSrcFunc { public enum BlendSrcFunc {
ZERO (0), ZERO (0),
@UnsupportedAppUsage
ONE (1), ONE (1),
DST_COLOR (2), DST_COLOR (2),
ONE_MINUS_DST_COLOR (3), ONE_MINUS_DST_COLOR (3),
@UnsupportedAppUsage
SRC_ALPHA (4), SRC_ALPHA (4),
ONE_MINUS_SRC_ALPHA (5), ONE_MINUS_SRC_ALPHA (5),
DST_ALPHA (6), DST_ALPHA (6),
@@ -118,11 +124,14 @@ public class ProgramStore extends BaseObj {
* *
*/ */
public enum BlendDstFunc { public enum BlendDstFunc {
@UnsupportedAppUsage
ZERO (0), ZERO (0),
@UnsupportedAppUsage
ONE (1), ONE (1),
SRC_COLOR (2), SRC_COLOR (2),
ONE_MINUS_SRC_COLOR (3), ONE_MINUS_SRC_COLOR (3),
SRC_ALPHA (4), SRC_ALPHA (4),
@UnsupportedAppUsage
ONE_MINUS_SRC_ALPHA (5), ONE_MINUS_SRC_ALPHA (5),
DST_ALPHA (6), DST_ALPHA (6),
ONE_MINUS_DST_ALPHA (7); ONE_MINUS_DST_ALPHA (7);
@@ -299,6 +308,7 @@ public class ProgramStore extends BaseObj {
* *
* @param rs Context to which the program will belong. * @param rs Context to which the program will belong.
**/ **/
@UnsupportedAppUsage
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) {
ProgramStore.Builder builder = new ProgramStore.Builder(rs); ProgramStore.Builder builder = new ProgramStore.Builder(rs);
@@ -328,6 +338,7 @@ public class ProgramStore extends BaseObj {
BlendDstFunc mBlendDst; BlendDstFunc mBlendDst;
boolean mDither; boolean mDither;
@UnsupportedAppUsage
public Builder(RenderScript rs) { public Builder(RenderScript rs) {
mRS = rs; mRS = rs;
mDepthFunc = DepthFunc.ALWAYS; mDepthFunc = DepthFunc.ALWAYS;
@@ -347,6 +358,7 @@ public class ProgramStore extends BaseObj {
* *
* @return this * @return this
*/ */
@UnsupportedAppUsage
public Builder setDepthFunc(DepthFunc func) { public Builder setDepthFunc(DepthFunc func) {
mDepthFunc = func; mDepthFunc = func;
return this; return this;
@@ -360,6 +372,7 @@ public class ProgramStore extends BaseObj {
* *
* @return this * @return this
*/ */
@UnsupportedAppUsage
public Builder setDepthMaskEnabled(boolean enable) { public Builder setDepthMaskEnabled(boolean enable) {
mDepthMask = enable; mDepthMask = enable;
return this; return this;
@@ -394,6 +407,7 @@ public class ProgramStore extends BaseObj {
* *
* @return this * @return this
*/ */
@UnsupportedAppUsage
public Builder setBlendFunc(BlendSrcFunc src, BlendDstFunc dst) { public Builder setBlendFunc(BlendSrcFunc src, BlendDstFunc dst) {
mBlendSrc = src; mBlendSrc = src;
mBlendDst = dst; mBlendDst = dst;
@@ -408,6 +422,7 @@ public class ProgramStore extends BaseObj {
* *
* @return this * @return this
*/ */
@UnsupportedAppUsage
public Builder setDitherEnabled(boolean enable) { public Builder setDitherEnabled(boolean enable) {
mDither = enable; mDither = enable;
return this; return this;
@@ -416,6 +431,7 @@ public class ProgramStore extends BaseObj {
/** /**
* Creates a program store from the current state of the builder * Creates a program store from the current state of the builder
*/ */
@UnsupportedAppUsage
public ProgramStore create() { public ProgramStore create() {
mRS.validate(); mRS.validate();
long id = mRS.nProgramStoreCreate(mColorMaskR, mColorMaskG, mColorMaskB, mColorMaskA, long id = mRS.nProgramStoreCreate(mColorMaskR, mColorMaskG, mColorMaskB, mColorMaskA,

View File

@@ -38,6 +38,8 @@
**/ **/
package android.renderscript; package android.renderscript;
import android.annotation.UnsupportedAppUsage;
/** /**
* @hide * @hide
@@ -90,6 +92,7 @@ public class ProgramVertex extends Program {
* *
* @param rs Context to which the program will belong. * @param rs Context to which the program will belong.
*/ */
@UnsupportedAppUsage
public Builder(RenderScript rs) { public Builder(RenderScript rs) {
super(rs); super(rs);
} }
@@ -102,6 +105,7 @@ public class ProgramVertex extends Program {
* structure * structure
* @return self * @return self
*/ */
@UnsupportedAppUsage
public Builder addInput(Element e) throws IllegalStateException { public Builder addInput(Element e) throws IllegalStateException {
// Should check for consistant and non-conflicting names... // Should check for consistant and non-conflicting names...
if(mInputCount >= MAX_INPUT) { if(mInputCount >= MAX_INPUT) {
@@ -120,6 +124,7 @@ public class ProgramVertex extends Program {
* *
* @return ProgramVertex * @return ProgramVertex
*/ */
@UnsupportedAppUsage
public ProgramVertex create() { public ProgramVertex create() {
mRS.validate(); mRS.validate();
long[] tmp = new long[(mInputCount + mOutputCount + mConstantCount + mTextureCount) * 2]; long[] tmp = new long[(mInputCount + mOutputCount + mConstantCount + mTextureCount) * 2];

View File

@@ -16,6 +16,8 @@
package android.renderscript; package android.renderscript;
import android.annotation.UnsupportedAppUsage;
/** /**
* @hide * @hide
@@ -38,6 +40,7 @@ public class ProgramVertexFixedFunction extends ProgramVertex {
* *
* @param va allocation containing fixed function matrices * @param va allocation containing fixed function matrices
*/ */
@UnsupportedAppUsage
public void bindConstants(Constants va) { public void bindConstants(Constants va) {
mRS.validate(); mRS.validate();
bindConstants(va.getAllocation(), 0); bindConstants(va.getAllocation(), 0);
@@ -118,6 +121,7 @@ public class ProgramVertexFixedFunction extends ProgramVertex {
* *
* @param rs Context to which the program will belong. * @param rs Context to which the program will belong.
*/ */
@UnsupportedAppUsage
public Builder(RenderScript rs) { public Builder(RenderScript rs) {
mRS = rs; mRS = rs;
} }
@@ -170,6 +174,7 @@ public class ProgramVertexFixedFunction extends ProgramVertex {
* *
* @return Fixed function emulation ProgramVertex * @return Fixed function emulation ProgramVertex
*/ */
@UnsupportedAppUsage
public ProgramVertexFixedFunction create() { public ProgramVertexFixedFunction create() {
buildShaderString(); buildShaderString();
@@ -215,6 +220,7 @@ public class ProgramVertexFixedFunction extends ProgramVertex {
* *
* @param rs Context to which the allocation will belong. * @param rs Context to which the allocation will belong.
**/ **/
@UnsupportedAppUsage
public Constants(RenderScript rs) { public Constants(RenderScript rs) {
Type constInputType = ProgramVertexFixedFunction.Builder.getConstantInputType(rs); Type constInputType = ProgramVertexFixedFunction.Builder.getConstantInputType(rs);
mAlloc = Allocation.createTyped(rs, constInputType); mAlloc = Allocation.createTyped(rs, constInputType);
@@ -268,6 +274,7 @@ public class ProgramVertexFixedFunction extends ProgramVertex {
* *
* @param m projection matrix * @param m projection matrix
*/ */
@UnsupportedAppUsage
public void setProjection(Matrix4f m) { public void setProjection(Matrix4f m) {
mProjection.load(m); mProjection.load(m);
addToBuffer(PROJECTION_OFFSET*4, m); addToBuffer(PROJECTION_OFFSET*4, m);

View File

@@ -16,6 +16,7 @@
package android.renderscript; package android.renderscript;
import android.annotation.UnsupportedAppUsage;
import android.content.Context; import android.content.Context;
import android.util.AttributeSet; import android.util.AttributeSet;
import android.view.SurfaceHolder; import android.view.SurfaceHolder;
@@ -42,6 +43,7 @@ public class RSSurfaceView extends SurfaceView implements SurfaceHolder.Callback
* must call {@link android.opengl.GLSurfaceView#setRenderer} to * must call {@link android.opengl.GLSurfaceView#setRenderer} to
* register a renderer. * register a renderer.
*/ */
@UnsupportedAppUsage
public RSSurfaceView(Context context) { public RSSurfaceView(Context context) {
super(context); super(context);
init(); init();
@@ -54,6 +56,7 @@ public class RSSurfaceView extends SurfaceView implements SurfaceHolder.Callback
* must call {@link android.opengl.GLSurfaceView#setRenderer} to * must call {@link android.opengl.GLSurfaceView#setRenderer} to
* register a renderer. * register a renderer.
*/ */
@UnsupportedAppUsage
public RSSurfaceView(Context context, AttributeSet attrs) { public RSSurfaceView(Context context, AttributeSet attrs) {
super(context, attrs); super(context, attrs);
init(); init();

View File

@@ -22,6 +22,7 @@ import java.nio.ByteBuffer;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.concurrent.locks.ReentrantReadWriteLock; import java.util.concurrent.locks.ReentrantReadWriteLock;
import android.annotation.UnsupportedAppUsage;
import android.content.Context; import android.content.Context;
import android.content.res.AssetManager; import android.content.res.AssetManager;
import android.graphics.Bitmap; import android.graphics.Bitmap;
@@ -103,6 +104,7 @@ public class RenderScript {
* Detect the bitness of the VM to allow FieldPacker to do the right thing. * Detect the bitness of the VM to allow FieldPacker to do the right thing.
*/ */
static native int rsnSystemGetPointerSize(); static native int rsnSystemGetPointerSize();
@UnsupportedAppUsage
static int sPointerSize; static int sPointerSize;
static { static {
@@ -153,6 +155,7 @@ public class RenderScript {
* @return Always return 1 * @return Always return 1
* *
*/ */
@UnsupportedAppUsage
public static long getMinorID() { public static long getMinorID() {
return 1; return 1;
} }
@@ -833,6 +836,7 @@ public class RenderScript {
native long rsnScriptCCreate(long con, String resName, String cacheDir, native long rsnScriptCCreate(long con, String resName, String cacheDir,
byte[] script, int length); byte[] script, int length);
@UnsupportedAppUsage
synchronized long nScriptCCreate(String resName, String cacheDir, byte[] script, int length) { synchronized long nScriptCCreate(String resName, String cacheDir, byte[] script, int length) {
validate(); validate();
return rsnScriptCCreate(mContext, resName, cacheDir, script, length); return rsnScriptCCreate(mContext, resName, cacheDir, script, length);
@@ -1158,6 +1162,7 @@ public class RenderScript {
* sendToClient} by scripts from this context. * sendToClient} by scripts from this context.
* *
*/ */
@UnsupportedAppUsage
RSMessageHandler mMessageCallback = null; RSMessageHandler mMessageCallback = null;
public void setMessageHandler(RSMessageHandler msg) { public void setMessageHandler(RSMessageHandler msg) {
@@ -1232,6 +1237,7 @@ public class RenderScript {
} }
} }
@UnsupportedAppUsage
void validate() { void validate() {
if (mContext == 0) { if (mContext == 0) {
throw new RSInvalidStateException("Calling RS with no Context active."); throw new RSInvalidStateException("Calling RS with no Context active.");
@@ -1495,6 +1501,7 @@ public class RenderScript {
* @param sdkVersion The target SDK Version. * @param sdkVersion The target SDK Version.
* @return RenderScript * @return RenderScript
*/ */
@UnsupportedAppUsage
public static RenderScript create(Context ctx, int sdkVersion) { public static RenderScript create(Context ctx, int sdkVersion) {
return create(ctx, sdkVersion, ContextType.NORMAL, CREATE_FLAG_NONE); return create(ctx, sdkVersion, ContextType.NORMAL, CREATE_FLAG_NONE);
} }
@@ -1508,6 +1515,7 @@ public class RenderScript {
* @param flags The OR of the CREATE_FLAG_* options desired * @param flags The OR of the CREATE_FLAG_* options desired
* @return RenderScript * @return RenderScript
*/ */
@UnsupportedAppUsage
private 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) { if (sdkVersion < 23) {
return internalCreate(ctx, sdkVersion, ct, flags); return internalCreate(ctx, sdkVersion, ct, flags);

View File

@@ -16,6 +16,7 @@
package android.renderscript; package android.renderscript;
import android.annotation.UnsupportedAppUsage;
import java.io.File; import java.io.File;
/** /**
@@ -30,11 +31,13 @@ public class RenderScriptCacheDir {
* @hide * @hide
* @param cacheDir A directory the current process can write to * @param cacheDir A directory the current process can write to
*/ */
@UnsupportedAppUsage
public static void setupDiskCache(File cacheDir) { public static void setupDiskCache(File cacheDir) {
// Defer creation of cache path to nScriptCCreate(). // Defer creation of cache path to nScriptCCreate().
mCacheDir = cacheDir; mCacheDir = cacheDir;
} }
@UnsupportedAppUsage
static File mCacheDir; static File mCacheDir;
} }

View File

@@ -16,6 +16,7 @@
package android.renderscript; package android.renderscript;
import android.annotation.UnsupportedAppUsage;
import android.content.Context; import android.content.Context;
import android.graphics.SurfaceTexture; import android.graphics.SurfaceTexture;
import android.view.Surface; import android.view.Surface;
@@ -65,6 +66,7 @@ public class RenderScriptGL extends RenderScript {
/** /**
* @deprecated in API 16 * @deprecated in API 16
*/ */
@UnsupportedAppUsage
public SurfaceConfig() { public SurfaceConfig() {
} }
@@ -132,6 +134,7 @@ public class RenderScriptGL extends RenderScript {
* @param minimum * @param minimum
* @param preferred * @param preferred
*/ */
@UnsupportedAppUsage
public void setDepth(int minimum, int preferred) { public void setDepth(int minimum, int preferred) {
validateRange(minimum, preferred, 0, 24); validateRange(minimum, preferred, 0, 24);
mDepthMin = minimum; mDepthMin = minimum;
@@ -169,6 +172,7 @@ public class RenderScriptGL extends RenderScript {
* @param ctx The context. * @param ctx The context.
* @param sc The desired format of the primary rendering surface. * @param sc The desired format of the primary rendering surface.
*/ */
@UnsupportedAppUsage
public RenderScriptGL(Context ctx, SurfaceConfig sc) { public RenderScriptGL(Context ctx, SurfaceConfig sc) {
super(ctx); super(ctx);
mSurfaceConfig = new SurfaceConfig(sc); mSurfaceConfig = new SurfaceConfig(sc);
@@ -202,6 +206,7 @@ public class RenderScriptGL extends RenderScript {
* @param h * @param h
* @param sur * @param sur
*/ */
@UnsupportedAppUsage
public void setSurface(SurfaceHolder sur, int w, int h) { public void setSurface(SurfaceHolder sur, int w, int h) {
validate(); validate();
Surface s = null; Surface s = null;
@@ -281,6 +286,7 @@ public class RenderScriptGL extends RenderScript {
* *
* @param s Graphics script to process rendering requests. * @param s Graphics script to process rendering requests.
*/ */
@UnsupportedAppUsage
public void bindRootScript(Script s) { public void bindRootScript(Script s) {
validate(); validate();
nContextBindRootScript((int)safeID(s)); nContextBindRootScript((int)safeID(s));
@@ -293,6 +299,7 @@ public class RenderScriptGL extends RenderScript {
* *
* @param p * @param p
*/ */
@UnsupportedAppUsage
public void bindProgramStore(ProgramStore p) { public void bindProgramStore(ProgramStore p) {
validate(); validate();
nContextBindProgramStore((int)safeID(p)); nContextBindProgramStore((int)safeID(p));
@@ -317,6 +324,7 @@ public class RenderScriptGL extends RenderScript {
* *
* @param p * @param p
*/ */
@UnsupportedAppUsage
public void bindProgramRaster(ProgramRaster p) { public void bindProgramRaster(ProgramRaster p) {
validate(); validate();
nContextBindProgramRaster((int)safeID(p)); nContextBindProgramRaster((int)safeID(p));
@@ -329,6 +337,7 @@ public class RenderScriptGL extends RenderScript {
* *
* @param p * @param p
*/ */
@UnsupportedAppUsage
public void bindProgramVertex(ProgramVertex p) { public void bindProgramVertex(ProgramVertex p) {
validate(); validate();
nContextBindProgramVertex((int)safeID(p)); nContextBindProgramVertex((int)safeID(p));

View File

@@ -16,6 +16,7 @@
package android.renderscript; package android.renderscript;
import android.annotation.UnsupportedAppUsage;
import android.util.SparseArray; import android.util.SparseArray;
/** /**
@@ -475,8 +476,10 @@ public class Script extends BaseObj {
* *
*/ */
public static class Builder { public static class Builder {
@UnsupportedAppUsage
RenderScript mRS; RenderScript mRS;
@UnsupportedAppUsage
Builder(RenderScript rs) { Builder(RenderScript rs) {
mRS = rs; mRS = rs;
} }