From 1de0b87168837cfcd9318bec5c97d2e7d78d3293 Mon Sep 17 00:00:00 2001 From: Jason Sams Date: Mon, 17 May 2010 14:55:34 -0700 Subject: Remove more pieces of setRoot. Add pointer to allocation lookup for scripts. Change-Id: I2c3075d2056f02bb834bfad403dc72da991f3156 --- libs/rs/rsScriptC.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'libs/rs/rsScriptC.cpp') 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) { -- cgit v1.2.3-59-g8ed1b