summaryrefslogtreecommitdiffstats
path: root/libs
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
commit667fb848aa7f457adcfb5fd083309340dc1bf718 (patch)
treedf95882ad7fd6d2d1bc0a48e8fcb129d0b6564ad /libs
parentc32dd5f2d12107f3f1eff26dfd55a42d49c337de (diff)
downloadframeworks_base-667fb848aa7f457adcfb5fd083309340dc1bf718.zip
frameworks_base-667fb848aa7f457adcfb5fd083309340dc1bf718.tar.gz
frameworks_base-667fb848aa7f457adcfb5fd083309340dc1bf718.tar.bz2
Whenever LoadBinary fails, recompile. Fixing the multi-instance bug.
Change-Id: Ib1565efe1353ed788a3ed3c81c6067e92d8ef0e5
Diffstat (limited to 'libs')
-rw-r--r--libs/rs/rsScriptC.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/libs/rs/rsScriptC.cpp b/libs/rs/rsScriptC.cpp
index 507430d..0ae85cb 100644
--- a/libs/rs/rsScriptC.cpp
+++ b/libs/rs/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);