Merge change 27169 into eclair
* changes: Improved object lifecycle tracking and fix leaks.
This commit is contained in:
@@ -23,11 +23,15 @@ using namespace android::renderscript;
|
|||||||
|
|
||||||
Adapter1D::Adapter1D(Context *rsc) : ObjectBase(rsc)
|
Adapter1D::Adapter1D(Context *rsc) : ObjectBase(rsc)
|
||||||
{
|
{
|
||||||
|
mAllocFile = __FILE__;
|
||||||
|
mAllocLine = __LINE__;
|
||||||
reset();
|
reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
Adapter1D::Adapter1D(Context *rsc, Allocation *a) : ObjectBase(rsc)
|
Adapter1D::Adapter1D(Context *rsc, Allocation *a) : ObjectBase(rsc)
|
||||||
{
|
{
|
||||||
|
mAllocFile = __FILE__;
|
||||||
|
mAllocLine = __LINE__;
|
||||||
reset();
|
reset();
|
||||||
setAllocation(a);
|
setAllocation(a);
|
||||||
}
|
}
|
||||||
@@ -127,11 +131,15 @@ void rsi_Adapter1DData(Context *rsc, RsAdapter1D va, const void *data)
|
|||||||
|
|
||||||
Adapter2D::Adapter2D(Context *rsc) : ObjectBase(rsc)
|
Adapter2D::Adapter2D(Context *rsc) : ObjectBase(rsc)
|
||||||
{
|
{
|
||||||
|
mAllocFile = __FILE__;
|
||||||
|
mAllocLine = __LINE__;
|
||||||
reset();
|
reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
Adapter2D::Adapter2D(Context *rsc, Allocation *a) : ObjectBase(rsc)
|
Adapter2D::Adapter2D(Context *rsc, Allocation *a) : ObjectBase(rsc)
|
||||||
{
|
{
|
||||||
|
mAllocFile = __FILE__;
|
||||||
|
mAllocLine = __LINE__;
|
||||||
reset();
|
reset();
|
||||||
setAllocation(a);
|
setAllocation(a);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,6 +24,8 @@ using namespace android::renderscript;
|
|||||||
|
|
||||||
Allocation::Allocation(Context *rsc, const Type *type) : ObjectBase(rsc)
|
Allocation::Allocation(Context *rsc, const Type *type) : ObjectBase(rsc)
|
||||||
{
|
{
|
||||||
|
mAllocFile = __FILE__;
|
||||||
|
mAllocLine = __LINE__;
|
||||||
mPtr = NULL;
|
mPtr = NULL;
|
||||||
|
|
||||||
mCpuWrite = false;
|
mCpuWrite = false;
|
||||||
|
|||||||
@@ -23,6 +23,8 @@ using namespace android::renderscript;
|
|||||||
|
|
||||||
Component::Component(Context *rsc) : ObjectBase(rsc)
|
Component::Component(Context *rsc) : ObjectBase(rsc)
|
||||||
{
|
{
|
||||||
|
mAllocFile = __FILE__;
|
||||||
|
mAllocLine = __LINE__;
|
||||||
mType = FLOAT;
|
mType = FLOAT;
|
||||||
mKind = USER;
|
mKind = USER;
|
||||||
mIsNormalized = false;
|
mIsNormalized = false;
|
||||||
@@ -33,6 +35,8 @@ Component::Component(Context *rsc,
|
|||||||
DataKind dk, DataType dt,
|
DataKind dk, DataType dt,
|
||||||
bool isNormalized, uint32_t bits, const char * name) : ObjectBase(rsc)
|
bool isNormalized, uint32_t bits, const char * name) : ObjectBase(rsc)
|
||||||
{
|
{
|
||||||
|
mAllocFile = __FILE__;
|
||||||
|
mAllocLine = __LINE__;
|
||||||
mType = dt;
|
mType = dt;
|
||||||
mKind = dk;
|
mKind = dk;
|
||||||
mIsNormalized = isNormalized;
|
mIsNormalized = isNormalized;
|
||||||
|
|||||||
@@ -269,11 +269,16 @@ void * Context::threadProc(void *vrsc)
|
|||||||
}
|
}
|
||||||
|
|
||||||
LOGV("RS Thread exiting");
|
LOGV("RS Thread exiting");
|
||||||
|
rsc->mRaster.clear();
|
||||||
|
rsc->mFragment.clear();
|
||||||
|
rsc->mVertex.clear();
|
||||||
|
rsc->mFragmentStore.clear();
|
||||||
|
rsc->mRootScript.clear();
|
||||||
|
rsc->mStateRaster.deinit(rsc);
|
||||||
|
rsc->mStateVertex.deinit(rsc);
|
||||||
|
rsc->mStateFragment.deinit(rsc);
|
||||||
|
rsc->mStateFragmentStore.deinit(rsc);
|
||||||
ObjectBase::zeroAllUserRef(rsc);
|
ObjectBase::zeroAllUserRef(rsc);
|
||||||
rsc->mRaster.set(NULL);
|
|
||||||
rsc->mFragment.set(NULL);
|
|
||||||
rsc->mVertex.set(NULL);
|
|
||||||
rsc->mFragmentStore.set(NULL);
|
|
||||||
|
|
||||||
glClearColor(0,0,0,0);
|
glClearColor(0,0,0,0);
|
||||||
glClear(GL_COLOR_BUFFER_BIT);
|
glClear(GL_COLOR_BUFFER_BIT);
|
||||||
|
|||||||
@@ -24,12 +24,16 @@ using namespace android::renderscript;
|
|||||||
|
|
||||||
Element::Element(Context *rsc) : ObjectBase(rsc)
|
Element::Element(Context *rsc) : ObjectBase(rsc)
|
||||||
{
|
{
|
||||||
|
mAllocFile = __FILE__;
|
||||||
|
mAllocLine = __LINE__;
|
||||||
mComponents = NULL;
|
mComponents = NULL;
|
||||||
mComponentCount = 0;
|
mComponentCount = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
Element::Element(Context *rsc, uint32_t count) : ObjectBase(rsc)
|
Element::Element(Context *rsc, uint32_t count) : ObjectBase(rsc)
|
||||||
{
|
{
|
||||||
|
mAllocFile = __FILE__;
|
||||||
|
mAllocLine = __LINE__;
|
||||||
mComponents = new ObjectBaseRef<Component> [count];
|
mComponents = new ObjectBaseRef<Component> [count];
|
||||||
mComponentCount = count;
|
mComponentCount = count;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,6 +24,8 @@ using namespace android::renderscript;
|
|||||||
|
|
||||||
Light::Light(Context *rsc, bool isLocal, bool isMono) : ObjectBase(rsc)
|
Light::Light(Context *rsc, bool isLocal, bool isMono) : ObjectBase(rsc)
|
||||||
{
|
{
|
||||||
|
mAllocFile = __FILE__;
|
||||||
|
mAllocLine = __LINE__;
|
||||||
mIsLocal = isLocal;
|
mIsLocal = isLocal;
|
||||||
mIsMono = isMono;
|
mIsMono = isMono;
|
||||||
|
|
||||||
|
|||||||
@@ -24,6 +24,8 @@ using namespace android::renderscript;
|
|||||||
|
|
||||||
Mesh::Mesh(Context *rsc) : ObjectBase(rsc)
|
Mesh::Mesh(Context *rsc) : ObjectBase(rsc)
|
||||||
{
|
{
|
||||||
|
mAllocFile = __FILE__;
|
||||||
|
mAllocLine = __LINE__;
|
||||||
mVerticies = NULL;
|
mVerticies = NULL;
|
||||||
mVerticiesCount = 0;
|
mVerticiesCount = 0;
|
||||||
mPrimitives = NULL;
|
mPrimitives = NULL;
|
||||||
|
|||||||
@@ -28,6 +28,8 @@ ObjectBase::ObjectBase(Context *rsc)
|
|||||||
mRSC = NULL;
|
mRSC = NULL;
|
||||||
mNext = NULL;
|
mNext = NULL;
|
||||||
mPrev = NULL;
|
mPrev = NULL;
|
||||||
|
mAllocFile = __FILE__;
|
||||||
|
mAllocLine = __LINE__;
|
||||||
setContext(rsc);
|
setContext(rsc);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -39,6 +41,17 @@ ObjectBase::~ObjectBase()
|
|||||||
remove();
|
remove();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ObjectBase::dumpObj(const char *op) const
|
||||||
|
{
|
||||||
|
if (mName) {
|
||||||
|
LOGV("%s RSobj %p, name %s, refs %i,%i from %s,%i links %p,%p,%p",
|
||||||
|
op, this, mName, mUserRefCount, mSysRefCount, mAllocFile, mAllocLine, mNext, mPrev, mRSC);
|
||||||
|
} else {
|
||||||
|
LOGV("%s RSobj %p, no-name, refs %i,%i from %s,%i links %p,%p,%p",
|
||||||
|
op, this, mUserRefCount, mSysRefCount, mAllocFile, mAllocLine, mNext, mPrev, mRSC);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void ObjectBase::setContext(Context *rsc)
|
void ObjectBase::setContext(Context *rsc)
|
||||||
{
|
{
|
||||||
if (mRSC) {
|
if (mRSC) {
|
||||||
@@ -66,11 +79,7 @@ bool ObjectBase::checkDelete() const
|
|||||||
{
|
{
|
||||||
if (!(mSysRefCount | mUserRefCount)) {
|
if (!(mSysRefCount | mUserRefCount)) {
|
||||||
if (mRSC && mRSC->props.mLogObjects) {
|
if (mRSC && mRSC->props.mLogObjects) {
|
||||||
if (mName) {
|
dumpObj("checkDelete");
|
||||||
LOGV("Deleting RS object %p, name %s", this, mName);
|
|
||||||
} else {
|
|
||||||
LOGV("Deleting RS object %p, no name", this);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
delete this;
|
delete this;
|
||||||
return true;
|
return true;
|
||||||
@@ -82,14 +91,14 @@ bool ObjectBase::decUserRef() const
|
|||||||
{
|
{
|
||||||
rsAssert(mUserRefCount > 0);
|
rsAssert(mUserRefCount > 0);
|
||||||
mUserRefCount --;
|
mUserRefCount --;
|
||||||
//LOGV("ObjectBase %p dec ref %i", this, mRefCount);
|
//dumpObj("decUserRef");
|
||||||
return checkDelete();
|
return checkDelete();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ObjectBase::zeroUserRef() const
|
bool ObjectBase::zeroUserRef() const
|
||||||
{
|
{
|
||||||
mUserRefCount = 0;
|
mUserRefCount = 0;
|
||||||
//LOGV("ObjectBase %p dec ref %i", this, mRefCount);
|
//dumpObj("zeroUserRef");
|
||||||
return checkDelete();
|
return checkDelete();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -97,7 +106,7 @@ bool ObjectBase::decSysRef() const
|
|||||||
{
|
{
|
||||||
rsAssert(mSysRefCount > 0);
|
rsAssert(mSysRefCount > 0);
|
||||||
mSysRefCount --;
|
mSysRefCount --;
|
||||||
//LOGV("ObjectBase %p dec ref %i", this, mRefCount);
|
//dumpObj("decSysRef");
|
||||||
return checkDelete();
|
return checkDelete();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -174,5 +183,14 @@ void ObjectBase::zeroAllUserRef(Context *rsc)
|
|||||||
//LOGE("o next %p", o);
|
//LOGE("o next %p", o);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (rsc->props.mLogObjects) {
|
||||||
|
LOGV("Objects remaining.");
|
||||||
|
o = rsc->mObjHead;
|
||||||
|
while (o) {
|
||||||
|
o->dumpObj(" ");
|
||||||
|
o = o->mNext;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -50,6 +50,12 @@ public:
|
|||||||
|
|
||||||
static void zeroAllUserRef(Context *rsc);
|
static void zeroAllUserRef(Context *rsc);
|
||||||
|
|
||||||
|
void dumpObj(const char *op) const;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
const char *mAllocFile;
|
||||||
|
uint32_t mAllocLine;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void add() const;
|
void add() const;
|
||||||
void remove() const;
|
void remove() const;
|
||||||
|
|||||||
@@ -23,10 +23,11 @@ using namespace android::renderscript;
|
|||||||
|
|
||||||
Program::Program(Context *rsc, Element *in, Element *out) : ObjectBase(rsc)
|
Program::Program(Context *rsc, Element *in, Element *out) : ObjectBase(rsc)
|
||||||
{
|
{
|
||||||
|
mAllocFile = __FILE__;
|
||||||
|
mAllocLine = __LINE__;
|
||||||
|
|
||||||
mElementIn.set(in);
|
mElementIn.set(in);
|
||||||
mElementOut.set(out);
|
mElementOut.set(out);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Program::~Program()
|
Program::~Program()
|
||||||
|
|||||||
@@ -27,6 +27,8 @@ using namespace android::renderscript;
|
|||||||
ProgramFragment::ProgramFragment(Context *rsc, Element *in, Element *out, bool pointSpriteEnable) :
|
ProgramFragment::ProgramFragment(Context *rsc, Element *in, Element *out, bool pointSpriteEnable) :
|
||||||
Program(rsc, in, out)
|
Program(rsc, in, out)
|
||||||
{
|
{
|
||||||
|
mAllocFile = __FILE__;
|
||||||
|
mAllocLine = __LINE__;
|
||||||
for (uint32_t ct=0; ct < MAX_TEXTURE; ct++) {
|
for (uint32_t ct=0; ct < MAX_TEXTURE; ct++) {
|
||||||
mEnvModes[ct] = RS_TEX_ENV_MODE_REPLACE;
|
mEnvModes[ct] = RS_TEX_ENV_MODE_REPLACE;
|
||||||
mTextureDimensions[ct] = 2;
|
mTextureDimensions[ct] = 2;
|
||||||
@@ -190,6 +192,12 @@ void ProgramFragmentState::init(Context *rsc, int32_t w, int32_t h)
|
|||||||
mDefault.set(pf);
|
mDefault.set(pf);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ProgramFragmentState::deinit(Context *rsc)
|
||||||
|
{
|
||||||
|
mDefault.clear();
|
||||||
|
mLast.clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
namespace android {
|
namespace android {
|
||||||
namespace renderscript {
|
namespace renderscript {
|
||||||
|
|||||||
@@ -75,6 +75,7 @@ public:
|
|||||||
|
|
||||||
ProgramFragment *mPF;
|
ProgramFragment *mPF;
|
||||||
void init(Context *rsc, int32_t w, int32_t h);
|
void init(Context *rsc, int32_t w, int32_t h);
|
||||||
|
void deinit(Context *rsc);
|
||||||
|
|
||||||
ObjectBaseRef<Type> mTextureTypes[ProgramFragment::MAX_TEXTURE];
|
ObjectBaseRef<Type> mTextureTypes[ProgramFragment::MAX_TEXTURE];
|
||||||
ObjectBaseRef<ProgramFragment> mDefault;
|
ObjectBaseRef<ProgramFragment> mDefault;
|
||||||
|
|||||||
@@ -27,6 +27,8 @@ using namespace android::renderscript;
|
|||||||
ProgramFragmentStore::ProgramFragmentStore(Context *rsc, Element *in, Element *out) :
|
ProgramFragmentStore::ProgramFragmentStore(Context *rsc, Element *in, Element *out) :
|
||||||
Program(rsc, in, out)
|
Program(rsc, in, out)
|
||||||
{
|
{
|
||||||
|
mAllocFile = __FILE__;
|
||||||
|
mAllocLine = __LINE__;
|
||||||
mDitherEnable = true;
|
mDitherEnable = true;
|
||||||
mBlendEnable = false;
|
mBlendEnable = false;
|
||||||
mColorRWriteEnable = true;
|
mColorRWriteEnable = true;
|
||||||
@@ -217,6 +219,12 @@ void ProgramFragmentStoreState::init(Context *rsc, int32_t w, int32_t h)
|
|||||||
mDefault.set(pfs);
|
mDefault.set(pfs);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ProgramFragmentStoreState::deinit(Context *rsc)
|
||||||
|
{
|
||||||
|
mDefault.clear();
|
||||||
|
mLast.clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
namespace android {
|
namespace android {
|
||||||
namespace renderscript {
|
namespace renderscript {
|
||||||
|
|||||||
@@ -65,6 +65,7 @@ public:
|
|||||||
ProgramFragmentStoreState();
|
ProgramFragmentStoreState();
|
||||||
~ProgramFragmentStoreState();
|
~ProgramFragmentStoreState();
|
||||||
void init(Context *rsc, int32_t w, int32_t h);
|
void init(Context *rsc, int32_t w, int32_t h);
|
||||||
|
void deinit(Context *rsc);
|
||||||
|
|
||||||
ObjectBaseRef<ProgramFragmentStore> mDefault;
|
ObjectBaseRef<ProgramFragmentStore> mDefault;
|
||||||
ObjectBaseRef<ProgramFragmentStore> mLast;
|
ObjectBaseRef<ProgramFragmentStore> mLast;
|
||||||
|
|||||||
@@ -32,6 +32,8 @@ ProgramRaster::ProgramRaster(Context *rsc,
|
|||||||
bool pointSprite) :
|
bool pointSprite) :
|
||||||
Program(rsc, in, out)
|
Program(rsc, in, out)
|
||||||
{
|
{
|
||||||
|
mAllocFile = __FILE__;
|
||||||
|
mAllocLine = __LINE__;
|
||||||
mPointSmooth = pointSmooth;
|
mPointSmooth = pointSmooth;
|
||||||
mLineSmooth = lineSmooth;
|
mLineSmooth = lineSmooth;
|
||||||
mPointSprite = pointSprite;
|
mPointSprite = pointSprite;
|
||||||
@@ -100,6 +102,12 @@ void ProgramRasterState::init(Context *rsc, int32_t w, int32_t h)
|
|||||||
mDefault.set(pr);
|
mDefault.set(pr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ProgramRasterState::deinit(Context *rsc)
|
||||||
|
{
|
||||||
|
mDefault.clear();
|
||||||
|
mLast.clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
namespace android {
|
namespace android {
|
||||||
namespace renderscript {
|
namespace renderscript {
|
||||||
|
|||||||
@@ -58,6 +58,7 @@ public:
|
|||||||
ProgramRasterState();
|
ProgramRasterState();
|
||||||
~ProgramRasterState();
|
~ProgramRasterState();
|
||||||
void init(Context *rsc, int32_t w, int32_t h);
|
void init(Context *rsc, int32_t w, int32_t h);
|
||||||
|
void deinit(Context *rsc);
|
||||||
|
|
||||||
ObjectBaseRef<ProgramRaster> mDefault;
|
ObjectBaseRef<ProgramRaster> mDefault;
|
||||||
ObjectBaseRef<ProgramRaster> mLast;
|
ObjectBaseRef<ProgramRaster> mLast;
|
||||||
|
|||||||
@@ -27,6 +27,8 @@ using namespace android::renderscript;
|
|||||||
ProgramVertex::ProgramVertex(Context *rsc, Element *in, Element *out) :
|
ProgramVertex::ProgramVertex(Context *rsc, Element *in, Element *out) :
|
||||||
Program(rsc, in, out)
|
Program(rsc, in, out)
|
||||||
{
|
{
|
||||||
|
mAllocFile = __FILE__;
|
||||||
|
mAllocLine = __LINE__;
|
||||||
mTextureMatrixEnable = false;
|
mTextureMatrixEnable = false;
|
||||||
mLightCount = 0;
|
mLightCount = 0;
|
||||||
}
|
}
|
||||||
@@ -139,10 +141,10 @@ void ProgramVertexState::init(Context *rsc, int32_t w, int32_t h)
|
|||||||
|
|
||||||
rsi_TypeBegin(rsc, e);
|
rsi_TypeBegin(rsc, e);
|
||||||
rsi_TypeAdd(rsc, RS_DIMENSION_X, 48);
|
rsi_TypeAdd(rsc, RS_DIMENSION_X, 48);
|
||||||
mAllocType = rsi_TypeCreate(rsc);
|
mAllocType.set((Type *)rsi_TypeCreate(rsc));
|
||||||
|
|
||||||
ProgramVertex *pv = new ProgramVertex(rsc, NULL, NULL);
|
ProgramVertex *pv = new ProgramVertex(rsc, NULL, NULL);
|
||||||
Allocation *alloc = (Allocation *)rsi_AllocationCreateTyped(rsc, mAllocType);
|
Allocation *alloc = (Allocation *)rsi_AllocationCreateTyped(rsc, mAllocType.get());
|
||||||
mDefaultAlloc.set(alloc);
|
mDefaultAlloc.set(alloc);
|
||||||
mDefault.set(pv);
|
mDefault.set(pv);
|
||||||
|
|
||||||
@@ -156,6 +158,16 @@ void ProgramVertexState::init(Context *rsc, int32_t w, int32_t h)
|
|||||||
alloc->subData(RS_PROGRAM_VERTEX_MODELVIEW_OFFSET, 16, &m.m[0], 16*4);
|
alloc->subData(RS_PROGRAM_VERTEX_MODELVIEW_OFFSET, 16, &m.m[0], 16*4);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ProgramVertexState::deinit(Context *rsc)
|
||||||
|
{
|
||||||
|
mDefaultAlloc.clear();
|
||||||
|
mDefault.clear();
|
||||||
|
mAllocType.clear();
|
||||||
|
mLast.clear();
|
||||||
|
delete mPV;
|
||||||
|
mPV = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
namespace android {
|
namespace android {
|
||||||
namespace renderscript {
|
namespace renderscript {
|
||||||
|
|||||||
@@ -59,12 +59,13 @@ public:
|
|||||||
~ProgramVertexState();
|
~ProgramVertexState();
|
||||||
|
|
||||||
void init(Context *rsc, int32_t w, int32_t h);
|
void init(Context *rsc, int32_t w, int32_t h);
|
||||||
|
void deinit(Context *rsc);
|
||||||
|
|
||||||
ObjectBaseRef<ProgramVertex> mDefault;
|
ObjectBaseRef<ProgramVertex> mDefault;
|
||||||
ObjectBaseRef<ProgramVertex> mLast;
|
ObjectBaseRef<ProgramVertex> mLast;
|
||||||
ObjectBaseRef<Allocation> mDefaultAlloc;
|
ObjectBaseRef<Allocation> mDefaultAlloc;
|
||||||
|
|
||||||
RsType mAllocType;
|
ObjectBaseRef<Type> mAllocType;
|
||||||
|
|
||||||
ProgramVertex *mPV;
|
ProgramVertex *mPV;
|
||||||
|
|
||||||
|
|||||||
@@ -27,6 +27,8 @@ using namespace android::renderscript;
|
|||||||
|
|
||||||
Sampler::Sampler(Context *rsc) : ObjectBase(rsc)
|
Sampler::Sampler(Context *rsc) : ObjectBase(rsc)
|
||||||
{
|
{
|
||||||
|
mAllocFile = __FILE__;
|
||||||
|
mAllocLine = __LINE__;
|
||||||
// Should not get called.
|
// Should not get called.
|
||||||
rsAssert(0);
|
rsAssert(0);
|
||||||
}
|
}
|
||||||
@@ -38,6 +40,8 @@ Sampler::Sampler(Context *rsc,
|
|||||||
RsSamplerValue wrapT,
|
RsSamplerValue wrapT,
|
||||||
RsSamplerValue wrapR) : ObjectBase(rsc)
|
RsSamplerValue wrapR) : ObjectBase(rsc)
|
||||||
{
|
{
|
||||||
|
mAllocFile = __FILE__;
|
||||||
|
mAllocLine = __LINE__;
|
||||||
mMagFilter = magFilter;
|
mMagFilter = magFilter;
|
||||||
mMinFilter = minFilter;
|
mMinFilter = minFilter;
|
||||||
mWrapS = wrapS;
|
mWrapS = wrapS;
|
||||||
|
|||||||
@@ -21,6 +21,8 @@ using namespace android::renderscript;
|
|||||||
|
|
||||||
Script::Script(Context *rsc) : ObjectBase(rsc)
|
Script::Script(Context *rsc) : ObjectBase(rsc)
|
||||||
{
|
{
|
||||||
|
mAllocFile = __FILE__;
|
||||||
|
mAllocLine = __LINE__;
|
||||||
memset(&mEnviroment, 0, sizeof(mEnviroment));
|
memset(&mEnviroment, 0, sizeof(mEnviroment));
|
||||||
mEnviroment.mClearColor[0] = 0;
|
mEnviroment.mClearColor[0] = 0;
|
||||||
mEnviroment.mClearColor[1] = 0;
|
mEnviroment.mClearColor[1] = 0;
|
||||||
|
|||||||
@@ -35,6 +35,8 @@ using namespace android::renderscript;
|
|||||||
|
|
||||||
ScriptC::ScriptC(Context *rsc) : Script(rsc)
|
ScriptC::ScriptC(Context *rsc) : Script(rsc)
|
||||||
{
|
{
|
||||||
|
mAllocFile = __FILE__;
|
||||||
|
mAllocLine = __LINE__;
|
||||||
mAccScript = NULL;
|
mAccScript = NULL;
|
||||||
memset(&mProgram, 0, sizeof(mProgram));
|
memset(&mProgram, 0, sizeof(mProgram));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,10 +24,14 @@ using namespace android::renderscript;
|
|||||||
|
|
||||||
SimpleMesh::SimpleMesh(Context *rsc) : ObjectBase(rsc)
|
SimpleMesh::SimpleMesh(Context *rsc) : ObjectBase(rsc)
|
||||||
{
|
{
|
||||||
|
mAllocFile = __FILE__;
|
||||||
|
mAllocLine = __LINE__;
|
||||||
}
|
}
|
||||||
|
|
||||||
SimpleMesh::~SimpleMesh()
|
SimpleMesh::~SimpleMesh()
|
||||||
{
|
{
|
||||||
|
delete[] mVertexTypes;
|
||||||
|
delete[] mVertexBuffers;
|
||||||
}
|
}
|
||||||
|
|
||||||
void SimpleMesh::render() const
|
void SimpleMesh::render() const
|
||||||
|
|||||||
@@ -22,6 +22,8 @@ using namespace android::renderscript;
|
|||||||
|
|
||||||
Type::Type(Context *rsc) : ObjectBase(rsc)
|
Type::Type(Context *rsc) : ObjectBase(rsc)
|
||||||
{
|
{
|
||||||
|
mAllocFile = __FILE__;
|
||||||
|
mAllocLine = __LINE__;
|
||||||
mLODs = 0;
|
mLODs = 0;
|
||||||
mLODCount = 0;
|
mLODCount = 0;
|
||||||
memset(&mGL, 0, sizeof(mGL));
|
memset(&mGL, 0, sizeof(mGL));
|
||||||
|
|||||||
Reference in New Issue
Block a user