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.
diff --git a/rsProgramVertex.cpp b/rsProgramVertex.cpp
index 28f13d4..a2b2df4 100644
--- a/rsProgramVertex.cpp
+++ b/rsProgramVertex.cpp
@@ -364,7 +364,7 @@
void ProgramVertexState::init(Context *rsc, int32_t w, int32_t h)
{
- RsElement e = Element::create(rsc, RS_TYPE_FLOAT_32, RS_KIND_USER, false, 1);
+ RsElement e = (RsElement) Element::create(rsc, RS_TYPE_FLOAT_32, RS_KIND_USER, false, 1);
rsi_TypeBegin(rsc, e);
rsi_TypeAdd(rsc, RS_DIMENSION_X, 48);