summaryrefslogtreecommitdiff
path: root/libs/rs/rsProgramVertex.cpp
diff options
context:
space:
mode:
author Jason Sams <rjsams@android.com> 2009-09-25 14:51:22 -0700
committer Jason Sams <rjsams@android.com> 2009-09-25 14:51:22 -0700
commita9e7a05b84470257637c97d65f6562aa832c66ef (patch)
tree04a3175485ae7492c3387003c244953b6880c514 /libs/rs/rsProgramVertex.cpp
parenta0cad2f5d19d95cfe496ebb82f3227dd4ed7c169 (diff)
Improve renderscript context teardown. Track object in the system and then force their cleanup by releasing all user references once destroy context is called. Java layer will no longer send destroy notifications for objects garbage collected once a context is destroyed.
Diffstat (limited to 'libs/rs/rsProgramVertex.cpp')
-rw-r--r--libs/rs/rsProgramVertex.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/libs/rs/rsProgramVertex.cpp b/libs/rs/rsProgramVertex.cpp
index dda56d79db35..9eb32ff269df 100644
--- a/libs/rs/rsProgramVertex.cpp
+++ b/libs/rs/rsProgramVertex.cpp
@@ -24,8 +24,8 @@ using namespace android;
using namespace android::renderscript;
-ProgramVertex::ProgramVertex(Element *in, Element *out) :
- Program(in, out)
+ProgramVertex::ProgramVertex(Context *rsc, Element *in, Element *out) :
+ Program(rsc, in, out)
{
mTextureMatrixEnable = false;
mLightCount = 0;
@@ -141,7 +141,7 @@ void ProgramVertexState::init(Context *rsc, int32_t w, int32_t h)
rsi_TypeAdd(rsc, RS_DIMENSION_X, 48);
mAllocType = rsi_TypeCreate(rsc);
- ProgramVertex *pv = new ProgramVertex(NULL, NULL);
+ ProgramVertex *pv = new ProgramVertex(rsc, NULL, NULL);
Allocation *alloc = (Allocation *)rsi_AllocationCreateTyped(rsc, mAllocType);
mDefaultAlloc.set(alloc);
mDefault.set(pv);
@@ -163,7 +163,7 @@ namespace renderscript {
void rsi_ProgramVertexBegin(Context *rsc, RsElement in, RsElement out)
{
delete rsc->mStateVertex.mPV;
- rsc->mStateVertex.mPV = new ProgramVertex((Element *)in, (Element *)out);
+ rsc->mStateVertex.mPV = new ProgramVertex(rsc, (Element *)in, (Element *)out);
}
RsProgramVertex rsi_ProgramVertexCreate(Context *rsc)