diff options
author | Shih-wei Liao <sliao@google.com> | 2010-12-10 01:03:59 -0800 |
---|---|---|
committer | Shih-wei Liao <sliao@google.com> | 2010-12-14 11:17:20 -0800 |
commit | 6b32fab1dbfd8bc1cc176557fe0a7b2ebd4966bd (patch) | |
tree | 49b2bdb6cec0af7f5e0131c8d17d88d365382b8a /libs/rs/rsScriptC.cpp | |
parent | 2bc248b698b17fd333beae828039a8bff7604a9f (diff) |
1. Add Context to a RenderScript or RenderScriptGL instance.
This is to allow RenderScript to better interact with the Android environment.
E.g., per-app cache.
2. Plumbing, testing.
3. Added getApplicationContext in RenderScript.java.
Change-Id: I85edeebe38825e20b2e86f4f4815689dfc332ef9
Diffstat (limited to 'libs/rs/rsScriptC.cpp')
-rw-r--r-- | libs/rs/rsScriptC.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/libs/rs/rsScriptC.cpp b/libs/rs/rsScriptC.cpp index b3dbf115b6f7..507430dfabc9 100644 --- a/libs/rs/rsScriptC.cpp +++ b/libs/rs/rsScriptC.cpp @@ -402,7 +402,7 @@ static BCCvoid* symbolLookup(BCCvoid* pContext, const BCCchar* name) { extern const char rs_runtime_lib_bc[]; extern unsigned rs_runtime_lib_bc_size; -void ScriptCState::runCompiler(Context *rsc, ScriptC *s, const char *resName) { +void ScriptCState::runCompiler(Context *rsc, ScriptC *s, const char *resName, const char *cacheDir) { { s->mBccScript = bccCreateScript(); s->mEnviroment.mIsThreadable = true; @@ -413,7 +413,8 @@ void ScriptCState::runCompiler(Context *rsc, ScriptC *s, const char *resName) { if (bccReadBC(s->mBccScript, s->mEnviroment.mScriptText, s->mEnviroment.mScriptTextLength, - resName) >= 0) { + resName, + cacheDir) >= 0) { //bccLinkBC(s->mBccScript, rs_runtime_lib_bc, rs_runtime_lib_bc_size); bccCompileBC(s->mBccScript); } else { @@ -534,7 +535,7 @@ void rsi_ScriptCSetText(Context *rsc, const char *text, uint32_t len) { ss->mScript->mEnviroment.mScriptTextLength = len; } -RsScript rsi_ScriptCCreate(Context * rsc, const char *resName) +RsScript rsi_ScriptCCreate(Context * rsc, const char *resName, const char *cacheDir) { ScriptCState *ss = &rsc->mScriptC; @@ -542,7 +543,7 @@ RsScript rsi_ScriptCCreate(Context * rsc, const char *resName) ss->mScript.clear(); s->incUserRef(); - ss->runCompiler(rsc, s.get(), resName); + ss->runCompiler(rsc, s.get(), resName, cacheDir); ss->clear(rsc); return s.get(); } |