summaryrefslogtreecommitdiff
path: root/libs/rs/rsScriptC.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libs/rs/rsScriptC.cpp')
-rw-r--r--libs/rs/rsScriptC.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/libs/rs/rsScriptC.cpp b/libs/rs/rsScriptC.cpp
index e9ba2267a84c..8a60d1ef9b41 100644
--- a/libs/rs/rsScriptC.cpp
+++ b/libs/rs/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)
{