summaryrefslogtreecommitdiffstats
path: root/libs/rs/rsObjectBase.h
diff options
context:
space:
mode:
Diffstat (limited to 'libs/rs/rsObjectBase.h')
-rw-r--r--libs/rs/rsObjectBase.h16
1 files changed, 13 insertions, 3 deletions
diff --git a/libs/rs/rsObjectBase.h b/libs/rs/rsObjectBase.h
index bb03b87..8d1ace1 100644
--- a/libs/rs/rsObjectBase.h
+++ b/libs/rs/rsObjectBase.h
@@ -24,6 +24,7 @@ namespace android {
namespace renderscript {
class Context;
+class OStream;
// An element is a group of Components that occupies one cell in a structure.
class ObjectBase
@@ -38,20 +39,27 @@ public:
void incUserRef() const;
bool decUserRef() const;
bool zeroUserRef() const;
+ void prelockedIncUserRef() const;
const char * getName() const {
- return mName;
+ return mName.string();
}
void setName(const char *);
void setName(const char *, uint32_t len);
Context * getContext() const {return mRSC;}
- void setContext(Context *);
static void zeroAllUserRef(Context *rsc);
static void dumpAll(Context *rsc);
virtual void dumpLOGV(const char *prefix) const;
+ virtual void serialize(OStream *stream) const = 0;
+ virtual RsA3DClassID getClassId() const = 0;
+
+ static bool isValid(const Context *rsc, const ObjectBase *obj);
+
+ static void lockUserRef();
+ static void unlockUserRef();
protected:
const char *mAllocFile;
@@ -59,12 +67,14 @@ protected:
Context *mRSC;
private:
+ static pthread_mutex_t gObjectInitMutex;
+
void add() const;
void remove() const;
bool checkDelete() const;
- char * mName;
+ String8 mName;
mutable int32_t mSysRefCount;
mutable int32_t mUserRefCount;