diff options
author | 2011-08-16 13:09:46 -0700 | |
---|---|---|
committer | 2011-08-16 13:09:46 -0700 | |
commit | 117abdbc67123654d0754b686c5bbdee6b44bcdd (patch) | |
tree | 7531e3083956f7fc2db9310253425c32e9743b8f /libs/rs/rsAllocation.cpp | |
parent | 065fa8deb178f00ad9957d3212ec2620c46f78e4 (diff) |
Fixing asynchronous performance issues.
Change-Id: I10f02cd37a33a6c655814d24e0a4291dc044fba3
Diffstat (limited to 'libs/rs/rsAllocation.cpp')
-rw-r--r-- | libs/rs/rsAllocation.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/libs/rs/rsAllocation.cpp b/libs/rs/rsAllocation.cpp index b59ade8d9fe9..a366d4985a48 100644 --- a/libs/rs/rsAllocation.cpp +++ b/libs/rs/rsAllocation.cpp @@ -252,6 +252,7 @@ Allocation *Allocation::createFromStream(Context *rsc, IStream *stream) { Allocation *alloc = Allocation::createAllocation(rsc, type, RS_ALLOCATION_USAGE_SCRIPT); alloc->setName(name.string(), name.size()); + type->decUserRef(); uint32_t count = dataSize / type->getElementSizeBytes(); @@ -307,12 +308,12 @@ void Allocation::resize1D(Context *rsc, uint32_t dimX) { return; } - Type *t = mHal.state.type->cloneAndResize1D(rsc, dimX); + ObjectBaseRef<Type> t = mHal.state.type->cloneAndResize1D(rsc, dimX); if (dimX < oldDimX) { decRefs(getPtr(), oldDimX - dimX, dimX); } - rsc->mHal.funcs.allocation.resize(rsc, this, t, mHal.state.hasReferences); - mHal.state.type.set(t); + rsc->mHal.funcs.allocation.resize(rsc, this, t.get(), mHal.state.hasReferences); + mHal.state.type.set(t.get()); updateCache(); } |