diff options
author | Jason Sams <rjsams@android.com> | 2009-09-23 16:38:37 -0700 |
---|---|---|
committer | Jason Sams <rjsams@android.com> | 2009-09-23 18:07:45 -0700 |
commit | 6b9dec00afec359f091ed353f371f08ff150278a (patch) | |
tree | 58ad3c03d45525d6f669f6dc86f3d01d39a24513 /graphics/java/android/renderscript/RenderScript.java | |
parent | 880aaa7fe0706dbadbb8f2f6b39b4f3021f74c01 (diff) | |
download | frameworks_base-6b9dec00afec359f091ed353f371f08ff150278a.zip frameworks_base-6b9dec00afec359f091ed353f371f08ff150278a.tar.gz frameworks_base-6b9dec00afec359f091ed353f371f08ff150278a.tar.bz2 |
Remove depricated triangleMesh.
Diffstat (limited to 'graphics/java/android/renderscript/RenderScript.java')
-rw-r--r-- | graphics/java/android/renderscript/RenderScript.java | 86 |
1 files changed, 15 insertions, 71 deletions
diff --git a/graphics/java/android/renderscript/RenderScript.java b/graphics/java/android/renderscript/RenderScript.java index 1ce7083..b7cd21b 100644 --- a/graphics/java/android/renderscript/RenderScript.java +++ b/graphics/java/android/renderscript/RenderScript.java @@ -65,8 +65,6 @@ public class RenderScript { native int nContextCreate(int dev, Surface sur, int ver, boolean useDepth); native void nContextDestroy(int con); - //void rsContextBindSampler (uint32_t slot, RsSampler sampler); - //void rsContextBindRootScript (RsScript sampler); native void nContextBindRootScript(int script); native void nContextBindSampler(int sampler, int slot); native void nContextBindProgramFragmentStore(int pfs); @@ -92,7 +90,6 @@ public class RenderScript { native void nTypeSetupFields(Type t, int[] types, int[] bits, Field[] IDs); native int nAllocationCreateTyped(int type); - //native int nAllocationCreateSized(int elem, int count); native int nAllocationCreateFromBitmap(int dstFmt, boolean genMips, Bitmap bmp); native int nAllocationCreateFromBitmapBoxed(int dstFmt, boolean genMips, Bitmap bmp); native int nAllocationCreateFromAssetStream(int dstFmt, boolean genMips, int assetStream); @@ -112,15 +109,6 @@ public class RenderScript { native void nAllocationSubDataFromObject(int id, Type t, int offset, Object o); native void nAllocationSubReadFromObject(int id, Type t, int offset, Object o); - native void nTriangleMeshBegin(int vertex, int index); - native void nTriangleMeshAddVertex_XY (float x, float y); - native void nTriangleMeshAddVertex_XYZ (float x, float y, float z); - native void nTriangleMeshAddVertex_XY_ST (float x, float y, float s, float t); - native void nTriangleMeshAddVertex_XYZ_ST (float x, float y, float z, float s, float t); - native void nTriangleMeshAddVertex_XYZ_ST_NORM (float x, float y, float z, float s, float t, float nx, float ny, float nz); - native void nTriangleMeshAddTriangle(int i1, int i2, int i3); - native int nTriangleMeshCreate(); - native void nAdapter1DBindAllocation(int ad, int alloc); native void nAdapter1DSetConstraint(int ad, int dim, int value); native void nAdapter1DData(int ad, int[] d); @@ -230,49 +218,6 @@ public class RenderScript { } ////////////////////////////////////////////////////////////////////////////////// - // Triangle Mesh - - public class TriangleMesh extends BaseObj { - TriangleMesh(int id) { - super(RenderScript.this); - mID = id; - } - } - - public void triangleMeshBegin(Element vertex, Element index) { - nTriangleMeshBegin(vertex.mID, index.mID); - } - - public void triangleMeshAddVertex_XY(float x, float y) { - nTriangleMeshAddVertex_XY(x, y); - } - - public void triangleMeshAddVertex_XYZ(float x, float y, float z) { - nTriangleMeshAddVertex_XYZ(x, y, z); - } - - public void triangleMeshAddVertex_XY_ST(float x, float y, float s, float t) { - nTriangleMeshAddVertex_XY_ST(x, y, s, t); - } - - public void triangleMeshAddVertex_XYZ_ST(float x, float y, float z, float s, float t) { - nTriangleMeshAddVertex_XYZ_ST(x, y, z, s, t); - } - - public void triangleMeshAddVertex_XYZ_ST_NORM(float x, float y, float z, float s, float t, float nx, float ny, float nz) { - nTriangleMeshAddVertex_XYZ_ST_NORM(x, y, z, s, t, nx, ny, nz); - } - - public void triangleMeshAddTriangle(int i1, int i2, int i3) { - nTriangleMeshAddTriangle(i1, i2, i3); - } - - public TriangleMesh triangleMeshCreate() { - int id = nTriangleMeshCreate(); - return new TriangleMesh(id); - } - - ////////////////////////////////////////////////////////////////////////////////// // File public class File extends BaseObj { @@ -301,32 +246,31 @@ public class RenderScript { /////////////////////////////////////////////////////////////////////////////////// // Root state - public void contextBindRootScript(Script s) { - int id = 0; - if(s != null) { - id = s.mID; + private int safeID(BaseObj o) { + if(o != null) { + return o.mID; } - nContextBindRootScript(id); + return 0; } - //public void contextBindSampler(Sampler s, int slot) { - //nContextBindSampler(s.mID); - //} + public void contextBindRootScript(Script s) { + nContextBindRootScript(safeID(s)); + } - public void contextBindProgramFragmentStore(ProgramStore pfs) { - nContextBindProgramFragmentStore(pfs.mID); + public void contextBindProgramFragmentStore(ProgramStore p) { + nContextBindProgramFragmentStore(safeID(p)); } - public void contextBindProgramFragment(ProgramFragment pf) { - nContextBindProgramFragment(pf.mID); + public void contextBindProgramFragment(ProgramFragment p) { + nContextBindProgramFragment(safeID(p)); } - public void contextBindProgramRaster(ProgramRaster pf) { - nContextBindProgramRaster(pf.mID); + public void contextBindProgramRaster(ProgramRaster p) { + nContextBindProgramRaster(safeID(p)); } - public void contextBindProgramVertex(ProgramVertex pf) { - nContextBindProgramVertex(pf.mID); + public void contextBindProgramVertex(ProgramVertex p) { + nContextBindProgramVertex(safeID(p)); } } |