diff options
author | 2014-10-09 10:34:58 -0700 | |
---|---|---|
committer | 2014-10-09 10:34:59 -0700 | |
commit | 089f8de82d6c342faa9170d8c19d8504177bf5fb (patch) | |
tree | e5b1b30c8b310fa2542713f63f018b9fe2d5895b /src/gpu | |
parent | 1e2530babb65a883a01df5ee87147432f6707ce3 (diff) |
Remove tab parameter from GrGLSLMulVarBy4f function
With pretty printing of shader code, there is no longer a need to explictily
have tabs in our code.
BUG=skia:
Review URL: https://codereview.chromium.org/648463002
Diffstat (limited to 'src/gpu')
-rw-r--r-- | src/gpu/effects/GrConfigConversionEffect.cpp | 2 | ||||
-rw-r--r-- | src/gpu/effects/GrConvolutionEffect.cpp | 2 | ||||
-rw-r--r-- | src/gpu/effects/GrMatrixConvolutionEffect.cpp | 2 | ||||
-rw-r--r-- | src/gpu/gl/GrGLSL.cpp | 22 | ||||
-rw-r--r-- | src/gpu/gl/GrGLSL.h | 5 |
5 files changed, 8 insertions, 25 deletions
diff --git a/src/gpu/effects/GrConfigConversionEffect.cpp b/src/gpu/effects/GrConfigConversionEffect.cpp index f60be2a970..83c4a10a3a 100644 --- a/src/gpu/effects/GrConfigConversionEffect.cpp +++ b/src/gpu/effects/GrConfigConversionEffect.cpp @@ -81,7 +81,7 @@ public: fsBuilder->codeAppendf("%s = %s;", outputColor, tmpVar.c_str()); } SkString modulate; - GrGLSLMulVarBy4f(&modulate, 2, outputColor, inputColor); + GrGLSLMulVarBy4f(&modulate, outputColor, inputColor); fsBuilder->codeAppend(modulate.c_str()); } diff --git a/src/gpu/effects/GrConvolutionEffect.cpp b/src/gpu/effects/GrConvolutionEffect.cpp index a836d43f2b..36a1bfe6a1 100644 --- a/src/gpu/effects/GrConvolutionEffect.cpp +++ b/src/gpu/effects/GrConvolutionEffect.cpp @@ -101,7 +101,7 @@ void GrGLConvolutionEffect::emitCode(GrGLProgramBuilder* builder, } SkString modulate; - GrGLSLMulVarBy4f(&modulate, 2, outputColor, inputColor); + GrGLSLMulVarBy4f(&modulate, outputColor, inputColor); fsBuilder->codeAppend(modulate.c_str()); } diff --git a/src/gpu/effects/GrMatrixConvolutionEffect.cpp b/src/gpu/effects/GrMatrixConvolutionEffect.cpp index c0080c61dc..500a07e3bf 100644 --- a/src/gpu/effects/GrMatrixConvolutionEffect.cpp +++ b/src/gpu/effects/GrMatrixConvolutionEffect.cpp @@ -116,7 +116,7 @@ void GrGLMatrixConvolutionEffect::emitCode(GrGLProgramBuilder* builder, } SkString modulate; - GrGLSLMulVarBy4f(&modulate, 2, outputColor, inputColor); + GrGLSLMulVarBy4f(&modulate, outputColor, inputColor); fsBuilder->codeAppend(modulate.c_str()); } diff --git a/src/gpu/gl/GrGLSL.cpp b/src/gpu/gl/GrGLSL.cpp index 6c8f88360c..866a0d13d3 100644 --- a/src/gpu/gl/GrGLSL.cpp +++ b/src/gpu/gl/GrGLSL.cpp @@ -69,30 +69,14 @@ const char* GrGetGLSLVersionDecl(const GrGLContextInfo& info) { } } -namespace { - void append_tabs(SkString* outAppend, int tabCnt) { - static const char kTabs[] = "\t\t\t\t\t\t\t\t"; - while (tabCnt) { - int cnt = SkTMin((int)SK_ARRAY_COUNT(kTabs), tabCnt); - outAppend->append(kTabs, cnt); - tabCnt -= cnt; - } - } -} - -void GrGLSLMulVarBy4f(SkString* outAppend, - unsigned tabCnt, - const char* vec4VarName, - const GrGLSLExpr4& mulFactor) { +void GrGLSLMulVarBy4f(SkString* outAppend, const char* vec4VarName, const GrGLSLExpr4& mulFactor) { if (mulFactor.isOnes()) { *outAppend = SkString(); } - append_tabs(outAppend, tabCnt); - if (mulFactor.isZeros()) { - outAppend->appendf("%s = vec4(0);\n", vec4VarName); + outAppend->appendf("%s = vec4(0);", vec4VarName); } else { - outAppend->appendf("%s *= %s;\n", vec4VarName, mulFactor.c_str()); + outAppend->appendf("%s *= %s;", vec4VarName, mulFactor.c_str()); } } diff --git a/src/gpu/gl/GrGLSL.h b/src/gpu/gl/GrGLSL.h index ff39c2b680..3cbce9c546 100644 --- a/src/gpu/gl/GrGLSL.h +++ b/src/gpu/gl/GrGLSL.h @@ -310,10 +310,9 @@ private: /** * Does an inplace mul, *=, of vec4VarName by mulFactor. - * A semicolon and newline are added after the assignment. + * A semicolon is added after the assignment. */ -void GrGLSLMulVarBy4f(SkString* outAppend, unsigned tabCnt, - const char* vec4VarName, const GrGLSLExpr4& mulFactor); +void GrGLSLMulVarBy4f(SkString* outAppend, const char* vec4VarName, const GrGLSLExpr4& mulFactor); #include "GrGLSL_impl.h" |