summaryrefslogtreecommitdiff
path: root/cpp/BaseObj.cpp
diff options
context:
space:
mode:
authorTim Murray <timmurray@google.com>2012-10-31 16:03:16 -0700
committerTim Murray <timmurray@google.com>2012-11-05 16:34:59 -0800
commit84bf2b877024aaa154b66e0f2338d54bdabd855a (patch)
tree64fcf3429697d1d609182a7ae769eb3d89e1f272 /cpp/BaseObj.cpp
parentc36a74dfcf0c1a9af6b6411aa80f7be31694425c (diff)
downloadrs-84bf2b877024aaa154b66e0f2338d54bdabd855a.tar.gz
Move to smart pointers for refcounting RS contexts
Change-Id: I0dc6adc4e02c7427a4234c549d3555a501fe5f90
Diffstat (limited to 'cpp/BaseObj.cpp')
-rw-r--r--cpp/BaseObj.cpp12
1 files changed, 3 insertions, 9 deletions
diff --git a/cpp/BaseObj.cpp b/cpp/BaseObj.cpp
index a370e8df..4a9faace 100644
--- a/cpp/BaseObj.cpp
+++ b/cpp/BaseObj.cpp
@@ -16,10 +16,7 @@
#define LOG_TAG "libRS_cpp"
-#include <rs.h>
-
#include "RenderScript.h"
-#include "BaseObj.h"
using namespace android;
using namespace renderscriptCpp;
@@ -36,7 +33,7 @@ void * BaseObj::getObjID(sp<const BaseObj> o) {
}
-BaseObj::BaseObj(void *id, RenderScript *rs) {
+BaseObj::BaseObj(void *id, sp<RS> rs) {
mRS = rs;
mID = id;
}
@@ -48,14 +45,14 @@ void BaseObj::checkValid() {
}
BaseObj::~BaseObj() {
- rsObjDestroy(mRS->mContext, mID);
+ rsObjDestroy(mRS->getContext(), mID);
mRS = NULL;
mID = NULL;
}
void BaseObj::updateFromNative() {
const char *name = NULL;
- rsaGetName(mRS, mID, &name);
+ rsaGetName(mRS->getContext(), mID, &name);
mName = name;
}
@@ -65,6 +62,3 @@ bool BaseObj::equals(const BaseObj *obj) {
return true;
return mID == obj->mID;
}
-
-
-