diff options
| author | Jason Sams <rjsams@android.com> | 2010-08-09 18:13:33 -0700 |
|---|---|---|
| committer | Jason Sams <rjsams@android.com> | 2010-08-09 18:13:33 -0700 |
| commit | b28ca96fd69be0d3d12106f81c415439d185b017 (patch) | |
| tree | 827b9e5aced31b103fdacb7d01d14fbc9f966b34 /libs/rs/rsElement.h | |
| parent | 05716aa0a1f42b72e04a2f41d565f3ca6c3aea1e (diff) | |
| download | frameworks_base-b28ca96fd69be0d3d12106f81c415439d185b017.zip frameworks_base-b28ca96fd69be0d3d12106f81c415439d185b017.tar.gz frameworks_base-b28ca96fd69be0d3d12106f81c415439d185b017.tar.bz2 | |
Refcounting in allocations.
Change-Id: Ida2dfb404b2cd832e622d981d73a938d5bc5b821
Diffstat (limited to 'libs/rs/rsElement.h')
| -rw-r--r-- | libs/rs/rsElement.h | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/libs/rs/rsElement.h b/libs/rs/rsElement.h index 90e7cc8..b5dad7a 100644 --- a/libs/rs/rsElement.h +++ b/libs/rs/rsElement.h @@ -40,9 +40,11 @@ public: return (getSizeBits() + 7) >> 3; } - size_t getFieldOffsetBits(uint32_t componentNumber) const; + size_t getFieldOffsetBits(uint32_t componentNumber) const { + return mFields[componentNumber].offsetBits; + } size_t getFieldOffsetBytes(uint32_t componentNumber) const { - return (getFieldOffsetBits(componentNumber) + 7) >> 3; + return mFields[componentNumber].offsetBits >> 3; } uint32_t getFieldCount() const {return mFieldCount;} @@ -66,6 +68,10 @@ public: static const Element * create(Context *rsc, size_t count, const Element **, const char **, const size_t * lengths); + void incRefs(const void *) const; + void decRefs(const void *) const; + bool getHasReferences() const {return mHasReference;} + protected: // deallocate any components that are part of this element. void clear(); @@ -73,9 +79,11 @@ protected: typedef struct { String8 name; ObjectBaseRef<const Element> e; + uint32_t offsetBits; } ElementField_t; ElementField_t *mFields; size_t mFieldCount; + bool mHasReference; Element(Context *); |
