diff options
| author | Jason Sams <rjsams@android.com> | 2009-12-23 14:35:29 -0800 |
|---|---|---|
| committer | Jason Sams <rjsams@android.com> | 2009-12-23 14:35:29 -0800 |
| commit | 718cd1f322ee5b62b6a49cb36195bcb18a5ab711 (patch) | |
| tree | f2f8c9db5a8141eafa2f1547634d7586fdc6ef04 /libs/rs/rsElement.h | |
| parent | ceedafacdb87307234c84196a12eeb6e657d6220 (diff) | |
| download | frameworks_base-718cd1f322ee5b62b6a49cb36195bcb18a5ab711.zip frameworks_base-718cd1f322ee5b62b6a49cb36195bcb18a5ab711.tar.gz frameworks_base-718cd1f322ee5b62b6a49cb36195bcb18a5ab711.tar.bz2 | |
Element restructuring. Add support for new basic Element types including the RS objects and vectors(2-4). In theory this paves the way for maintaining type info for RS objects, passing elements for GLSL uiforms/attribs/varyings, and supporting nested structures.
This will break some apps, checkings for other projects will follow to unbreak them.
Diffstat (limited to 'libs/rs/rsElement.h')
| -rw-r--r-- | libs/rs/rsElement.h | 30 |
1 files changed, 14 insertions, 16 deletions
diff --git a/libs/rs/rsElement.h b/libs/rs/rsElement.h index 43e2820..c46922c 100644 --- a/libs/rs/rsElement.h +++ b/libs/rs/rsElement.h @@ -17,7 +17,7 @@ #ifndef ANDROID_STRUCTURED_ELEMENT_H #define ANDROID_STRUCTURED_ELEMENT_H -//#include "rsComponent.h" +#include "rsComponent.h" #include "rsUtils.h" #include "rsObjectBase.h" @@ -53,20 +53,22 @@ public: const Element * getField(uint32_t idx) const {return mFields[idx].e.get();} const char * getFieldName(uint32_t idx) const {return mFields[idx].name.string();} - RsDataType getType() const {return mType;} - bool getIsNormalized() const {return mIsNormalized;} - RsDataKind getKind() const {return mKind;} + const Component & getComponent() const {return mComponent;} + RsDataType getType() const {return mComponent.getType();} + //bool getIsNormalized() const {return mIsNormalized;} + RsDataKind getKind() const {return mComponent.getKind();} uint32_t getBits() const {return mBits;} //uint32_t getGLType() const; - const char * getCType() const; - void dumpLOGV(const char *prefix) const; + String8 getCType(uint32_t indent=0) const; + String8 getCStructBody(uint32_t indent=0) const; + void dumpLOGV(const char *prefix) const; - static Element * create(Context *rsc, RsDataKind dk, RsDataType dt, - bool isNorm, size_t bits); - static Element * create(Context *rsc, Element **, const char **, - const size_t * lengths, size_t count); + static Element * create(Context *rsc, RsDataType dt, RsDataKind dk, + bool isNorm, uint32_t vecSize); + static Element * create(Context *rsc, size_t count, const Element **, + const char **, const size_t * lengths); protected: // deallocate any components that are part of this element. @@ -74,7 +76,7 @@ protected: typedef struct { String8 name; - ObjectBaseRef<Element> e; + ObjectBaseRef<const Element> e; } ElementField_t; ElementField_t *mFields; size_t mFieldCount; @@ -82,12 +84,8 @@ protected: Element(Context *); - - RsDataType mType; - bool mIsNormalized; - RsDataKind mKind; + Component mComponent; uint32_t mBits; - //String8 mName; }; |
