Merge change 21776 into eclair
* changes: Cleanup of object destruction. No need to have a per-class destruction function. This was a legacy of the distant past when the classes did not have a common base.
This commit is contained in:
@@ -47,14 +47,6 @@ public class Allocation extends BaseObj {
|
|||||||
mRS.nAllocationUploadToTexture(mID, baseMipLevel);
|
mRS.nAllocationUploadToTexture(mID, baseMipLevel);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void destroy() {
|
|
||||||
if(mDestroyed) {
|
|
||||||
throw new IllegalStateException("Object already destroyed.");
|
|
||||||
}
|
|
||||||
mDestroyed = true;
|
|
||||||
mRS.nAllocationDestroy(mID);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void data(int[] d) {
|
public void data(int[] d) {
|
||||||
mRS.nAllocationData(mID, d);
|
mRS.nAllocationData(mID, d);
|
||||||
}
|
}
|
||||||
@@ -98,11 +90,6 @@ public class Allocation extends BaseObj {
|
|||||||
mID = id;
|
mID = id;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void destroy() {
|
|
||||||
mRS.nAdapter1DDestroy(mID);
|
|
||||||
mID = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setConstraint(Dimension dim, int value) {
|
public void setConstraint(Dimension dim, int value) {
|
||||||
mRS.nAdapter1DSetConstraint(mID, dim.mID, value);
|
mRS.nAdapter1DSetConstraint(mID, dim.mID, value);
|
||||||
}
|
}
|
||||||
@@ -139,11 +126,6 @@ public class Allocation extends BaseObj {
|
|||||||
mID = id;
|
mID = id;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void destroy() {
|
|
||||||
mRS.nAdapter2DDestroy(mID);
|
|
||||||
mID = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setConstraint(Dimension dim, int value) {
|
public void setConstraint(Dimension dim, int value) {
|
||||||
mRS.nAdapter2DSetConstraint(mID, dim.mID, value);
|
mRS.nAdapter2DSetConstraint(mID, dim.mID, value);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -61,9 +61,18 @@ class BaseObj {
|
|||||||
{
|
{
|
||||||
if (!mDestroyed) {
|
if (!mDestroyed) {
|
||||||
Log.v(RenderScript.LOG_TAG,
|
Log.v(RenderScript.LOG_TAG,
|
||||||
"Element finalized without having released the RS reference.");
|
getClass() + " finalized without having released the RS reference.");
|
||||||
}
|
}
|
||||||
super.finalize();
|
super.finalize();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void destroy() {
|
||||||
|
if(mDestroyed) {
|
||||||
|
throw new IllegalStateException("Object already destroyed.");
|
||||||
|
}
|
||||||
|
mDestroyed = true;
|
||||||
|
mRS.nObjDestroy(mID);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -138,11 +138,7 @@ public class Element extends BaseObj {
|
|||||||
if(mIsPredefined) {
|
if(mIsPredefined) {
|
||||||
throw new IllegalStateException("Attempting to destroy a predefined Element.");
|
throw new IllegalStateException("Attempting to destroy a predefined Element.");
|
||||||
}
|
}
|
||||||
if(mDestroyed) {
|
super.destroy();
|
||||||
throw new IllegalStateException("Object already destroyed.");
|
|
||||||
}
|
|
||||||
mDestroyed = true;
|
|
||||||
mRS.nElementDestroy(mID);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Element createFromClass(RenderScript rs, Class c) {
|
public static Element createFromClass(RenderScript rs, Class c) {
|
||||||
|
|||||||
@@ -29,11 +29,6 @@ public class Light extends BaseObj {
|
|||||||
mID = id;
|
mID = id;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void destroy() {
|
|
||||||
mRS.nLightDestroy(mID);
|
|
||||||
mID = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setColor(float r, float g, float b) {
|
public void setColor(float r, float g, float b) {
|
||||||
mRS.nLightSetColor(mID, r, g, b);
|
mRS.nLightSetColor(mID, r, g, b);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -45,14 +45,6 @@ public class ProgramFragment extends BaseObj {
|
|||||||
mID = id;
|
mID = id;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void destroy() {
|
|
||||||
if(mDestroyed) {
|
|
||||||
throw new IllegalStateException("Object already destroyed.");
|
|
||||||
}
|
|
||||||
mDestroyed = true;
|
|
||||||
mRS.nProgramFragmentStoreDestroy(mID);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void bindTexture(Allocation va, int slot)
|
public void bindTexture(Allocation va, int slot)
|
||||||
throws IllegalArgumentException {
|
throws IllegalArgumentException {
|
||||||
if((slot < 0) || (slot >= MAX_SLOT)) {
|
if((slot < 0) || (slot >= MAX_SLOT)) {
|
||||||
|
|||||||
@@ -80,14 +80,6 @@ public class ProgramStore extends BaseObj {
|
|||||||
mID = id;
|
mID = id;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void destroy() {
|
|
||||||
if(mDestroyed) {
|
|
||||||
throw new IllegalStateException("Object already destroyed.");
|
|
||||||
}
|
|
||||||
mDestroyed = true;
|
|
||||||
mRS.nProgramFragmentStoreDestroy(mID);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public static class Builder {
|
public static class Builder {
|
||||||
|
|||||||
@@ -33,14 +33,6 @@ public class ProgramVertex extends BaseObj {
|
|||||||
mID = id;
|
mID = id;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void destroy() {
|
|
||||||
if(mDestroyed) {
|
|
||||||
throw new IllegalStateException("Object already destroyed.");
|
|
||||||
}
|
|
||||||
mDestroyed = true;
|
|
||||||
mRS.nProgramVertexDestroy(mID);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void bindAllocation(MatrixAllocation va) {
|
public void bindAllocation(MatrixAllocation va) {
|
||||||
mRS.nProgramVertexBindAllocation(mID, va.mAlloc.mID);
|
mRS.nProgramVertexBindAllocation(mID, va.mAlloc.mID);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -74,6 +74,7 @@ public class RenderScript {
|
|||||||
native void nContextAddDefineF(String name, float value);
|
native void nContextAddDefineF(String name, float value);
|
||||||
|
|
||||||
native void nAssignName(int obj, byte[] name);
|
native void nAssignName(int obj, byte[] name);
|
||||||
|
native void nObjDestroy(int id);
|
||||||
native int nFileOpen(byte[] name);
|
native int nFileOpen(byte[] name);
|
||||||
|
|
||||||
native void nElementBegin();
|
native void nElementBegin();
|
||||||
@@ -81,12 +82,10 @@ public class RenderScript {
|
|||||||
native void nElementAdd(int kind, int type, int norm, int bits, String s);
|
native void nElementAdd(int kind, int type, int norm, int bits, String s);
|
||||||
native int nElementCreate();
|
native int nElementCreate();
|
||||||
native int nElementGetPredefined(int predef);
|
native int nElementGetPredefined(int predef);
|
||||||
native void nElementDestroy(int obj);
|
|
||||||
|
|
||||||
native void nTypeBegin(int elementID);
|
native void nTypeBegin(int elementID);
|
||||||
native void nTypeAdd(int dim, int val);
|
native void nTypeAdd(int dim, int val);
|
||||||
native int nTypeCreate();
|
native int nTypeCreate();
|
||||||
native void nTypeDestroy(int id);
|
|
||||||
native void nTypeFinalDestroy(Type t);
|
native void nTypeFinalDestroy(Type t);
|
||||||
native void nTypeSetupFields(Type t, int[] types, int[] bits, Field[] IDs);
|
native void nTypeSetupFields(Type t, int[] types, int[] bits, Field[] IDs);
|
||||||
|
|
||||||
@@ -97,7 +96,6 @@ public class RenderScript {
|
|||||||
native int nAllocationCreateFromBitmapBoxed(int dstFmt, boolean genMips, Bitmap bmp);
|
native int nAllocationCreateFromBitmapBoxed(int dstFmt, boolean genMips, Bitmap bmp);
|
||||||
|
|
||||||
native void nAllocationUploadToTexture(int alloc, int baseMioLevel);
|
native void nAllocationUploadToTexture(int alloc, int baseMioLevel);
|
||||||
native void nAllocationDestroy(int alloc);
|
|
||||||
native void nAllocationData(int id, int[] d);
|
native void nAllocationData(int id, int[] d);
|
||||||
native void nAllocationData(int id, float[] d);
|
native void nAllocationData(int id, float[] d);
|
||||||
native void nAllocationSubData1D(int id, int off, int count, int[] d);
|
native void nAllocationSubData1D(int id, int off, int count, int[] d);
|
||||||
@@ -108,7 +106,6 @@ public class RenderScript {
|
|||||||
native void nAllocationRead(int id, float[] d);
|
native void nAllocationRead(int id, float[] d);
|
||||||
native void nAllocationDataFromObject(int id, Type t, Object o);
|
native void nAllocationDataFromObject(int id, Type t, Object o);
|
||||||
|
|
||||||
native void nTriangleMeshDestroy(int id);
|
|
||||||
native void nTriangleMeshBegin(int vertex, int index);
|
native void nTriangleMeshBegin(int vertex, int index);
|
||||||
native void nTriangleMeshAddVertex_XY (float x, float y);
|
native void nTriangleMeshAddVertex_XY (float x, float y);
|
||||||
native void nTriangleMeshAddVertex_XYZ (float x, float y, float z);
|
native void nTriangleMeshAddVertex_XYZ (float x, float y, float z);
|
||||||
@@ -118,7 +115,6 @@ public class RenderScript {
|
|||||||
native void nTriangleMeshAddTriangle(int i1, int i2, int i3);
|
native void nTriangleMeshAddTriangle(int i1, int i2, int i3);
|
||||||
native int nTriangleMeshCreate();
|
native int nTriangleMeshCreate();
|
||||||
|
|
||||||
native void nAdapter1DDestroy(int id);
|
|
||||||
native void nAdapter1DBindAllocation(int ad, int alloc);
|
native void nAdapter1DBindAllocation(int ad, int alloc);
|
||||||
native void nAdapter1DSetConstraint(int ad, int dim, int value);
|
native void nAdapter1DSetConstraint(int ad, int dim, int value);
|
||||||
native void nAdapter1DData(int ad, int[] d);
|
native void nAdapter1DData(int ad, int[] d);
|
||||||
@@ -127,7 +123,6 @@ public class RenderScript {
|
|||||||
native void nAdapter1DSubData(int ad, int off, int count, float[] d);
|
native void nAdapter1DSubData(int ad, int off, int count, float[] d);
|
||||||
native int nAdapter1DCreate();
|
native int nAdapter1DCreate();
|
||||||
|
|
||||||
native void nAdapter2DDestroy(int id);
|
|
||||||
native void nAdapter2DBindAllocation(int ad, int alloc);
|
native void nAdapter2DBindAllocation(int ad, int alloc);
|
||||||
native void nAdapter2DSetConstraint(int ad, int dim, int value);
|
native void nAdapter2DSetConstraint(int ad, int dim, int value);
|
||||||
native void nAdapter2DData(int ad, int[] d);
|
native void nAdapter2DData(int ad, int[] d);
|
||||||
@@ -136,7 +131,6 @@ public class RenderScript {
|
|||||||
native void nAdapter2DSubData(int ad, int xoff, int yoff, int w, int h, float[] d);
|
native void nAdapter2DSubData(int ad, int xoff, int yoff, int w, int h, float[] d);
|
||||||
native int nAdapter2DCreate();
|
native int nAdapter2DCreate();
|
||||||
|
|
||||||
native void nScriptDestroy(int script);
|
|
||||||
native void nScriptBindAllocation(int script, int alloc, int slot);
|
native void nScriptBindAllocation(int script, int alloc, int slot);
|
||||||
native void nScriptSetClearColor(int script, float r, float g, float b, float a);
|
native void nScriptSetClearColor(int script, float r, float g, float b, float a);
|
||||||
native void nScriptSetClearDepth(int script, float depth);
|
native void nScriptSetClearDepth(int script, float depth);
|
||||||
@@ -151,7 +145,6 @@ public class RenderScript {
|
|||||||
native void nScriptCAddDefineI32(String name, int value);
|
native void nScriptCAddDefineI32(String name, int value);
|
||||||
native void nScriptCAddDefineF(String name, float value);
|
native void nScriptCAddDefineF(String name, float value);
|
||||||
|
|
||||||
native void nSamplerDestroy(int sampler);
|
|
||||||
native void nSamplerBegin();
|
native void nSamplerBegin();
|
||||||
native void nSamplerSet(int param, int value);
|
native void nSamplerSet(int param, int value);
|
||||||
native int nSamplerCreate();
|
native int nSamplerCreate();
|
||||||
@@ -163,7 +156,6 @@ public class RenderScript {
|
|||||||
native void nProgramFragmentStoreBlendFunc(int src, int dst);
|
native void nProgramFragmentStoreBlendFunc(int src, int dst);
|
||||||
native void nProgramFragmentStoreDither(boolean enable);
|
native void nProgramFragmentStoreDither(boolean enable);
|
||||||
native int nProgramFragmentStoreCreate();
|
native int nProgramFragmentStoreCreate();
|
||||||
native void nProgramFragmentStoreDestroy(int pgm);
|
|
||||||
|
|
||||||
native void nProgramFragmentBegin(int in, int out);
|
native void nProgramFragmentBegin(int in, int out);
|
||||||
native void nProgramFragmentBindTexture(int vpf, int slot, int a);
|
native void nProgramFragmentBindTexture(int vpf, int slot, int a);
|
||||||
@@ -172,9 +164,7 @@ public class RenderScript {
|
|||||||
native void nProgramFragmentSetEnvMode(int slot, int env);
|
native void nProgramFragmentSetEnvMode(int slot, int env);
|
||||||
native void nProgramFragmentSetTexEnable(int slot, boolean enable);
|
native void nProgramFragmentSetTexEnable(int slot, boolean enable);
|
||||||
native int nProgramFragmentCreate();
|
native int nProgramFragmentCreate();
|
||||||
native void nProgramFragmentDestroy(int pgm);
|
|
||||||
|
|
||||||
native void nProgramVertexDestroy(int pv);
|
|
||||||
native void nProgramVertexBindAllocation(int pv, int mID);
|
native void nProgramVertexBindAllocation(int pv, int mID);
|
||||||
native void nProgramVertexBegin(int inID, int outID);
|
native void nProgramVertexBegin(int inID, int outID);
|
||||||
native void nProgramVertexSetTextureMatrixEnable(boolean enable);
|
native void nProgramVertexSetTextureMatrixEnable(boolean enable);
|
||||||
@@ -185,16 +175,13 @@ public class RenderScript {
|
|||||||
native void nLightSetIsMono(boolean isMono);
|
native void nLightSetIsMono(boolean isMono);
|
||||||
native void nLightSetIsLocal(boolean isLocal);
|
native void nLightSetIsLocal(boolean isLocal);
|
||||||
native int nLightCreate();
|
native int nLightCreate();
|
||||||
native void nLightDestroy(int l);
|
|
||||||
native void nLightSetColor(int l, float r, float g, float b);
|
native void nLightSetColor(int l, float r, float g, float b);
|
||||||
native void nLightSetPosition(int l, float x, float y, float z);
|
native void nLightSetPosition(int l, float x, float y, float z);
|
||||||
|
|
||||||
native void nSimpleMeshDestroy(int id);
|
|
||||||
native int nSimpleMeshCreate(int batchID, int idxID, int[] vtxID, int prim);
|
native int nSimpleMeshCreate(int batchID, int idxID, int[] vtxID, int prim);
|
||||||
native void nSimpleMeshBindVertex(int id, int alloc, int slot);
|
native void nSimpleMeshBindVertex(int id, int alloc, int slot);
|
||||||
native void nSimpleMeshBindIndex(int id, int alloc);
|
native void nSimpleMeshBindIndex(int id, int alloc);
|
||||||
|
|
||||||
native void nAnimationDestroy(int id);
|
|
||||||
native void nAnimationBegin(int attribCount, int keyframeCount);
|
native void nAnimationBegin(int attribCount, int keyframeCount);
|
||||||
native void nAnimationAdd(float time, float[] attribs);
|
native void nAnimationAdd(float time, float[] attribs);
|
||||||
native int nAnimationCreate();
|
native int nAnimationCreate();
|
||||||
@@ -229,11 +216,6 @@ public class RenderScript {
|
|||||||
super(RenderScript.this);
|
super(RenderScript.this);
|
||||||
mID = id;
|
mID = id;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void destroy() {
|
|
||||||
nTriangleMeshDestroy(mID);
|
|
||||||
mID = 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void triangleMeshBegin(Element vertex, Element index) {
|
public void triangleMeshBegin(Element vertex, Element index) {
|
||||||
@@ -278,11 +260,6 @@ public class RenderScript {
|
|||||||
super(RenderScript.this);
|
super(RenderScript.this);
|
||||||
mID = id;
|
mID = id;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void destroy() {
|
|
||||||
//nLightDestroy(mID);
|
|
||||||
mID = 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public File fileOpen(String s) throws IllegalStateException, IllegalArgumentException
|
public File fileOpen(String s) throws IllegalStateException, IllegalArgumentException
|
||||||
|
|||||||
@@ -51,11 +51,6 @@ public class Sampler extends BaseObj {
|
|||||||
mID = id;
|
mID = id;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void destroy() {
|
|
||||||
mRS.nSamplerDestroy(mID);
|
|
||||||
mID = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static class Builder {
|
public static class Builder {
|
||||||
RenderScript mRS;
|
RenderScript mRS;
|
||||||
Value mMin;
|
Value mMin;
|
||||||
|
|||||||
@@ -31,14 +31,6 @@ public class Script extends BaseObj {
|
|||||||
mID = id;
|
mID = id;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void destroy() {
|
|
||||||
if(mDestroyed) {
|
|
||||||
throw new IllegalStateException("Object already destroyed.");
|
|
||||||
}
|
|
||||||
mDestroyed = true;
|
|
||||||
mRS.nScriptDestroy(mID);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void bindAllocation(Allocation va, int slot) {
|
public void bindAllocation(Allocation va, int slot) {
|
||||||
mRS.nScriptBindAllocation(mID, va.mID, slot);
|
mRS.nScriptBindAllocation(mID, va.mID, slot);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -34,14 +34,6 @@ public class SimpleMesh extends BaseObj {
|
|||||||
mID = id;
|
mID = id;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void destroy() {
|
|
||||||
if(mDestroyed) {
|
|
||||||
throw new IllegalStateException("Object already destroyed.");
|
|
||||||
}
|
|
||||||
mDestroyed = true;
|
|
||||||
mRS.nSimpleMeshDestroy(mID);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void bindVertexAllocation(Allocation a, int slot) {
|
public void bindVertexAllocation(Allocation a, int slot) {
|
||||||
mRS.nSimpleMeshBindVertex(mID, a.mID, slot);
|
mRS.nSimpleMeshBindVertex(mID, a.mID, slot);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -48,14 +48,6 @@ public class Type extends BaseObj {
|
|||||||
super.finalize();
|
super.finalize();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void destroy() {
|
|
||||||
if(mDestroyed) {
|
|
||||||
throw new IllegalStateException("Object already destroyed.");
|
|
||||||
}
|
|
||||||
mDestroyed = true;
|
|
||||||
mRS.nTypeDestroy(mID);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static Type createFromClass(RenderScript rs, Class c, int size) {
|
public static Type createFromClass(RenderScript rs, Class c, int size) {
|
||||||
Element e = Element.createFromClass(rs, c);
|
Element e = Element.createFromClass(rs, c);
|
||||||
Builder b = new Builder(rs, e);
|
Builder b = new Builder(rs, e);
|
||||||
|
|||||||
@@ -78,6 +78,14 @@ nAssignName(JNIEnv *_env, jobject _this, jint obj, jbyteArray str)
|
|||||||
_env->ReleasePrimitiveArrayCritical(str, cptr, JNI_ABORT);
|
_env->ReleasePrimitiveArrayCritical(str, cptr, JNI_ABORT);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
nObjDestroy(JNIEnv *_env, jobject _this, jint obj)
|
||||||
|
{
|
||||||
|
RsContext con = (RsContext)(_env->GetIntField(_this, gContextId));
|
||||||
|
LOG_API("nObjDestroy, con(%p) obj(%p)", con, (void *)obj);
|
||||||
|
rsObjDestroy(con, (void *)obj);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
static jint
|
static jint
|
||||||
nFileOpen(JNIEnv *_env, jobject _this, jbyteArray str)
|
nFileOpen(JNIEnv *_env, jobject _this, jbyteArray str)
|
||||||
@@ -183,14 +191,6 @@ nElementGetPredefined(JNIEnv *_env, jobject _this, jint predef)
|
|||||||
return (jint)rsElementGetPredefined(con, (RsElementPredefined)predef);
|
return (jint)rsElementGetPredefined(con, (RsElementPredefined)predef);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
nElementDestroy(JNIEnv *_env, jobject _this, jint e)
|
|
||||||
{
|
|
||||||
RsContext con = (RsContext)(_env->GetIntField(_this, gContextId));
|
|
||||||
LOG_API("nElementDestroy, con(%p) e(%p)", con, (RsElement)e);
|
|
||||||
rsElementDestroy(con, (RsElement)e);
|
|
||||||
}
|
|
||||||
|
|
||||||
// -----------------------------------
|
// -----------------------------------
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -217,14 +217,6 @@ nTypeCreate(JNIEnv *_env, jobject _this)
|
|||||||
return (jint)rsTypeCreate(con);
|
return (jint)rsTypeCreate(con);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
nTypeDestroy(JNIEnv *_env, jobject _this, jint eID)
|
|
||||||
{
|
|
||||||
RsContext con = (RsContext)(_env->GetIntField(_this, gContextId));
|
|
||||||
LOG_API("nTypeDestroy, con(%p), t(%p)", con, (RsType)eID);
|
|
||||||
rsTypeDestroy(con, (RsType)eID);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void * SF_LoadInt(JNIEnv *_env, jobject _obj, jfieldID _field, void *buffer)
|
static void * SF_LoadInt(JNIEnv *_env, jobject _obj, jfieldID _field, void *buffer)
|
||||||
{
|
{
|
||||||
((int32_t *)buffer)[0] = _env->GetIntField(_obj, _field);
|
((int32_t *)buffer)[0] = _env->GetIntField(_obj, _field);
|
||||||
@@ -411,14 +403,6 @@ nAllocationCreateFromBitmapBoxed(JNIEnv *_env, jobject _this, jint dstFmt, jbool
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void
|
|
||||||
nAllocationDestroy(JNIEnv *_env, jobject _this, jint a)
|
|
||||||
{
|
|
||||||
RsContext con = (RsContext)(_env->GetIntField(_this, gContextId));
|
|
||||||
LOG_API("nAllocationDestroy, con(%p), a(%p)", con, (RsAllocation)a);
|
|
||||||
rsAllocationDestroy(con, (RsAllocation)a);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
nAllocationData_i(JNIEnv *_env, jobject _this, jint alloc, jintArray data)
|
nAllocationData_i(JNIEnv *_env, jobject _this, jint alloc, jintArray data)
|
||||||
{
|
{
|
||||||
@@ -530,14 +514,6 @@ nAllocationDataFromObject(JNIEnv *_env, jobject _this, jint alloc, jobject _type
|
|||||||
|
|
||||||
// -----------------------------------
|
// -----------------------------------
|
||||||
|
|
||||||
static void
|
|
||||||
nTriangleMeshDestroy(JNIEnv *_env, jobject _this, jint tm)
|
|
||||||
{
|
|
||||||
RsContext con = (RsContext)(_env->GetIntField(_this, gContextId));
|
|
||||||
LOG_API("nTriangleMeshDestroy, con(%p), tm(%p)", con, (RsAllocation)tm);
|
|
||||||
rsTriangleMeshDestroy(con, (RsTriangleMesh)tm);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
nTriangleMeshBegin(JNIEnv *_env, jobject _this, jint v, jint i)
|
nTriangleMeshBegin(JNIEnv *_env, jobject _this, jint v, jint i)
|
||||||
{
|
{
|
||||||
@@ -609,14 +585,6 @@ nTriangleMeshCreate(JNIEnv *_env, jobject _this)
|
|||||||
|
|
||||||
// -----------------------------------
|
// -----------------------------------
|
||||||
|
|
||||||
static void
|
|
||||||
nAdapter1DDestroy(JNIEnv *_env, jobject _this, jint adapter)
|
|
||||||
{
|
|
||||||
RsContext con = (RsContext)(_env->GetIntField(_this, gContextId));
|
|
||||||
LOG_API("nAdapter1DDestroy, con(%p), adapter(%p)", con, (RsAdapter1D)adapter);
|
|
||||||
rsAdapter1DDestroy(con, (RsAdapter1D)adapter);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
nAdapter1DBindAllocation(JNIEnv *_env, jobject _this, jint adapter, jint alloc)
|
nAdapter1DBindAllocation(JNIEnv *_env, jobject _this, jint adapter, jint alloc)
|
||||||
{
|
{
|
||||||
@@ -687,14 +655,6 @@ nAdapter1DCreate(JNIEnv *_env, jobject _this)
|
|||||||
|
|
||||||
// -----------------------------------
|
// -----------------------------------
|
||||||
|
|
||||||
static void
|
|
||||||
nAdapter2DDestroy(JNIEnv *_env, jobject _this, jint adapter)
|
|
||||||
{
|
|
||||||
RsContext con = (RsContext)(_env->GetIntField(_this, gContextId));
|
|
||||||
LOG_API("nAdapter2DDestroy, con(%p), adapter(%p)", con, (RsAdapter2D)adapter);
|
|
||||||
rsAdapter2DDestroy(con, (RsAdapter2D)adapter);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
nAdapter2DBindAllocation(JNIEnv *_env, jobject _this, jint adapter, jint alloc)
|
nAdapter2DBindAllocation(JNIEnv *_env, jobject _this, jint adapter, jint alloc)
|
||||||
{
|
{
|
||||||
@@ -767,14 +727,6 @@ nAdapter2DCreate(JNIEnv *_env, jobject _this)
|
|||||||
|
|
||||||
// -----------------------------------
|
// -----------------------------------
|
||||||
|
|
||||||
static void
|
|
||||||
nScriptDestroy(JNIEnv *_env, jobject _this, jint script)
|
|
||||||
{
|
|
||||||
RsContext con = (RsContext)(_env->GetIntField(_this, gContextId));
|
|
||||||
LOG_API("nScriptDestroy, con(%p), script(%p)", con, (RsScript)script);
|
|
||||||
rsScriptDestroy(con, (RsScript)script);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
nScriptBindAllocation(JNIEnv *_env, jobject _this, jint script, jint alloc, jint slot)
|
nScriptBindAllocation(JNIEnv *_env, jobject _this, jint script, jint alloc, jint slot)
|
||||||
{
|
{
|
||||||
@@ -988,14 +940,6 @@ nProgramFragmentStoreCreate(JNIEnv *_env, jobject _this)
|
|||||||
return (jint)rsProgramFragmentStoreCreate(con);
|
return (jint)rsProgramFragmentStoreCreate(con);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
nProgramFragmentStoreDestroy(JNIEnv *_env, jobject _this, jint pgm)
|
|
||||||
{
|
|
||||||
RsContext con = (RsContext)(_env->GetIntField(_this, gContextId));
|
|
||||||
LOG_API("nProgramFragmentStoreDestroy, con(%p), pgm(%i)", con, pgm);
|
|
||||||
rsProgramFragmentStoreDestroy(con, (RsProgramFragmentStore)pgm);
|
|
||||||
}
|
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -1054,14 +998,6 @@ nProgramFragmentCreate(JNIEnv *_env, jobject _this, jint slot, jboolean enable)
|
|||||||
return (jint)rsProgramFragmentCreate(con);
|
return (jint)rsProgramFragmentCreate(con);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
nProgramFragmentDestroy(JNIEnv *_env, jobject _this, jint pgm)
|
|
||||||
{
|
|
||||||
RsContext con = (RsContext)(_env->GetIntField(_this, gContextId));
|
|
||||||
LOG_API("nProgramFragmentDestroy, con(%p), pgm(%i)", con, pgm);
|
|
||||||
rsProgramFragmentDestroy(con, (RsProgramFragment)pgm);
|
|
||||||
}
|
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -1104,15 +1040,6 @@ nProgramVertexCreate(JNIEnv *_env, jobject _this)
|
|||||||
return (jint)rsProgramVertexCreate(con);
|
return (jint)rsProgramVertexCreate(con);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
nProgramVertexDestroy(JNIEnv *_env, jobject _this, jint pgm)
|
|
||||||
{
|
|
||||||
RsContext con = (RsContext)(_env->GetIntField(_this, gContextId));
|
|
||||||
LOG_API("nProgramFragmentDestroy, con(%p), pgm(%i)", con, pgm);
|
|
||||||
rsProgramFragmentDestroy(con, (RsProgramFragment)pgm);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
@@ -1172,14 +1099,6 @@ nContextAddDefineF(JNIEnv *_env, jobject _this, jstring name, jfloat value)
|
|||||||
|
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
|
|
||||||
static void
|
|
||||||
nSamplerDestroy(JNIEnv *_env, jobject _this, jint s)
|
|
||||||
{
|
|
||||||
RsContext con = (RsContext)(_env->GetIntField(_this, gContextId));
|
|
||||||
LOG_API("nSamplerDestroy, con(%p), sampler(%p)", con, (RsSampler)s);
|
|
||||||
rsSamplerDestroy(con, (RsSampler)s);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
nSamplerBegin(JNIEnv *_env, jobject _this)
|
nSamplerBegin(JNIEnv *_env, jobject _this)
|
||||||
{
|
{
|
||||||
@@ -1238,14 +1157,6 @@ nLightCreate(JNIEnv *_env, jobject _this)
|
|||||||
return (jint)rsLightCreate(con);
|
return (jint)rsLightCreate(con);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
nLightDestroy(JNIEnv *_env, jobject _this, jint light)
|
|
||||||
{
|
|
||||||
RsContext con = (RsContext)(_env->GetIntField(_this, gContextId));
|
|
||||||
LOG_API("nLightDestroy, con(%p), light(%p)", con, (RsLight)light);
|
|
||||||
rsLightDestroy(con, (RsLight)light);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
nLightSetColor(JNIEnv *_env, jobject _this, jint light, float r, float g, float b)
|
nLightSetColor(JNIEnv *_env, jobject _this, jint light, float r, float g, float b)
|
||||||
{
|
{
|
||||||
@@ -1264,14 +1175,6 @@ nLightSetPosition(JNIEnv *_env, jobject _this, jint light, float x, float y, flo
|
|||||||
|
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
|
|
||||||
static void
|
|
||||||
nSimpleMeshDestroy(JNIEnv *_env, jobject _this, jint s)
|
|
||||||
{
|
|
||||||
RsContext con = (RsContext)(_env->GetIntField(_this, gContextId));
|
|
||||||
LOG_API("nSimpleMeshDestroy, con(%p), SimpleMesh(%p)", con, (RsSimpleMesh)s);
|
|
||||||
rsSimpleMeshDestroy(con, (RsSimpleMesh)s);
|
|
||||||
}
|
|
||||||
|
|
||||||
static jint
|
static jint
|
||||||
nSimpleMeshCreate(JNIEnv *_env, jobject _this, jint batchID, jint indexID, jintArray vtxIDs, jint primID)
|
nSimpleMeshCreate(JNIEnv *_env, jobject _this, jint batchID, jint indexID, jintArray vtxIDs, jint primID)
|
||||||
{
|
{
|
||||||
@@ -1313,6 +1216,7 @@ static JNINativeMethod methods[] = {
|
|||||||
{"nContextCreate", "(ILandroid/view/Surface;I)I", (void*)nContextCreate },
|
{"nContextCreate", "(ILandroid/view/Surface;I)I", (void*)nContextCreate },
|
||||||
{"nContextDestroy", "(I)V", (void*)nContextDestroy },
|
{"nContextDestroy", "(I)V", (void*)nContextDestroy },
|
||||||
{"nAssignName", "(I[B)V", (void*)nAssignName },
|
{"nAssignName", "(I[B)V", (void*)nAssignName },
|
||||||
|
{"nObjDestroy", "(I)V", (void*)nObjDestroy },
|
||||||
|
|
||||||
{"nFileOpen", "([B)I", (void*)nFileOpen },
|
{"nFileOpen", "([B)I", (void*)nFileOpen },
|
||||||
|
|
||||||
@@ -1321,12 +1225,10 @@ static JNINativeMethod methods[] = {
|
|||||||
{"nElementAdd", "(IIIILjava/lang/String;)V", (void*)nElementAdd },
|
{"nElementAdd", "(IIIILjava/lang/String;)V", (void*)nElementAdd },
|
||||||
{"nElementCreate", "()I", (void*)nElementCreate },
|
{"nElementCreate", "()I", (void*)nElementCreate },
|
||||||
{"nElementGetPredefined", "(I)I", (void*)nElementGetPredefined },
|
{"nElementGetPredefined", "(I)I", (void*)nElementGetPredefined },
|
||||||
{"nElementDestroy", "(I)V", (void*)nElementDestroy },
|
|
||||||
|
|
||||||
{"nTypeBegin", "(I)V", (void*)nTypeBegin },
|
{"nTypeBegin", "(I)V", (void*)nTypeBegin },
|
||||||
{"nTypeAdd", "(II)V", (void*)nTypeAdd },
|
{"nTypeAdd", "(II)V", (void*)nTypeAdd },
|
||||||
{"nTypeCreate", "()I", (void*)nTypeCreate },
|
{"nTypeCreate", "()I", (void*)nTypeCreate },
|
||||||
{"nTypeDestroy", "(I)V", (void*)nTypeDestroy },
|
|
||||||
{"nTypeFinalDestroy", "(Landroid/renderscript/Type;)V", (void*)nTypeFinalDestroy },
|
{"nTypeFinalDestroy", "(Landroid/renderscript/Type;)V", (void*)nTypeFinalDestroy },
|
||||||
{"nTypeSetupFields", "(Landroid/renderscript/Type;[I[I[Ljava/lang/reflect/Field;)V", (void*)nTypeSetupFields },
|
{"nTypeSetupFields", "(Landroid/renderscript/Type;[I[I[Ljava/lang/reflect/Field;)V", (void*)nTypeSetupFields },
|
||||||
|
|
||||||
@@ -1336,7 +1238,6 @@ static JNINativeMethod methods[] = {
|
|||||||
{"nAllocationCreateFromBitmap", "(IZLandroid/graphics/Bitmap;)I", (void*)nAllocationCreateFromBitmap },
|
{"nAllocationCreateFromBitmap", "(IZLandroid/graphics/Bitmap;)I", (void*)nAllocationCreateFromBitmap },
|
||||||
{"nAllocationCreateFromBitmapBoxed","(IZLandroid/graphics/Bitmap;)I", (void*)nAllocationCreateFromBitmapBoxed },
|
{"nAllocationCreateFromBitmapBoxed","(IZLandroid/graphics/Bitmap;)I", (void*)nAllocationCreateFromBitmapBoxed },
|
||||||
{"nAllocationUploadToTexture", "(II)V", (void*)nAllocationUploadToTexture },
|
{"nAllocationUploadToTexture", "(II)V", (void*)nAllocationUploadToTexture },
|
||||||
{"nAllocationDestroy", "(I)V", (void*)nAllocationDestroy },
|
|
||||||
{"nAllocationData", "(I[I)V", (void*)nAllocationData_i },
|
{"nAllocationData", "(I[I)V", (void*)nAllocationData_i },
|
||||||
{"nAllocationData", "(I[F)V", (void*)nAllocationData_f },
|
{"nAllocationData", "(I[F)V", (void*)nAllocationData_f },
|
||||||
{"nAllocationSubData1D", "(III[I)V", (void*)nAllocationSubData1D_i },
|
{"nAllocationSubData1D", "(III[I)V", (void*)nAllocationSubData1D_i },
|
||||||
@@ -1347,7 +1248,6 @@ static JNINativeMethod methods[] = {
|
|||||||
{"nAllocationRead", "(I[F)V", (void*)nAllocationRead_f },
|
{"nAllocationRead", "(I[F)V", (void*)nAllocationRead_f },
|
||||||
{"nAllocationDataFromObject", "(ILandroid/renderscript/Type;Ljava/lang/Object;)V", (void*)nAllocationDataFromObject },
|
{"nAllocationDataFromObject", "(ILandroid/renderscript/Type;Ljava/lang/Object;)V", (void*)nAllocationDataFromObject },
|
||||||
|
|
||||||
{"nTriangleMeshDestroy", "(I)V", (void*)nTriangleMeshDestroy },
|
|
||||||
{"nTriangleMeshBegin", "(II)V", (void*)nTriangleMeshBegin },
|
{"nTriangleMeshBegin", "(II)V", (void*)nTriangleMeshBegin },
|
||||||
{"nTriangleMeshAddVertex_XY", "(FF)V", (void*)nTriangleMeshAddVertex_XY },
|
{"nTriangleMeshAddVertex_XY", "(FF)V", (void*)nTriangleMeshAddVertex_XY },
|
||||||
{"nTriangleMeshAddVertex_XYZ", "(FFF)V", (void*)nTriangleMeshAddVertex_XYZ },
|
{"nTriangleMeshAddVertex_XYZ", "(FFF)V", (void*)nTriangleMeshAddVertex_XYZ },
|
||||||
@@ -1357,7 +1257,6 @@ static JNINativeMethod methods[] = {
|
|||||||
{"nTriangleMeshAddTriangle", "(III)V", (void*)nTriangleMeshAddTriangle },
|
{"nTriangleMeshAddTriangle", "(III)V", (void*)nTriangleMeshAddTriangle },
|
||||||
{"nTriangleMeshCreate", "()I", (void*)nTriangleMeshCreate },
|
{"nTriangleMeshCreate", "()I", (void*)nTriangleMeshCreate },
|
||||||
|
|
||||||
{"nAdapter1DDestroy", "(I)V", (void*)nAdapter1DDestroy },
|
|
||||||
{"nAdapter1DBindAllocation", "(II)V", (void*)nAdapter1DBindAllocation },
|
{"nAdapter1DBindAllocation", "(II)V", (void*)nAdapter1DBindAllocation },
|
||||||
{"nAdapter1DSetConstraint", "(III)V", (void*)nAdapter1DSetConstraint },
|
{"nAdapter1DSetConstraint", "(III)V", (void*)nAdapter1DSetConstraint },
|
||||||
{"nAdapter1DData", "(I[I)V", (void*)nAdapter1DData_i },
|
{"nAdapter1DData", "(I[I)V", (void*)nAdapter1DData_i },
|
||||||
@@ -1366,7 +1265,6 @@ static JNINativeMethod methods[] = {
|
|||||||
{"nAdapter1DSubData", "(III[F)V", (void*)nAdapter1DSubData_f },
|
{"nAdapter1DSubData", "(III[F)V", (void*)nAdapter1DSubData_f },
|
||||||
{"nAdapter1DCreate", "()I", (void*)nAdapter1DCreate },
|
{"nAdapter1DCreate", "()I", (void*)nAdapter1DCreate },
|
||||||
|
|
||||||
{"nAdapter2DDestroy", "(I)V", (void*)nAdapter2DDestroy },
|
|
||||||
{"nAdapter2DBindAllocation", "(II)V", (void*)nAdapter2DBindAllocation },
|
{"nAdapter2DBindAllocation", "(II)V", (void*)nAdapter2DBindAllocation },
|
||||||
{"nAdapter2DSetConstraint", "(III)V", (void*)nAdapter2DSetConstraint },
|
{"nAdapter2DSetConstraint", "(III)V", (void*)nAdapter2DSetConstraint },
|
||||||
{"nAdapter2DData", "(I[I)V", (void*)nAdapter2DData_i },
|
{"nAdapter2DData", "(I[I)V", (void*)nAdapter2DData_i },
|
||||||
@@ -1375,7 +1273,6 @@ static JNINativeMethod methods[] = {
|
|||||||
{"nAdapter2DSubData", "(IIIII[F)V", (void*)nAdapter2DSubData_f },
|
{"nAdapter2DSubData", "(IIIII[F)V", (void*)nAdapter2DSubData_f },
|
||||||
{"nAdapter2DCreate", "()I", (void*)nAdapter2DCreate },
|
{"nAdapter2DCreate", "()I", (void*)nAdapter2DCreate },
|
||||||
|
|
||||||
{"nScriptDestroy", "(I)V", (void*)nScriptDestroy },
|
|
||||||
{"nScriptBindAllocation", "(III)V", (void*)nScriptBindAllocation },
|
{"nScriptBindAllocation", "(III)V", (void*)nScriptBindAllocation },
|
||||||
{"nScriptSetClearColor", "(IFFFF)V", (void*)nScriptSetClearColor },
|
{"nScriptSetClearColor", "(IFFFF)V", (void*)nScriptSetClearColor },
|
||||||
{"nScriptSetClearDepth", "(IF)V", (void*)nScriptSetClearDepth },
|
{"nScriptSetClearDepth", "(IF)V", (void*)nScriptSetClearDepth },
|
||||||
@@ -1397,7 +1294,6 @@ static JNINativeMethod methods[] = {
|
|||||||
{"nProgramFragmentStoreBlendFunc", "(II)V", (void*)nProgramFragmentStoreBlendFunc },
|
{"nProgramFragmentStoreBlendFunc", "(II)V", (void*)nProgramFragmentStoreBlendFunc },
|
||||||
{"nProgramFragmentStoreDither", "(Z)V", (void*)nProgramFragmentStoreDither },
|
{"nProgramFragmentStoreDither", "(Z)V", (void*)nProgramFragmentStoreDither },
|
||||||
{"nProgramFragmentStoreCreate", "()I", (void*)nProgramFragmentStoreCreate },
|
{"nProgramFragmentStoreCreate", "()I", (void*)nProgramFragmentStoreCreate },
|
||||||
{"nProgramFragmentStoreDestroy", "(I)V", (void*)nProgramFragmentStoreDestroy },
|
|
||||||
|
|
||||||
{"nProgramFragmentBegin", "(II)V", (void*)nProgramFragmentBegin },
|
{"nProgramFragmentBegin", "(II)V", (void*)nProgramFragmentBegin },
|
||||||
{"nProgramFragmentBindTexture", "(III)V", (void*)nProgramFragmentBindTexture },
|
{"nProgramFragmentBindTexture", "(III)V", (void*)nProgramFragmentBindTexture },
|
||||||
@@ -1406,9 +1302,7 @@ static JNINativeMethod methods[] = {
|
|||||||
{"nProgramFragmentSetEnvMode", "(II)V", (void*)nProgramFragmentSetEnvMode },
|
{"nProgramFragmentSetEnvMode", "(II)V", (void*)nProgramFragmentSetEnvMode },
|
||||||
{"nProgramFragmentSetTexEnable", "(IZ)V", (void*)nProgramFragmentSetTexEnable },
|
{"nProgramFragmentSetTexEnable", "(IZ)V", (void*)nProgramFragmentSetTexEnable },
|
||||||
{"nProgramFragmentCreate", "()I", (void*)nProgramFragmentCreate },
|
{"nProgramFragmentCreate", "()I", (void*)nProgramFragmentCreate },
|
||||||
{"nProgramFragmentDestroy", "(I)V", (void*)nProgramFragmentDestroy },
|
|
||||||
|
|
||||||
{"nProgramVertexDestroy", "(I)V", (void*)nProgramVertexDestroy },
|
|
||||||
{"nProgramVertexBindAllocation", "(II)V", (void*)nProgramVertexBindAllocation },
|
{"nProgramVertexBindAllocation", "(II)V", (void*)nProgramVertexBindAllocation },
|
||||||
{"nProgramVertexBegin", "(II)V", (void*)nProgramVertexBegin },
|
{"nProgramVertexBegin", "(II)V", (void*)nProgramVertexBegin },
|
||||||
{"nProgramVertexSetTextureMatrixEnable", "(Z)V", (void*)nProgramVertexSetTextureMatrixEnable },
|
{"nProgramVertexSetTextureMatrixEnable", "(Z)V", (void*)nProgramVertexSetTextureMatrixEnable },
|
||||||
@@ -1419,7 +1313,6 @@ static JNINativeMethod methods[] = {
|
|||||||
{"nLightSetIsMono", "(Z)V", (void*)nLightSetIsMono },
|
{"nLightSetIsMono", "(Z)V", (void*)nLightSetIsMono },
|
||||||
{"nLightSetIsLocal", "(Z)V", (void*)nLightSetIsLocal },
|
{"nLightSetIsLocal", "(Z)V", (void*)nLightSetIsLocal },
|
||||||
{"nLightCreate", "()I", (void*)nLightCreate },
|
{"nLightCreate", "()I", (void*)nLightCreate },
|
||||||
{"nLightDestroy", "(I)V", (void*)nLightDestroy },
|
|
||||||
{"nLightSetColor", "(IFFF)V", (void*)nLightSetColor },
|
{"nLightSetColor", "(IFFF)V", (void*)nLightSetColor },
|
||||||
{"nLightSetPosition", "(IFFF)V", (void*)nLightSetPosition },
|
{"nLightSetPosition", "(IFFF)V", (void*)nLightSetPosition },
|
||||||
|
|
||||||
@@ -1428,12 +1321,10 @@ static JNINativeMethod methods[] = {
|
|||||||
{"nContextBindProgramFragment", "(I)V", (void*)nContextBindProgramFragment },
|
{"nContextBindProgramFragment", "(I)V", (void*)nContextBindProgramFragment },
|
||||||
{"nContextBindProgramVertex", "(I)V", (void*)nContextBindProgramVertex },
|
{"nContextBindProgramVertex", "(I)V", (void*)nContextBindProgramVertex },
|
||||||
|
|
||||||
{"nSamplerDestroy", "(I)V", (void*)nSamplerDestroy },
|
|
||||||
{"nSamplerBegin", "()V", (void*)nSamplerBegin },
|
{"nSamplerBegin", "()V", (void*)nSamplerBegin },
|
||||||
{"nSamplerSet", "(II)V", (void*)nSamplerSet },
|
{"nSamplerSet", "(II)V", (void*)nSamplerSet },
|
||||||
{"nSamplerCreate", "()I", (void*)nSamplerCreate },
|
{"nSamplerCreate", "()I", (void*)nSamplerCreate },
|
||||||
|
|
||||||
{"nSimpleMeshDestroy", "(I)V", (void*)nSimpleMeshDestroy },
|
|
||||||
{"nSimpleMeshCreate", "(II[II)I", (void*)nSimpleMeshCreate },
|
{"nSimpleMeshCreate", "(II[II)I", (void*)nSimpleMeshCreate },
|
||||||
{"nSimpleMeshBindVertex", "(III)V", (void*)nSimpleMeshBindVertex },
|
{"nSimpleMeshBindVertex", "(III)V", (void*)nSimpleMeshBindVertex },
|
||||||
{"nSimpleMeshBindIndex", "(II)V", (void*)nSimpleMeshBindIndex },
|
{"nSimpleMeshBindIndex", "(II)V", (void*)nSimpleMeshBindIndex },
|
||||||
|
|||||||
@@ -32,6 +32,10 @@ AssignName {
|
|||||||
param size_t len
|
param size_t len
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ObjDestroy {
|
||||||
|
param void *obj
|
||||||
|
}
|
||||||
|
|
||||||
ElementBegin {
|
ElementBegin {
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -56,10 +60,6 @@ ElementGetPredefined {
|
|||||||
ret RsElement
|
ret RsElement
|
||||||
}
|
}
|
||||||
|
|
||||||
ElementDestroy {
|
|
||||||
param RsElement ve
|
|
||||||
}
|
|
||||||
|
|
||||||
TypeBegin {
|
TypeBegin {
|
||||||
param RsElement type
|
param RsElement type
|
||||||
}
|
}
|
||||||
@@ -73,10 +73,6 @@ TypeCreate {
|
|||||||
ret RsType
|
ret RsType
|
||||||
}
|
}
|
||||||
|
|
||||||
TypeDestroy {
|
|
||||||
param RsType p
|
|
||||||
}
|
|
||||||
|
|
||||||
AllocationCreateTyped {
|
AllocationCreateTyped {
|
||||||
param RsType type
|
param RsType type
|
||||||
ret RsAllocation
|
ret RsAllocation
|
||||||
@@ -130,10 +126,6 @@ AllocationUploadToBufferObject {
|
|||||||
param RsAllocation alloc
|
param RsAllocation alloc
|
||||||
}
|
}
|
||||||
|
|
||||||
AllocationDestroy {
|
|
||||||
param RsAllocation alloc
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
AllocationData {
|
AllocationData {
|
||||||
param RsAllocation va
|
param RsAllocation va
|
||||||
@@ -170,10 +162,6 @@ Adapter1DBindAllocation {
|
|||||||
param RsAllocation alloc
|
param RsAllocation alloc
|
||||||
}
|
}
|
||||||
|
|
||||||
Adapter1DDestroy {
|
|
||||||
param RsAdapter1D adapter
|
|
||||||
}
|
|
||||||
|
|
||||||
Adapter1DSetConstraint {
|
Adapter1DSetConstraint {
|
||||||
param RsAdapter1D adapter
|
param RsAdapter1D adapter
|
||||||
param RsDimension dim
|
param RsDimension dim
|
||||||
@@ -201,10 +189,6 @@ Adapter2DBindAllocation {
|
|||||||
param RsAllocation alloc
|
param RsAllocation alloc
|
||||||
}
|
}
|
||||||
|
|
||||||
Adapter2DDestroy {
|
|
||||||
param RsAdapter2D adapter
|
|
||||||
}
|
|
||||||
|
|
||||||
Adapter2DSetConstraint {
|
Adapter2DSetConstraint {
|
||||||
param RsAdapter2D adapter
|
param RsAdapter2D adapter
|
||||||
param RsDimension dim
|
param RsDimension dim
|
||||||
@@ -237,9 +221,6 @@ SamplerCreate {
|
|||||||
ret RsSampler
|
ret RsSampler
|
||||||
}
|
}
|
||||||
|
|
||||||
SamplerDestroy {
|
|
||||||
param RsSampler s
|
|
||||||
}
|
|
||||||
|
|
||||||
TriangleMeshBegin {
|
TriangleMeshBegin {
|
||||||
param RsElement vertex
|
param RsElement vertex
|
||||||
@@ -260,9 +241,6 @@ TriangleMeshCreate {
|
|||||||
ret RsTriangleMesh
|
ret RsTriangleMesh
|
||||||
}
|
}
|
||||||
|
|
||||||
TriangleMeshDestroy {
|
|
||||||
param RsTriangleMesh mesh
|
|
||||||
}
|
|
||||||
|
|
||||||
TriangleMeshRender {
|
TriangleMeshRender {
|
||||||
param RsTriangleMesh vtm
|
param RsTriangleMesh vtm
|
||||||
@@ -274,9 +252,6 @@ TriangleMeshRenderRange {
|
|||||||
param uint32_t count
|
param uint32_t count
|
||||||
}
|
}
|
||||||
|
|
||||||
ScriptDestroy {
|
|
||||||
param RsScript script
|
|
||||||
}
|
|
||||||
|
|
||||||
ScriptBindAllocation {
|
ScriptBindAllocation {
|
||||||
param RsScript vtm
|
param RsScript vtm
|
||||||
@@ -381,9 +356,6 @@ ProgramFragmentStoreCreate {
|
|||||||
ret RsProgramFragmentStore
|
ret RsProgramFragmentStore
|
||||||
}
|
}
|
||||||
|
|
||||||
ProgramFragmentStoreDestroy {
|
|
||||||
param RsProgramFragmentStore pfs
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
ProgramFragmentBegin {
|
ProgramFragmentBegin {
|
||||||
@@ -422,10 +394,6 @@ ProgramFragmentCreate {
|
|||||||
ret RsProgramFragment
|
ret RsProgramFragment
|
||||||
}
|
}
|
||||||
|
|
||||||
ProgramFragmentDestroy {
|
|
||||||
param RsProgramFragment pf
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
ProgramVertexBegin {
|
ProgramVertexBegin {
|
||||||
param RsElement in
|
param RsElement in
|
||||||
@@ -464,9 +432,6 @@ LightCreate {
|
|||||||
ret RsLight light
|
ret RsLight light
|
||||||
}
|
}
|
||||||
|
|
||||||
LightDestroy {
|
|
||||||
param RsLight light
|
|
||||||
}
|
|
||||||
|
|
||||||
LightSetPosition {
|
LightSetPosition {
|
||||||
param RsLight light
|
param RsLight light
|
||||||
@@ -498,9 +463,6 @@ SimpleMeshCreate {
|
|||||||
param uint32_t primType
|
param uint32_t primType
|
||||||
}
|
}
|
||||||
|
|
||||||
SimpleMeshDestroy {
|
|
||||||
param RsSimpleMesh mesh
|
|
||||||
}
|
|
||||||
|
|
||||||
SimpleMeshBindIndex {
|
SimpleMeshBindIndex {
|
||||||
param RsSimpleMesh mesh
|
param RsSimpleMesh mesh
|
||||||
|
|||||||
@@ -76,12 +76,6 @@ RsAdapter1D rsi_Adapter1DCreate(Context *rsc)
|
|||||||
return a;
|
return a;
|
||||||
}
|
}
|
||||||
|
|
||||||
void rsi_Adapter1DDestroy(Context *rsc, RsAdapter1D va)
|
|
||||||
{
|
|
||||||
Adapter1D * a = static_cast<Adapter1D *>(va);
|
|
||||||
a->decRef();
|
|
||||||
}
|
|
||||||
|
|
||||||
void rsi_Adapter1DBindAllocation(Context *rsc, RsAdapter1D va, RsAllocation valloc)
|
void rsi_Adapter1DBindAllocation(Context *rsc, RsAdapter1D va, RsAllocation valloc)
|
||||||
{
|
{
|
||||||
Adapter1D * a = static_cast<Adapter1D *>(va);
|
Adapter1D * a = static_cast<Adapter1D *>(va);
|
||||||
@@ -195,12 +189,6 @@ RsAdapter2D rsi_Adapter2DCreate(Context *rsc)
|
|||||||
return a;
|
return a;
|
||||||
}
|
}
|
||||||
|
|
||||||
void rsi_Adapter2DDestroy(Context *rsc, RsAdapter2D va)
|
|
||||||
{
|
|
||||||
Adapter2D * a = static_cast<Adapter2D *>(va);
|
|
||||||
a->decRef();
|
|
||||||
}
|
|
||||||
|
|
||||||
void rsi_Adapter2DBindAllocation(Context *rsc, RsAdapter2D va, RsAllocation valloc)
|
void rsi_Adapter2DBindAllocation(Context *rsc, RsAdapter2D va, RsAllocation valloc)
|
||||||
{
|
{
|
||||||
Adapter2D * a = static_cast<Adapter2D *>(va);
|
Adapter2D * a = static_cast<Adapter2D *>(va);
|
||||||
|
|||||||
@@ -201,10 +201,6 @@ void rsi_AllocationUploadToBufferObject(Context *rsc, RsAllocation va)
|
|||||||
alloc->uploadToBufferObject();
|
alloc->uploadToBufferObject();
|
||||||
}
|
}
|
||||||
|
|
||||||
void rsi_AllocationDestroy(Context *rsc, RsAllocation)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
static void mip565(const Adapter2D &out, const Adapter2D &in)
|
static void mip565(const Adapter2D &out, const Adapter2D &in)
|
||||||
{
|
{
|
||||||
uint32_t w = out.getDimX();
|
uint32_t w = out.getDimX();
|
||||||
|
|||||||
@@ -395,6 +395,13 @@ void rsi_AssignName(Context *rsc, void * obj, const char *name, uint32_t len)
|
|||||||
rsc->assignName(ob, name, len);
|
rsc->assignName(ob, name, len);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void rsi_ObjDestroy(Context *rsc, void *obj)
|
||||||
|
{
|
||||||
|
ObjectBase *ob = static_cast<ObjectBase *>(obj);
|
||||||
|
rsc->removeName(ob);
|
||||||
|
ob->decRef();
|
||||||
|
}
|
||||||
|
|
||||||
void rsi_ContextSetDefineF(Context *rsc, const char* name, float value)
|
void rsi_ContextSetDefineF(Context *rsc, const char* name, float value)
|
||||||
{
|
{
|
||||||
rsc->addInt32Define(name, value);
|
rsc->addInt32Define(name, value);
|
||||||
|
|||||||
@@ -416,12 +416,6 @@ RsElement rsi_ElementCreate(Context *rsc)
|
|||||||
return se;
|
return se;
|
||||||
}
|
}
|
||||||
|
|
||||||
void rsi_ElementDestroy(Context *rsc, RsElement vse)
|
|
||||||
{
|
|
||||||
Element * se = static_cast<Element *>(vse);
|
|
||||||
se->decRef();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -110,12 +110,6 @@ RsLight rsi_LightCreate(Context *rsc)
|
|||||||
return l;
|
return l;
|
||||||
}
|
}
|
||||||
|
|
||||||
void rsi_LightDestroy(Context *rsc, RsLight vl)
|
|
||||||
{
|
|
||||||
Light *l = static_cast<Light *>(vl);
|
|
||||||
l->decRef();
|
|
||||||
}
|
|
||||||
|
|
||||||
void rsi_LightSetColor(Context *rsc, RsLight vl, float r, float g, float b)
|
void rsi_LightSetColor(Context *rsc, RsLight vl, float r, float g, float b)
|
||||||
{
|
{
|
||||||
Light *l = static_cast<Light *>(vl);
|
Light *l = static_cast<Light *>(vl);
|
||||||
|
|||||||
@@ -236,15 +236,6 @@ RsProgramFragment rsi_ProgramFragmentCreate(Context *rsc)
|
|||||||
return pf;
|
return pf;
|
||||||
}
|
}
|
||||||
|
|
||||||
void rsi_ProgramFragmentDestroy(Context *rsc, RsProgramFragment vpf)
|
|
||||||
{
|
|
||||||
ProgramFragment *pf = (ProgramFragment *)vpf;
|
|
||||||
if (pf->getName()) {
|
|
||||||
rsc->removeName(pf);
|
|
||||||
}
|
|
||||||
pf->decRef();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -261,17 +261,6 @@ void rsi_ProgramFragmentStoreDither(Context *rsc, bool enable)
|
|||||||
rsc->mStateFragmentStore.mPFS->setDitherEnable(enable);
|
rsc->mStateFragmentStore.mPFS->setDitherEnable(enable);
|
||||||
}
|
}
|
||||||
|
|
||||||
void rsi_ProgramFragmentStoreDestroy(Context *rsc, RsProgramFragmentStore vpfs)
|
|
||||||
{
|
|
||||||
ProgramFragmentStore *pfs = (ProgramFragmentStore *)vpfs;
|
|
||||||
if (pfs->getName()) {
|
|
||||||
rsc->removeName(pfs);
|
|
||||||
}
|
|
||||||
pfs->decRef();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -146,12 +146,5 @@ RsSampler rsi_SamplerCreate(Context *rsc)
|
|||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
void rsi_SamplerDestroy(Context *rsc, RsSampler vs)
|
|
||||||
{
|
|
||||||
Sampler * s = static_cast<Sampler *>(vs);
|
|
||||||
s->decRef();
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}}
|
}}
|
||||||
|
|||||||
@@ -37,12 +37,6 @@ namespace android {
|
|||||||
namespace renderscript {
|
namespace renderscript {
|
||||||
|
|
||||||
|
|
||||||
void rsi_ScriptDestroy(Context * rsc, RsScript vs)
|
|
||||||
{
|
|
||||||
Script *s = static_cast<Script *>(vs);
|
|
||||||
s->decRef();
|
|
||||||
}
|
|
||||||
|
|
||||||
void rsi_ScriptBindAllocation(Context * rsc, RsScript vs, RsAllocation va, uint32_t slot)
|
void rsi_ScriptBindAllocation(Context * rsc, RsScript vs, RsAllocation va, uint32_t slot)
|
||||||
{
|
{
|
||||||
Script *s = static_cast<Script *>(vs);
|
Script *s = static_cast<Script *>(vs);
|
||||||
|
|||||||
@@ -135,12 +135,6 @@ void rsi_SimpleMeshBindPrimitive(Context *rsc, RsSimpleMesh mv, RsAllocation va)
|
|||||||
sm->mPrimitiveBuffer.set((Allocation *)va);
|
sm->mPrimitiveBuffer.set((Allocation *)va);
|
||||||
}
|
}
|
||||||
|
|
||||||
void rsi_SimpleMeshDestroy(Context *rsc, RsSimpleMesh vtm)
|
|
||||||
{
|
|
||||||
SimpleMesh * tm = static_cast<SimpleMesh *>(vtm);
|
|
||||||
tm->decRef();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -177,9 +177,16 @@ void Type::makeGLComponents()
|
|||||||
mGL.mColor.size = 3;
|
mGL.mColor.size = 3;
|
||||||
break;
|
break;
|
||||||
case Component::ALPHA:
|
case Component::ALPHA:
|
||||||
|
// Can be RGBA or A at this point
|
||||||
|
if (mGL.mColor.size > 0) {
|
||||||
rsAssert(mGL.mColor.size == 3);
|
rsAssert(mGL.mColor.size == 3);
|
||||||
rsAssert(mGL.mColor.type == c->getGLType());
|
rsAssert(mGL.mColor.type == c->getGLType());
|
||||||
mGL.mColor.size = 4;
|
mGL.mColor.size = 4;
|
||||||
|
} else {
|
||||||
|
mGL.mColor.size = 1;
|
||||||
|
mGL.mColor.offset = mElement->getComponentOffsetBytes(ct);
|
||||||
|
mGL.mColor.type = c->getGLType();
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case Component::NX:
|
case Component::NX:
|
||||||
@@ -352,11 +359,6 @@ RsType rsi_TypeCreate(Context *rsc)
|
|||||||
return st;
|
return st;
|
||||||
}
|
}
|
||||||
|
|
||||||
void rsi_TypeDestroy(Context *rsc, RsType vst)
|
|
||||||
{
|
|
||||||
Type * st = static_cast<Type *>(vst);
|
|
||||||
st->decRef();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user