diff options
| author | 2009-06-05 17:35:09 -0700 | |
|---|---|---|
| committer | 2009-06-05 17:35:09 -0700 | |
| commit | 39ddc950c9064129ead5de04b200106c0659f937 (patch) | |
| tree | d5998b6313b575a342202e541e27737aa17d8140 /libs/rs/rsScriptC.cpp | |
| parent | bb8505e7fd0e2b6e68078dbf6729221961a7bd63 (diff) | |
Move call to compiler from jni to core library code.
Diffstat (limited to 'libs/rs/rsScriptC.cpp')
| -rw-r--r-- | libs/rs/rsScriptC.cpp | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/libs/rs/rsScriptC.cpp b/libs/rs/rsScriptC.cpp index 36019abac21e..be0191b05558 100644 --- a/libs/rs/rsScriptC.cpp +++ b/libs/rs/rsScriptC.cpp @@ -28,6 +28,8 @@ ScriptC::ScriptC() { mAccScript = NULL; mScript = NULL; + mScriptText = NULL; + mScriptTextLength = 0; } ScriptC::~ScriptC() @@ -418,6 +420,21 @@ void ScriptCState::clear() mScript = NULL; mIsRoot = false; mIsOrtho = true; + mScriptText = NULL; + mScriptTextLength = 0; +} + +void ScriptCState::runCompiler() +{ + mAccScript = accCreateScript(); + + LOGE("Compiler 1"); + const char* scriptSource[] = {mScriptText}; + int scriptLength[] = {mScriptTextLength} ; + accScriptSource(mAccScript, 1, scriptSource, scriptLength); + accCompileScript(mAccScript); + accGetScriptLabel(mAccScript, "main", (ACCvoid**) &mScript); + LOGE("Compiler 1"); } namespace android { @@ -475,10 +492,20 @@ void rsi_ScriptCSetOrtho(Context * rsc, bool isOrtho) ss->mIsOrtho = isOrtho; } +void rsi_ScriptCSetText(Context *rsc, const char *text, uint32_t len) +{ + ScriptCState *ss = &rsc->mScriptC; + ss->mScriptText = text; + ss->mScriptTextLength = len; +} + + RsScript rsi_ScriptCCreate(Context * rsc) { ScriptCState *ss = &rsc->mScriptC; + ss->runCompiler(); + ScriptC *s = new ScriptC(); s->mAccScript = ss->mAccScript; ss->mAccScript = NULL; @@ -491,7 +518,8 @@ RsScript rsi_ScriptCCreate(Context * rsc) s->mClearStencil = ss->mClearStencil; s->mIsRoot = ss->mIsRoot; s->mIsOrtho = ss->mIsOrtho; - + s->mScriptText = ss->mScriptText; + s->mScriptTextLength = ss->mScriptTextLength; return s; } |