diff options
| author | 2010-05-17 14:55:34 -0700 | |
|---|---|---|
| committer | 2010-05-17 14:55:34 -0700 | |
| commit | 1de0b87168837cfcd9318bec5c97d2e7d78d3293 (patch) | |
| tree | 6b6cd8ea2a55597e3fd3573072cb85af892be731 /libs/rs/rsScriptC.cpp | |
| parent | 38a9544825c6f3482237f9e29cddee58ebc093c3 (diff) | |
Remove more pieces of setRoot. Add pointer to allocation lookup for scripts.
Change-Id: I2c3075d2056f02bb834bfad403dc72da991f3156
Diffstat (limited to 'libs/rs/rsScriptC.cpp')
| -rw-r--r-- | libs/rs/rsScriptC.cpp | 16 |
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) { |