summaryrefslogtreecommitdiff
path: root/libs/rs/rsScriptC.cpp
diff options
context:
space:
mode:
author Jason Sams <rjsams@android.com> 2010-09-16 18:18:29 -0700
committer Jason Sams <rjsams@android.com> 2010-09-16 18:18:29 -0700
commitd081fffab58b4cb8a36b7a083ab7793585bc1510 (patch)
tree2d4ea330edfd21499546fc0a9ae9d647d7a1ee0e /libs/rs/rsScriptC.cpp
parenta8bf9429b29743b3489817feb21bde2416acc465 (diff)
Cleanup GL setup code and remove legacy 1.1 paths.
Reset pointers to NULL when allocations are unbound. Change-Id: Ifaba634ecbb154970b7fb47faa8e6475d16d2f66
Diffstat (limited to 'libs/rs/rsScriptC.cpp')
-rw-r--r--libs/rs/rsScriptC.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/libs/rs/rsScriptC.cpp b/libs/rs/rsScriptC.cpp
index 662791dbf949..cbc5df95aa05 100644
--- a/libs/rs/rsScriptC.cpp
+++ b/libs/rs/rsScriptC.cpp
@@ -56,9 +56,16 @@ void ScriptC::setupScript(Context *rsc)
= nanoseconds_to_milliseconds(systemTime(SYSTEM_TIME_MONOTONIC));
for (uint32_t ct=0; ct < mEnviroment.mFieldCount; ct++) {
- if (!mSlots[ct].get())
+ if (mSlots[ct].get() && !mTypes[ct].get()) {
+ mTypes[ct].set(mSlots[ct]->getType());
+ }
+
+ if (!mTypes[ct].get())
continue;
- void *ptr = mSlots[ct]->getPtr();
+ void *ptr = NULL;
+ if (mSlots[ct].get()) {
+ ptr = mSlots[ct]->getPtr();
+ }
void **dest = ((void ***)mEnviroment.mFieldAddress)[ct];
//LOGE("setupScript %i %p = %p %p %i", ct, dest, ptr, mSlots[ct]->getType(), mSlots[ct]->getType()->getDimX());