summaryrefslogtreecommitdiffstats
path: root/rsScriptC.cpp
diff options
context:
space:
mode:
authorShih-wei Liao <sliao@google.com>2010-12-16 04:58:35 -0800
committerShih-wei Liao <sliao@google.com>2010-12-16 04:58:35 -0800
commitff8ce9cd935cd03ec8a7c564b7cf06783c8f8c73 (patch)
treeaab30eff08b335a2319b0f6cce18123200210c26 /rsScriptC.cpp
parenta2aab8be7a980791fc9d4e6c4d050d703b20bcf6 (diff)
downloadandroid_frameworks_rs-ff8ce9cd935cd03ec8a7c564b7cf06783c8f8c73.tar.gz
android_frameworks_rs-ff8ce9cd935cd03ec8a7c564b7cf06783c8f8c73.tar.bz2
android_frameworks_rs-ff8ce9cd935cd03ec8a7c564b7cf06783c8f8c73.zip
Whenever LoadBinary fails, recompile. Fixing the multi-instance bug.
Change-Id: Ib1565efe1353ed788a3ed3c81c6067e92d8ef0e5
Diffstat (limited to 'rsScriptC.cpp')
-rw-r--r--rsScriptC.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/rsScriptC.cpp b/rsScriptC.cpp
index 507430df..0ae85cba 100644
--- a/rsScriptC.cpp
+++ b/rsScriptC.cpp
@@ -420,7 +420,14 @@ void ScriptCState::runCompiler(Context *rsc, ScriptC *s, const char *resName, co
} else {
// bccReadBC returns a neagative value: Didn't read any script,
// So, use cached binary instead
- bccLoadBinary(s->mBccScript);
+ if (bccLoadBinary(s->mBccScript)) { // LoadBinary fails ==> Recompile
+ bccReadBC(s->mBccScript,
+ s->mEnviroment.mScriptText,
+ s->mEnviroment.mScriptTextLength,
+ NULL,
+ cacheDir);
+ bccCompileBC(s->mBccScript);
+ }
}
bccGetScriptLabel(s->mBccScript, "root", (BCCvoid**) &s->mProgram.mRoot);
bccGetScriptLabel(s->mBccScript, "init", (BCCvoid**) &s->mProgram.mInit);