diff options
| author | Jason Sams <rjsams@android.com> | 2010-03-03 13:03:18 -0800 |
|---|---|---|
| committer | Jason Sams <rjsams@android.com> | 2010-03-03 14:14:37 -0800 |
| commit | 156cce698093023d9e79a4ff4fb96f4e4d3019db (patch) | |
| tree | ff5ce34e453d2f475bcab35d29f5a7d00d53554d /libs/rs/rsScriptC.cpp | |
| parent | a034cd3e15b6626be03e60f2d6a0f929dcb950d9 (diff) | |
| download | frameworks_base-156cce698093023d9e79a4ff4fb96f4e4d3019db.zip frameworks_base-156cce698093023d9e79a4ff4fb96f4e4d3019db.tar.gz frameworks_base-156cce698093023d9e79a4ff4fb96f4e4d3019db.tar.bz2 | |
Improve RS error handling. On errors RS will now store the error and a message that can be read from the app. RS will then not continue rendering frames while an unchecked error is present until new state is received.
Diffstat (limited to 'libs/rs/rsScriptC.cpp')
| -rw-r--r-- | libs/rs/rsScriptC.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/libs/rs/rsScriptC.cpp b/libs/rs/rsScriptC.cpp index b7e0b86..1f23773 100644 --- a/libs/rs/rsScriptC.cpp +++ b/libs/rs/rsScriptC.cpp @@ -62,6 +62,11 @@ void ScriptC::setupScript() uint32_t ScriptC::run(Context *rsc, uint32_t launchIndex) { + if (mProgram.mScript == NULL) { + rsc->setError(RS_ERROR_BAD_SCRIPT, "Attempted to run bad script"); + return 0; + } + Context::ScriptTLSStruct * tls = (Context::ScriptTLSStruct *)pthread_getspecific(Context::gThreadTLSKey); rsAssert(tls); @@ -154,7 +159,9 @@ void ScriptCState::runCompiler(Context *rsc, ScriptC *s) ACCchar buf[4096]; ACCsizei len; accGetScriptInfoLog(s->mAccScript, sizeof(buf), &len, buf); - LOGV(buf); + LOGE(buf); + rsc->setError(RS_ERROR_BAD_SCRIPT, "Error compiling user script."); + return; } if (s->mProgram.mInit) { |
