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 | e4c487a75282e8a38a8b3defd49e7799c8670881 (patch) | |
tree | cce081d45415dfe54bdd65761e85f13046c91a82 /libs/rs/rsElement.h | |
parent | 5bc54073186a83472963934d4325c3b9d968892f (diff) | |
download | frameworks_base-e4c487a75282e8a38a8b3defd49e7799c8670881.zip frameworks_base-e4c487a75282e8a38a8b3defd49e7799c8670881.tar.gz frameworks_base-e4c487a75282e8a38a8b3defd49e7799c8670881.tar.bz2 |
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 'libs/rs/rsElement.h')
-rw-r--r-- | libs/rs/rsElement.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/libs/rs/rsElement.h b/libs/rs/rsElement.h index 777e8ee..02a1ca2 100644 --- a/libs/rs/rsElement.h +++ b/libs/rs/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; }; |