summaryrefslogtreecommitdiffstats
path: root/libs/rs/rsElement.h
diff options
context:
space:
mode:
Diffstat (limited to 'libs/rs/rsElement.h')
-rw-r--r--libs/rs/rsElement.h19
1 files changed, 14 insertions, 5 deletions
diff --git a/libs/rs/rsElement.h b/libs/rs/rsElement.h
index 02a1ca2..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;}
@@ -54,17 +56,22 @@ public:
RsDataKind getKind() const {return mComponent.getKind();}
uint32_t getBits() const {return mBits;}
- String8 getCType(uint32_t indent=0) const;
- String8 getCStructBody(uint32_t indent=0) const;
String8 getGLSLType(uint32_t indent=0) const;
void dumpLOGV(const char *prefix) const;
+ virtual void serialize(OStream *stream) const;
+ virtual RsA3DClassID getClassId() const { return RS_A3D_CLASS_ID_ELEMENT; }
+ static Element *createFromStream(Context *rsc, IStream *stream);
static const Element * create(Context *rsc, RsDataType dt, RsDataKind dk,
bool isNorm, uint32_t vecSize);
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();
@@ -72,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 *);
@@ -90,7 +99,7 @@ public:
~ElementState();
// Cache of all existing elements.
- Vector<const Element *> mElements;
+ Vector<Element *> mElements;
};