summaryrefslogtreecommitdiff
path: root/libs/rs/rsElement.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libs/rs/rsElement.cpp')
-rw-r--r--libs/rs/rsElement.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/libs/rs/rsElement.cpp b/libs/rs/rsElement.cpp
index b5267b36459c..e7ae2474f64e 100644
--- a/libs/rs/rsElement.cpp
+++ b/libs/rs/rsElement.cpp
@@ -22,13 +22,13 @@ using namespace android;
using namespace android::renderscript;
-Element::Element()
+Element::Element(Context *rsc) : ObjectBase(rsc)
{
mComponents = NULL;
mComponentCount = 0;
}
-Element::Element(uint32_t count)
+Element::Element(Context *rsc, uint32_t count) : ObjectBase(rsc)
{
mComponents = new ObjectBaseRef<Component> [count];
mComponentCount = count;
@@ -197,7 +197,8 @@ void rsi_ElementBegin(Context *rsc)
void rsi_ElementAdd(Context *rsc, RsDataKind dk, RsDataType dt, bool isNormalized, size_t bits, const char *name)
{
ElementState * sec = &rsc->mStateElement;
- Component *c = new Component(static_cast<Component::DataKind>(dk),
+ Component *c = new Component(rsc,
+ static_cast<Component::DataKind>(dk),
static_cast<Component::DataType>(dt),
isNormalized,
bits,
@@ -208,7 +209,7 @@ void rsi_ElementAdd(Context *rsc, RsDataKind dk, RsDataType dt, bool isNormalize
RsElement rsi_ElementCreate(Context *rsc)
{
ElementState * sec = &rsc->mStateElement;
- Element *se = new Element(sec->mComponentBuildList.size());
+ Element *se = new Element(rsc, sec->mComponentBuildList.size());
for (size_t ct = 0; ct < se->getComponentCount(); ct++) {
se->setComponent(ct, sec->mComponentBuildList[ct]);