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 | 15849d9a926fbd83587b9da30b8888574998a0fd (patch) | |
tree | 43a88effaad41ac82d50deae658582a3ae95224b /rsScriptC.cpp | |
parent | b022b38568e3a0752fc5a4a2a06ea24e8522cb3e (diff) | |
download | rs-15849d9a926fbd83587b9da30b8888574998a0fd.tar.gz |
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 'rsScriptC.cpp')
-rw-r--r-- | rsScriptC.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/rsScriptC.cpp b/rsScriptC.cpp index b3dbf115..507430df 100644 --- a/rsScriptC.cpp +++ b/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(); } |