summaryrefslogtreecommitdiffstats
path: root/graphics/java/android/renderscript/RenderScript.java
diff options
context:
space:
mode:
Diffstat (limited to 'graphics/java/android/renderscript/RenderScript.java')
-rw-r--r--graphics/java/android/renderscript/RenderScript.java105
1 files changed, 69 insertions, 36 deletions
diff --git a/graphics/java/android/renderscript/RenderScript.java b/graphics/java/android/renderscript/RenderScript.java
index a935243..4eeb4d3 100644
--- a/graphics/java/android/renderscript/RenderScript.java
+++ b/graphics/java/android/renderscript/RenderScript.java
@@ -68,10 +68,11 @@ public class RenderScript {
native void nContextSetSurface(int w, int h, Surface sur);
native void nContextSetPriority(int p);
native void nContextDump(int bits);
+ native void nContextFinish();
native void nContextBindRootScript(int script);
native void nContextBindSampler(int sampler, int slot);
- native void nContextBindProgramFragmentStore(int pfs);
+ native void nContextBindProgramStore(int pfs);
native void nContextBindProgramFragment(int pf);
native void nContextBindProgramVertex(int pf);
native void nContextBindProgramRaster(int pr);
@@ -82,6 +83,7 @@ public class RenderScript {
native void nContextDeinitToClient();
native void nAssignName(int obj, byte[] name);
+ native String nGetName(int obj);
native void nObjDestroy(int id);
native void nObjDestroyOOB(int id);
native int nFileOpen(byte[] name);
@@ -89,12 +91,15 @@ public class RenderScript {
native int nElementCreate(int type, int kind, boolean norm, int vecSize);
native int nElementCreate2(int[] elements, String[] names);
+ native void nElementGetNativeData(int id, int[] elementData);
+ native void nElementGetSubElements(int id, int[] IDs, String[] names);
native void nTypeBegin(int elementID);
native void nTypeAdd(int dim, int val);
native int nTypeCreate();
native void nTypeFinalDestroy(Type t);
native void nTypeSetupFields(Type t, int[] types, int[] bits, Field[] IDs);
+ native void nTypeGetNativeData(int id, int[] typeData);
native int nAllocationCreateTyped(int type);
native int nAllocationCreateFromBitmap(int dstFmt, boolean genMips, Bitmap bmp);
@@ -116,6 +121,14 @@ public class RenderScript {
native void nAllocationRead(int id, float[] d);
native void nAllocationSubDataFromObject(int id, Type t, int offset, Object o);
native void nAllocationSubReadFromObject(int id, Type t, int offset, Object o);
+ native int nAllocationGetType(int id);
+
+ native int nFileA3DCreateFromAssetStream(int assetStream);
+ native int nFileA3DGetNumIndexEntries(int fileA3D);
+ native void nFileA3DGetIndexEntries(int fileA3D, int numEntries, int[] IDs, String[] names);
+ native int nFileA3DGetEntryByIndex(int fileA3D, int index);
+
+ native int nFontCreateFromFile(String fileName, int size, int dpi);
native void nAdapter1DBindAllocation(int ad, int alloc);
native void nAdapter1DSetConstraint(int ad, int dim, int value);
@@ -134,36 +147,32 @@ public class RenderScript {
native int nAdapter2DCreate();
native void nScriptBindAllocation(int script, int alloc, int slot);
- native void nScriptSetClearColor(int script, float r, float g, float b, float a);
- native void nScriptSetClearDepth(int script, float depth);
- native void nScriptSetClearStencil(int script, int stencil);
native void nScriptSetTimeZone(int script, byte[] timeZone);
- native void nScriptSetType(int type, boolean writable, String name, int slot);
- native void nScriptSetRoot(boolean isRoot);
- native void nScriptSetInvokable(String name, int slot);
native void nScriptInvoke(int id, int slot);
+ native void nScriptInvokeV(int id, int slot, byte[] params);
+ native void nScriptSetVarI(int id, int slot, int val);
+ native void nScriptSetVarF(int id, int slot, float val);
+ native void nScriptSetVarV(int id, int slot, byte[] val);
native void nScriptCBegin();
native void nScriptCSetScript(byte[] script, int offset, int length);
native int nScriptCCreate();
- native void nScriptCAddDefineI32(String name, int value);
- native void nScriptCAddDefineF(String name, float value);
native void nSamplerBegin();
native void nSamplerSet(int param, int value);
native int nSamplerCreate();
- native void nProgramFragmentStoreBegin(int in, int out);
- native void nProgramFragmentStoreDepthFunc(int func);
- native void nProgramFragmentStoreDepthMask(boolean enable);
- native void nProgramFragmentStoreColorMask(boolean r, boolean g, boolean b, boolean a);
- native void nProgramFragmentStoreBlendFunc(int src, int dst);
- native void nProgramFragmentStoreDither(boolean enable);
- native int nProgramFragmentStoreCreate();
+ native void nProgramStoreBegin(int in, int out);
+ native void nProgramStoreDepthFunc(int func);
+ native void nProgramStoreDepthMask(boolean enable);
+ native void nProgramStoreColorMask(boolean r, boolean g, boolean b, boolean a);
+ native void nProgramStoreBlendFunc(int src, int dst);
+ native void nProgramStoreDither(boolean enable);
+ native int nProgramStoreCreate();
- native int nProgramRasterCreate(int in, int out, boolean pointSmooth, boolean lineSmooth, boolean pointSprite);
+ native int nProgramRasterCreate(boolean pointSmooth, boolean lineSmooth, boolean pointSprite);
native void nProgramRasterSetLineWidth(int pr, float v);
- native void nProgramRasterSetPointSize(int pr, float v);
+ native void nProgramRasterSetCullMode(int pr, int mode);
native void nProgramBindConstants(int pv, int slot, int mID);
native void nProgramBindTexture(int vpf, int slot, int a);
@@ -182,9 +191,13 @@ public class RenderScript {
native void nLightSetColor(int l, float r, float g, float b);
native void nLightSetPosition(int l, float x, float y, float z);
- native int nSimpleMeshCreate(int batchID, int idxID, int[] vtxID, int prim);
- native void nSimpleMeshBindVertex(int id, int alloc, int slot);
- native void nSimpleMeshBindIndex(int id, int alloc);
+ native int nMeshCreate(int vtxCount, int indexCount);
+ native void nMeshBindVertex(int id, int alloc, int slot);
+ native void nMeshBindIndex(int id, int alloc, int prim, int slot);
+ native int nMeshGetVertexBufferCount(int id);
+ native int nMeshGetIndexCount(int id);
+ native void nMeshGetVertices(int id, int[] vtxIds, int vtxIdCount);
+ native void nMeshGetIndices(int id, int[] idxIds, int[] primitives, int vtxIdCount);
native void nAnimationBegin(int attribCount, int keyframeCount);
native void nAnimationAdd(float time, float[] attribs);
@@ -195,13 +208,25 @@ public class RenderScript {
@SuppressWarnings({"FieldCanBeLocal"})
protected MessageThread mMessageThread;
- Element mElement_USER_U8;
- Element mElement_USER_I8;
- Element mElement_USER_U16;
- Element mElement_USER_I16;
- Element mElement_USER_U32;
- Element mElement_USER_I32;
- Element mElement_USER_F32;
+ Element mElement_U8;
+ Element mElement_I8;
+ Element mElement_U16;
+ Element mElement_I16;
+ Element mElement_U32;
+ Element mElement_I32;
+ Element mElement_F32;
+ Element mElement_BOOLEAN;
+
+ Element mElement_ELEMENT;
+ Element mElement_TYPE;
+ Element mElement_ALLOCATION;
+ Element mElement_SAMPLER;
+ Element mElement_SCRIPT;
+ Element mElement_MESH;
+ Element mElement_PROGRAM_FRAGMENT;
+ Element mElement_PROGRAM_VERTEX;
+ Element mElement_PROGRAM_RASTER;
+ Element mElement_PROGRAM_STORE;
Element mElement_A_8;
Element mElement_RGB_565;
@@ -210,13 +235,17 @@ public class RenderScript {
Element mElement_RGBA_4444;
Element mElement_RGBA_8888;
- Element mElement_INDEX_16;
- Element mElement_POSITION_2;
- Element mElement_POSITION_3;
- Element mElement_TEXTURE_2;
- Element mElement_NORMAL_3;
- Element mElement_COLOR_U8_4;
- Element mElement_COLOR_F32_4;
+ Element mElement_FLOAT_2;
+ Element mElement_FLOAT_3;
+ Element mElement_FLOAT_4;
+ Element mElement_UCHAR_4;
+
+ Sampler mSampler_CLAMP_NEAREST;
+ Sampler mSampler_CLAMP_LINEAR;
+ Sampler mSampler_CLAMP_LINEAR_MIP_LINEAR;
+ Sampler mSampler_WRAP_NEAREST;
+ Sampler mSampler_WRAP_LINEAR;
+ Sampler mSampler_WRAP_LINEAR_MIP_LINEAR;
///////////////////////////////////////////////////////////////////////////////////
//
@@ -282,7 +311,6 @@ public class RenderScript {
mRS.mMessageCallback.mID = msg;
mRS.mMessageCallback.run();
}
- //Log.d(LOG_TAG, "MessageThread msg " + msg + " v1 " + rbuf[0] + " v2 " + rbuf[1] + " v3 " +rbuf[2]);
}
Log.d(LOG_TAG, "MessageThread exiting.");
}
@@ -307,6 +335,10 @@ public class RenderScript {
nContextDump(bits);
}
+ public void finish() {
+ nContextFinish();
+ }
+
public void destroy() {
validate();
nContextDeinitToClient();
@@ -335,3 +367,4 @@ public class RenderScript {
}
+