diff options
author | Jason Sams <rjsams@android.com> | 2010-02-17 15:38:10 -0800 |
---|---|---|
committer | Jason Sams <rjsams@android.com> | 2010-02-17 15:38:10 -0800 |
commit | 8154954868694e1f233d87d4933a474518b1cb81 (patch) | |
tree | 589a853c307533891684c168004512ce88724564 /rsElement.h | |
parent | a33166c0bf203a25b9a2408c6854d6beb9ffcc77 (diff) | |
download | rs-8154954868694e1f233d87d4933a474518b1cb81.tar.gz |
Implement type collapsing for Elements and Types. Now if a user creates two or more identical objects we simply reuse the existing object rather than create a new one.
Diffstat (limited to 'rsElement.h')
-rw-r--r-- | rsElement.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/rsElement.h b/rsElement.h index 777e8ee9..02a1ca2f 100644 --- a/rsElement.h +++ b/rsElement.h @@ -60,9 +60,9 @@ public: void dumpLOGV(const char *prefix) const; - static Element * create(Context *rsc, RsDataType dt, RsDataKind dk, + static const Element * create(Context *rsc, RsDataType dt, RsDataKind dk, bool isNorm, uint32_t vecSize); - static Element * create(Context *rsc, size_t count, const Element **, + static const Element * create(Context *rsc, size_t count, const Element **, const char **, const size_t * lengths); protected: @@ -89,6 +89,8 @@ public: ElementState(); ~ElementState(); + // Cache of all existing elements. + Vector<const Element *> mElements; }; |