diff options
Diffstat (limited to 'libs/rs/rsScriptC.cpp')
-rw-r--r-- | libs/rs/rsScriptC.cpp | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/libs/rs/rsScriptC.cpp b/libs/rs/rsScriptC.cpp index fc2744f7c662..fb8180fc4de7 100644 --- a/libs/rs/rsScriptC.cpp +++ b/libs/rs/rsScriptC.cpp @@ -130,8 +130,8 @@ void ScriptCState::runCompiler(Context *rsc, ScriptC *s) rsc->appendNameDefines(&tmp); appendDecls(&tmp); rsc->appendVarDefines(&tmp); - appendVarDefines(&tmp); - appendTypes(&tmp); + appendVarDefines(rsc, &tmp); + appendTypes(rsc, &tmp); tmp.append("#line 1\n"); const char* scriptSource[] = {tmp.string(), s->mEnviroment.mScriptText}; @@ -260,11 +260,13 @@ static void appendElementBody(String8 *s, const Element *e) s->append("}"); } -void ScriptCState::appendVarDefines(String8 *str) +void ScriptCState::appendVarDefines(const Context *rsc, String8 *str) { char buf[256]; - LOGD("appendVarDefines mInt32Defines.size()=%d mFloatDefines.size()=%d\n", - mInt32Defines.size(), mFloatDefines.size()); + if (rsc->props.mLogScripts) { + LOGD("appendVarDefines mInt32Defines.size()=%d mFloatDefines.size()=%d\n", + mInt32Defines.size(), mFloatDefines.size()); + } for (size_t ct=0; ct < mInt32Defines.size(); ct++) { str->append("#define "); str->append(mInt32Defines.keyAt(ct)); @@ -283,7 +285,7 @@ void ScriptCState::appendVarDefines(String8 *str) -void ScriptCState::appendTypes(String8 *str) +void ScriptCState::appendTypes(const Context *rsc, String8 *str) { char buf[256]; String8 tmp; @@ -308,7 +310,9 @@ void ScriptCState::appendTypes(String8 *str) s.append("_t struct struct_"); s.append(e->getName()); s.append("\n\n"); - LOGD(s); + if (rsc->props.mLogScripts) { + LOGV(s); + } str->append(s); } @@ -321,7 +325,9 @@ void ScriptCState::appendTypes(String8 *str) tmp.append(c->getComponentName()); sprintf(buf, " %i\n", ct2); tmp.append(buf); - LOGD(tmp); + if (rsc->props.mLogScripts) { + LOGV(tmp); + } str->append(tmp); } } @@ -351,7 +357,9 @@ void ScriptCState::appendTypes(String8 *str) } s.append(mSlotNames[ct]); s.append(";\n"); - LOGD(s); + if (rsc->props.mLogScripts) { + LOGV(s); + } str->append(s); } } |