summaryrefslogtreecommitdiff
path: root/libs/rs/rsAllocation.cpp
diff options
context:
space:
mode:
author Alex Sakhartchouk <alexst@google.com> 2011-08-17 13:29:24 -0700
committer Android (Google) Code Review <android-gerrit@google.com> 2011-08-17 13:29:24 -0700
commit4270295ae8ffea9888c3bf881c07ba53d5e6f9c2 (patch)
tree24a63b455a529b2ea29052a9a46976697dbc798d /libs/rs/rsAllocation.cpp
parent5a9ffaa4cb58be595ba57d4078988d0496781063 (diff)
parent117abdbc67123654d0754b686c5bbdee6b44bcdd (diff)
Merge "Fixing asynchronous performance issues."
Diffstat (limited to 'libs/rs/rsAllocation.cpp')
-rw-r--r--libs/rs/rsAllocation.cpp7
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();
}