summaryrefslogtreecommitdiff
path: root/libs/rs/rsProgramRaster.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/rsProgramRaster.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/rsProgramRaster.cpp')
-rw-r--r--libs/rs/rsProgramRaster.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/libs/rs/rsProgramRaster.cpp b/libs/rs/rsProgramRaster.cpp
index b968fe1508b5..2a9c4abd2cb6 100644
--- a/libs/rs/rsProgramRaster.cpp
+++ b/libs/rs/rsProgramRaster.cpp
@@ -24,12 +24,13 @@ using namespace android;
using namespace android::renderscript;
-ProgramRaster::ProgramRaster(Element *in,
+ProgramRaster::ProgramRaster(Context *rsc,
+ Element *in,
Element *out,
bool pointSmooth,
bool lineSmooth,
bool pointSprite) :
- Program(in, out)
+ Program(rsc, in, out)
{
mPointSmooth = pointSmooth;
mLineSmooth = lineSmooth;
@@ -95,7 +96,7 @@ ProgramRasterState::~ProgramRasterState()
void ProgramRasterState::init(Context *rsc, int32_t w, int32_t h)
{
- ProgramRaster *pr = new ProgramRaster(NULL, NULL, false, false, false);
+ ProgramRaster *pr = new ProgramRaster(rsc, NULL, NULL, false, false, false);
mDefault.set(pr);
}
@@ -108,7 +109,8 @@ RsProgramRaster rsi_ProgramRasterCreate(Context * rsc, RsElement in, RsElement o
bool lineSmooth,
bool pointSprite)
{
- ProgramRaster *pr = new ProgramRaster(static_cast<Element *>(in),
+ ProgramRaster *pr = new ProgramRaster(rsc,
+ static_cast<Element *>(in),
static_cast<Element *>(out),
pointSmooth,
lineSmooth,