summaryrefslogtreecommitdiffstats
path: root/rsScriptC.cpp
diff options
context:
space:
mode:
authorJason Sams <rjsams@android.com>2010-05-17 14:55:34 -0700
committerJason Sams <rjsams@android.com>2010-05-17 14:55:34 -0700
commitce92d4baf7a5bce097228fdd4498601764cd4014 (patch)
treecb18dc86df54c5740f1b061d7e0eeda1a0d83314 /rsScriptC.cpp
parent568613e5c043c473e5e6632b3a38de2a97864908 (diff)
downloadandroid_frameworks_rs-ce92d4baf7a5bce097228fdd4498601764cd4014.tar.gz
android_frameworks_rs-ce92d4baf7a5bce097228fdd4498601764cd4014.tar.bz2
android_frameworks_rs-ce92d4baf7a5bce097228fdd4498601764cd4014.zip
Remove more pieces of setRoot. Add pointer to allocation lookup for scripts.
Change-Id: I2c3075d2056f02bb834bfad403dc72da991f3156
Diffstat (limited to 'rsScriptC.cpp')
-rw-r--r--rsScriptC.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/rsScriptC.cpp b/rsScriptC.cpp
index e9ba2267..8a60d1ef 100644
--- a/rsScriptC.cpp
+++ b/rsScriptC.cpp
@@ -71,6 +71,22 @@ void ScriptC::setupScript()
}
}
+const Allocation *ScriptC::ptrToAllocation(const void *ptr) const
+{
+ if (!ptr) {
+ return NULL;
+ }
+ for (uint32_t ct=0; ct < mEnviroment.mFieldCount; ct++) {
+ if (!mSlots[ct].get())
+ continue;
+ if (mSlots[ct]->getPtr() == ptr) {
+ return mSlots[ct].get();
+ }
+ }
+ LOGE("ScriptC::ptrToAllocation, failed to find %p", ptr);
+ return NULL;
+}
+
uint32_t ScriptC::run(Context *rsc, uint32_t launchIndex)
{