Index: src/gpu/effects/GrBezierEffect.cpp |
diff --git a/src/gpu/effects/GrBezierEffect.cpp b/src/gpu/effects/GrBezierEffect.cpp |
index 7384f62856c91378014f114d3fdee8c026a8e02a..e3fb8c15f94cb6cfebb493c513c1f96e991d46cd 100644 |
--- a/src/gpu/effects/GrBezierEffect.cpp |
+++ b/src/gpu/effects/GrBezierEffect.cpp |
@@ -57,67 +57,97 @@ void GrGLConicEffect::emitCode(GrGLFullProgramBuilder* builder, |
GrGLVertexShaderBuilder* vsBuilder = builder->getVertexShaderBuilder(); |
const SkString* attr0Name = |
vsBuilder->getEffectAttributeName(drawEffect.getVertexAttribIndices()[0]); |
- vsBuilder->codeAppendf("\t%s = %s;\n", vsName, attr0Name->c_str()); |
+ vsBuilder->codeAppendf("%s = %s;", vsName, attr0Name->c_str()); |
GrGLFragmentShaderBuilder* fsBuilder = builder->getFragmentShaderBuilder(); |
- fsBuilder->codeAppend("\t\tfloat edgeAlpha;\n"); |
+ |
+ GrGLShaderVar edgeAlpha("edgeAlpha", kFloat_GrSLType, 0, GrGLShaderVar::kHigh_Precision); |
+ GrGLShaderVar dklmdx("dklmdx", kVec3f_GrSLType, 0, GrGLShaderVar::kHigh_Precision); |
+ GrGLShaderVar dklmdy("dklmdy", kVec3f_GrSLType, 0, GrGLShaderVar::kHigh_Precision); |
+ GrGLShaderVar dfdx("dfdx", kFloat_GrSLType, 0, GrGLShaderVar::kHigh_Precision); |
+ GrGLShaderVar dfdy("dfdy", kFloat_GrSLType, 0, GrGLShaderVar::kHigh_Precision); |
+ GrGLShaderVar gF("gF", kVec2f_GrSLType, 0, GrGLShaderVar::kHigh_Precision); |
+ GrGLShaderVar gFM("gFM", kFloat_GrSLType, 0, GrGLShaderVar::kHigh_Precision); |
+ GrGLShaderVar func("func", kFloat_GrSLType, 0, GrGLShaderVar::kHigh_Precision); |
+ |
+ fsBuilder->declAppend(edgeAlpha); |
+ fsBuilder->declAppend(dklmdx); |
+ fsBuilder->declAppend(dklmdy); |
+ fsBuilder->declAppend(dfdx); |
+ fsBuilder->declAppend(dfdy); |
+ fsBuilder->declAppend(gF); |
+ fsBuilder->declAppend(gFM); |
+ fsBuilder->declAppend(func); |
switch (fEdgeType) { |
case kHairlineAA_GrEffectEdgeType: { |
SkAssertResult(fsBuilder->enableFeature( |
GrGLFragmentShaderBuilder::kStandardDerivatives_GLSLFeature)); |
- fsBuilder->codeAppendf("\t\tvec3 dklmdx = dFdx(%s.xyz);\n", fsName); |
- fsBuilder->codeAppendf("\t\tvec3 dklmdy = dFdy(%s.xyz);\n", fsName); |
- fsBuilder->codeAppendf("\t\tfloat dfdx =\n" |
- "\t\t\t2.0*%s.x*dklmdx.x - %s.y*dklmdx.z - %s.z*dklmdx.y;\n", |
- fsName, fsName, fsName); |
- fsBuilder->codeAppendf("\t\tfloat dfdy =\n" |
- "\t\t\t2.0*%s.x*dklmdy.x - %s.y*dklmdy.z - %s.z*dklmdy.y;\n", |
- fsName, fsName, fsName); |
- fsBuilder->codeAppend("\t\tvec2 gF = vec2(dfdx, dfdy);\n"); |
- fsBuilder->codeAppend("\t\tfloat gFM = sqrt(dot(gF, gF));\n"); |
- fsBuilder->codeAppendf("\t\tfloat func = %s.x*%s.x - %s.y*%s.z;\n", fsName, fsName, |
- fsName, fsName); |
- fsBuilder->codeAppend("\t\tfunc = abs(func);\n"); |
- fsBuilder->codeAppend("\t\tedgeAlpha = func / gFM;\n"); |
- fsBuilder->codeAppend("\t\tedgeAlpha = max(1.0 - edgeAlpha, 0.0);\n"); |
+ fsBuilder->codeAppendf("%s = dFdx(%s.xyz);", dklmdx.c_str(), fsName); |
+ fsBuilder->codeAppendf("%s = dFdy(%s.xyz);", dklmdy.c_str(), fsName); |
+ fsBuilder->codeAppendf("%s = 2.0 * %s.x * %s.x - %s.y * %s.z - %s.z * %s.y;", |
+ dfdx.c_str(), fsName, dklmdx.c_str(), fsName, dklmdx.c_str(), |
+ fsName, dklmdx.c_str()); |
+ fsBuilder->codeAppendf("%s = 2.0 * %s.x * %s.x - %s.y * %s.z - %s.z * %s.y;", |
+ dfdy.c_str(), fsName, dklmdy.c_str(), fsName, dklmdy.c_str(), |
+ fsName, dklmdy.c_str()); |
+ fsBuilder->codeAppendf("%s = vec2(%s, %s);", |
+ gF.c_str(), dfdx.c_str(), dfdy.c_str()); |
+ fsBuilder->codeAppendf("%s = sqrt(dot(%s, %s));", |
+ gFM.c_str(), gF.c_str(), gF.c_str()); |
+ fsBuilder->codeAppendf("%s = %s.x * %s.x - %s.y * %s.z;", |
+ func.c_str(), fsName, fsName, fsName, fsName); |
+ fsBuilder->codeAppendf("%s = abs(%s);", func.c_str(), func.c_str()); |
+ fsBuilder->codeAppendf("%s = %s / %s;", |
+ edgeAlpha.c_str(), func.c_str(), gFM.c_str()); |
+ fsBuilder->codeAppendf("%s = max(1.0 - %s, 0.0);", |
+ edgeAlpha.c_str(), edgeAlpha.c_str()); |
// Add line below for smooth cubic ramp |
- // fsBuilder->codeAppend("\t\tedgeAlpha = edgeAlpha*edgeAlpha*(3.0-2.0*edgeAlpha);\n"); |
+ // fsBuilder->codeAppendf("%s = %s * %s * (3.0 - 2.0 * %s);", |
+ // edgeAlpha.c_str(), edgeAlpha.c_str(), edgeAlpha.c_str(), |
+ // edgeAlpha.c_str()); |
break; |
} |
case kFillAA_GrEffectEdgeType: { |
SkAssertResult(fsBuilder->enableFeature( |
GrGLFragmentShaderBuilder::kStandardDerivatives_GLSLFeature)); |
- fsBuilder->codeAppendf("\t\tvec3 dklmdx = dFdx(%s.xyz);\n", fsName); |
- fsBuilder->codeAppendf("\t\tvec3 dklmdy = dFdy(%s.xyz);\n", fsName); |
- fsBuilder->codeAppendf("\t\tfloat dfdx =\n" |
- "\t\t\t2.0*%s.x*dklmdx.x - %s.y*dklmdx.z - %s.z*dklmdx.y;\n", |
- fsName, fsName, fsName); |
- fsBuilder->codeAppendf("\t\tfloat dfdy =\n" |
- "\t\t\t2.0*%s.x*dklmdy.x - %s.y*dklmdy.z - %s.z*dklmdy.y;\n", |
- fsName, fsName, fsName); |
- fsBuilder->codeAppend("\t\tvec2 gF = vec2(dfdx, dfdy);\n"); |
- fsBuilder->codeAppend("\t\tfloat gFM = sqrt(dot(gF, gF));\n"); |
- fsBuilder->codeAppendf("\t\tfloat func = %s.x*%s.x - %s.y*%s.z;\n", fsName, fsName, |
- fsName, fsName); |
- fsBuilder->codeAppend("\t\tedgeAlpha = func / gFM;\n"); |
- fsBuilder->codeAppend("\t\tedgeAlpha = clamp(1.0 - edgeAlpha, 0.0, 1.0);\n"); |
+ fsBuilder->codeAppendf("%s = dFdx(%s.xyz);", dklmdx.c_str(), fsName); |
+ fsBuilder->codeAppendf("%s = dFdy(%s.xyz);", dklmdy.c_str(), fsName); |
+ fsBuilder->codeAppendf("%s = 2.0 * %s.x * %s.x - %s.y * %s.z - %s.z * %s.y;", |
+ dfdx.c_str(), fsName, dklmdx.c_str(), fsName, dklmdx.c_str(), |
+ fsName, dklmdx.c_str()); |
+ fsBuilder->codeAppendf("%s = 2.0 * %s.x * %s.x - %s.y * %s.z - %s.z * %s.y;", |
+ dfdy.c_str(), fsName, dklmdy.c_str(), fsName, dklmdy.c_str(), |
+ fsName, dklmdy.c_str()); |
+ fsBuilder->codeAppendf("%s = vec2(%s, %s);", |
+ gF.c_str(), dfdx.c_str(), dfdy.c_str()); |
+ fsBuilder->codeAppendf("%s = sqrt(dot(%s, %s));", |
+ gFM.c_str(), gF.c_str(), gF.c_str()); |
+ fsBuilder->codeAppendf("%s = %s.x * %s.x - %s.y * %s.z;", |
+ func.c_str(), fsName, fsName, fsName, fsName); |
+ fsBuilder->codeAppendf("%s = %s / %s;", |
+ edgeAlpha.c_str(), func.c_str(), gFM.c_str()); |
+ fsBuilder->codeAppendf("%s = clamp(1.0 - %s, 0.0, 1.0);", |
+ edgeAlpha.c_str(), edgeAlpha.c_str()); |
// Add line below for smooth cubic ramp |
- // fsBuilder->codeAppend("\t\tedgeAlpha = edgeAlpha*edgeAlpha*(3.0-2.0*edgeAlpha);\n"); |
+ // fsBuilder->codeAppendf("%s = %s * %s * (3.0 - 2.0 * %s);", |
+ // edgeAlpha.c_str(), edgeAlpha.c_str(), edgeAlpha.c_str(), |
+ // edgeAlpha.c_str()); |
break; |
} |
case kFillBW_GrEffectEdgeType: { |
- fsBuilder->codeAppendf("\t\tedgeAlpha = %s.x*%s.x - %s.y*%s.z;\n", fsName, fsName, |
- fsName, fsName); |
- fsBuilder->codeAppend("\t\tedgeAlpha = float(edgeAlpha < 0.0);\n"); |
+ fsBuilder->codeAppendf("%s = %s.x * %s.x - %s.y * %s.z;", |
+ edgeAlpha.c_str(), fsName, fsName, fsName, fsName); |
+ fsBuilder->codeAppendf("%s = float(%s < 0.0);", |
+ edgeAlpha.c_str(), edgeAlpha.c_str()); |
break; |
} |
default: |
SkFAIL("Shouldn't get here"); |
} |
- fsBuilder->codeAppendf("\t%s = %s;\n", outputColor, |
- (GrGLSLExpr4(inputColor) * GrGLSLExpr1("edgeAlpha")).c_str()); |
+ fsBuilder->codeAppendf("%s = %s;", outputColor, |
+ (GrGLSLExpr4(inputColor) * GrGLSLExpr1(edgeAlpha.c_str())).c_str()); |
} |
void GrGLConicEffect::GenKey(const GrDrawEffect& drawEffect, const GrGLCaps&, |
@@ -208,55 +238,52 @@ void GrGLQuadEffect::emitCode(GrGLFullProgramBuilder* builder, |
GrGLVertexShaderBuilder* vsBuilder = builder->getVertexShaderBuilder(); |
const SkString* attrName = |
vsBuilder->getEffectAttributeName(drawEffect.getVertexAttribIndices()[0]); |
- vsBuilder->codeAppendf("\t%s = %s;\n", vsName, attrName->c_str()); |
+ vsBuilder->codeAppendf("%s = %s;", vsName, attrName->c_str()); |
GrGLFragmentShaderBuilder* fsBuilder = builder->getFragmentShaderBuilder(); |
- fsBuilder->codeAppendf("\t\tfloat edgeAlpha;\n"); |
+ fsBuilder->codeAppendf("float edgeAlpha;"); |
switch (fEdgeType) { |
case kHairlineAA_GrEffectEdgeType: { |
SkAssertResult(fsBuilder->enableFeature( |
GrGLFragmentShaderBuilder::kStandardDerivatives_GLSLFeature)); |
- fsBuilder->codeAppendf("\t\tvec2 duvdx = dFdx(%s.xy);\n", fsName); |
- fsBuilder->codeAppendf("\t\tvec2 duvdy = dFdy(%s.xy);\n", fsName); |
- fsBuilder->codeAppendf("\t\tvec2 gF = vec2(2.0*%s.x*duvdx.x - duvdx.y,\n" |
- "\t\t 2.0*%s.x*duvdy.x - duvdy.y);\n", |
+ fsBuilder->codeAppendf("vec2 duvdx = dFdx(%s.xy);", fsName); |
+ fsBuilder->codeAppendf("vec2 duvdy = dFdy(%s.xy);", fsName); |
+ fsBuilder->codeAppendf("vec2 gF = vec2(2.0 * %s.x * duvdx.x - duvdx.y," |
+ " 2.0 * %s.x * duvdy.x - duvdy.y);", |
fsName, fsName); |
- fsBuilder->codeAppendf("\t\tedgeAlpha = (%s.x*%s.x - %s.y);\n", fsName, fsName, |
- fsName); |
- fsBuilder->codeAppend("\t\tedgeAlpha = sqrt(edgeAlpha*edgeAlpha / dot(gF, gF));\n"); |
- fsBuilder->codeAppend("\t\tedgeAlpha = max(1.0 - edgeAlpha, 0.0);\n"); |
+ fsBuilder->codeAppendf("edgeAlpha = (%s.x * %s.x - %s.y);", fsName, fsName, fsName); |
+ fsBuilder->codeAppend("edgeAlpha = sqrt(edgeAlpha * edgeAlpha / dot(gF, gF));"); |
+ fsBuilder->codeAppend("edgeAlpha = max(1.0 - edgeAlpha, 0.0);"); |
// Add line below for smooth cubic ramp |
- // fsBuilder->codeAppend("\t\tedgeAlpha = edgeAlpha*edgeAlpha*(3.0-2.0*edgeAlpha);\n"); |
+ // fsBuilder->codeAppend("edgeAlpha = edgeAlpha*edgeAlpha*(3.0-2.0*edgeAlpha);"); |
break; |
} |
case kFillAA_GrEffectEdgeType: { |
SkAssertResult(fsBuilder->enableFeature( |
GrGLFragmentShaderBuilder::kStandardDerivatives_GLSLFeature)); |
- fsBuilder->codeAppendf("\t\tvec2 duvdx = dFdx(%s.xy);\n", fsName); |
- fsBuilder->codeAppendf("\t\tvec2 duvdy = dFdy(%s.xy);\n", fsName); |
- fsBuilder->codeAppendf("\t\tvec2 gF = vec2(2.0*%s.x*duvdx.x - duvdx.y,\n" |
- "\t\t 2.0*%s.x*duvdy.x - duvdy.y);\n", |
+ fsBuilder->codeAppendf("vec2 duvdx = dFdx(%s.xy);", fsName); |
+ fsBuilder->codeAppendf("vec2 duvdy = dFdy(%s.xy);", fsName); |
+ fsBuilder->codeAppendf("vec2 gF = vec2(2.0 * %s.x * duvdx.x - duvdx.y," |
+ " 2.0 * %s.x * duvdy.x - duvdy.y);", |
fsName, fsName); |
- fsBuilder->codeAppendf("\t\tedgeAlpha = (%s.x*%s.x - %s.y);\n", fsName, fsName, |
- fsName); |
- fsBuilder->codeAppend("\t\tedgeAlpha = edgeAlpha / sqrt(dot(gF, gF));\n"); |
- fsBuilder->codeAppend("\t\tedgeAlpha = clamp(1.0 - edgeAlpha, 0.0, 1.0);\n"); |
+ fsBuilder->codeAppendf("edgeAlpha = (%s.x * %s.x - %s.y);", fsName, fsName, fsName); |
+ fsBuilder->codeAppend("edgeAlpha = edgeAlpha / sqrt(dot(gF, gF));"); |
+ fsBuilder->codeAppend("edgeAlpha = clamp(1.0 - edgeAlpha, 0.0, 1.0);"); |
// Add line below for smooth cubic ramp |
- // fsBuilder->codeAppend("\t\tedgeAlpha = edgeAlpha*edgeAlpha*(3.0-2.0*edgeAlpha);\n"); |
+ // fsBuilder->codeAppend("edgeAlpha = edgeAlpha*edgeAlpha*(3.0-2.0*edgeAlpha);"); |
break; |
} |
case kFillBW_GrEffectEdgeType: { |
- fsBuilder->codeAppendf("\t\tedgeAlpha = (%s.x*%s.x - %s.y);\n", fsName, fsName, |
- fsName); |
- fsBuilder->codeAppend("\t\tedgeAlpha = float(edgeAlpha < 0.0);\n"); |
+ fsBuilder->codeAppendf("edgeAlpha = (%s.x * %s.x - %s.y);", fsName, fsName, fsName); |
+ fsBuilder->codeAppend("edgeAlpha = float(edgeAlpha < 0.0);"); |
break; |
} |
default: |
SkFAIL("Shouldn't get here"); |
} |
- fsBuilder->codeAppendf("\t%s = %s;\n", outputColor, |
+ fsBuilder->codeAppendf("%s = %s;", outputColor, |
(GrGLSLExpr4(inputColor) * GrGLSLExpr1("edgeAlpha")).c_str()); |
} |
@@ -350,66 +377,66 @@ void GrGLCubicEffect::emitCode(GrGLFullProgramBuilder* builder, |
GrGLVertexShaderBuilder* vsBuilder = builder->getVertexShaderBuilder(); |
const SkString* attr0Name = |
vsBuilder->getEffectAttributeName(drawEffect.getVertexAttribIndices()[0]); |
- vsBuilder->codeAppendf("\t%s = %s;\n", vsName, attr0Name->c_str()); |
+ vsBuilder->codeAppendf("%s = %s;", vsName, attr0Name->c_str()); |
GrGLFragmentShaderBuilder* fsBuilder = builder->getFragmentShaderBuilder(); |
- fsBuilder->codeAppend("\t\tfloat edgeAlpha;\n"); |
+ fsBuilder->codeAppend("float edgeAlpha;"); |
switch (fEdgeType) { |
case kHairlineAA_GrEffectEdgeType: { |
SkAssertResult(fsBuilder->enableFeature( |
GrGLFragmentShaderBuilder::kStandardDerivatives_GLSLFeature)); |
- fsBuilder->codeAppendf("\t\tvec3 dklmdx = dFdx(%s.xyz);\n", fsName); |
- fsBuilder->codeAppendf("\t\tvec3 dklmdy = dFdy(%s.xyz);\n", fsName); |
- fsBuilder->codeAppendf("\t\tfloat dfdx =\n" |
- "\t\t3.0*%s.x*%s.x*dklmdx.x - %s.y*dklmdx.z - %s.z*dklmdx.y;\n", |
+ fsBuilder->codeAppendf("vec3 dklmdx = dFdx(%s.xyz);", fsName); |
+ fsBuilder->codeAppendf("vec3 dklmdy = dFdy(%s.xyz);", fsName); |
+ fsBuilder->codeAppendf("float dfdx =" |
+ "3.0*%s.x*%s.x * dklmdx.x - %s.y * dklmdx.z - %s.z * dklmdx.y;", |
fsName, fsName, fsName, fsName); |
- fsBuilder->codeAppendf("\t\tfloat dfdy =\n" |
- "\t\t3.0*%s.x*%s.x*dklmdy.x - %s.y*dklmdy.z - %s.z*dklmdy.y;\n", |
+ fsBuilder->codeAppendf("float dfdy =" |
+ "3.0*%s.x*%s.x * dklmdy.x - %s.y * dklmdy.z - %s.z * dklmdy.y;", |
fsName, fsName, fsName, fsName); |
- fsBuilder->codeAppend("\t\tvec2 gF = vec2(dfdx, dfdy);\n"); |
- fsBuilder->codeAppend("\t\tfloat gFM = sqrt(dot(gF, gF));\n"); |
- fsBuilder->codeAppendf("\t\tfloat func = %s.x*%s.x*%s.x - %s.y*%s.z;\n", |
+ fsBuilder->codeAppend("vec2 gF = vec2(dfdx, dfdy);"); |
+ fsBuilder->codeAppend("float gFM = sqrt(dot(gF, gF));"); |
+ fsBuilder->codeAppendf("float func = %s.x * %s.x * %s.x - %s.y * %s.z;", |
fsName, fsName, fsName, fsName, fsName); |
- fsBuilder->codeAppend("\t\tfunc = abs(func);\n"); |
- fsBuilder->codeAppend("\t\tedgeAlpha = func / gFM;\n"); |
- fsBuilder->codeAppend("\t\tedgeAlpha = max(1.0 - edgeAlpha, 0.0);\n"); |
+ fsBuilder->codeAppend("func = abs(func);"); |
+ fsBuilder->codeAppend("edgeAlpha = func / gFM;"); |
+ fsBuilder->codeAppend("edgeAlpha = max(1.0 - edgeAlpha, 0.0);"); |
// Add line below for smooth cubic ramp |
- // fsBuilder->codeAppend("\t\tedgeAlpha = edgeAlpha*edgeAlpha*(3.0-2.0*edgeAlpha);\n"); |
+ // fsBuilder->codeAppend("edgeAlpha = edgeAlpha*edgeAlpha*(3.0-2.0*edgeAlpha);"); |
break; |
} |
case kFillAA_GrEffectEdgeType: { |
SkAssertResult(fsBuilder->enableFeature( |
GrGLFragmentShaderBuilder::kStandardDerivatives_GLSLFeature)); |
- fsBuilder->codeAppendf("\t\tvec3 dklmdx = dFdx(%s.xyz);\n", fsName); |
- fsBuilder->codeAppendf("\t\tvec3 dklmdy = dFdy(%s.xyz);\n", fsName); |
- fsBuilder->codeAppendf("\t\tfloat dfdx =\n" |
- "\t\t3.0*%s.x*%s.x*dklmdx.x - %s.y*dklmdx.z - %s.z*dklmdx.y;\n", |
+ fsBuilder->codeAppendf("vec3 dklmdx = dFdx(%s.xyz);", fsName); |
+ fsBuilder->codeAppendf("vec3 dklmdy = dFdy(%s.xyz);", fsName); |
+ fsBuilder->codeAppendf("float dfdx =" |
+ "3.0*%s.x*%s.x * dklmdx.x - %s.y * dklmdx.z - %s.z * dklmdx.y;", |
fsName, fsName, fsName, fsName); |
- fsBuilder->codeAppendf("\t\tfloat dfdy =\n" |
- "\t\t3.0*%s.x*%s.x*dklmdy.x - %s.y*dklmdy.z - %s.z*dklmdy.y;\n", |
+ fsBuilder->codeAppendf("float dfdy =" |
+ "3.0*%s.x*%s.x * dklmdy.x - %s.y * dklmdy.z - %s.z * dklmdy.y;", |
fsName, fsName, fsName, fsName); |
- fsBuilder->codeAppend("\t\tvec2 gF = vec2(dfdx, dfdy);\n"); |
- fsBuilder->codeAppend("\t\tfloat gFM = sqrt(dot(gF, gF));\n"); |
- fsBuilder->codeAppendf("\t\tfloat func = %s.x*%s.x*%s.x - %s.y*%s.z;\n", |
+ fsBuilder->codeAppend("vec2 gF = vec2(dfdx, dfdy);"); |
+ fsBuilder->codeAppend("float gFM = sqrt(dot(gF, gF));"); |
+ fsBuilder->codeAppendf("float func = %s.x * %s.x * %s.x - %s.y * %s.z;", |
fsName, fsName, fsName, fsName, fsName); |
- fsBuilder->codeAppend("\t\tedgeAlpha = func / gFM;\n"); |
- fsBuilder->codeAppend("\t\tedgeAlpha = clamp(1.0 - edgeAlpha, 0.0, 1.0);\n"); |
+ fsBuilder->codeAppend("edgeAlpha = func / gFM;"); |
+ fsBuilder->codeAppend("edgeAlpha = clamp(1.0 - edgeAlpha, 0.0, 1.0);"); |
// Add line below for smooth cubic ramp |
- // fsBuilder->codeAppend("\t\tedgeAlpha = edgeAlpha*edgeAlpha*(3.0-2.0*edgeAlpha);\n"); |
+ // fsBuilder->codeAppend("edgeAlpha = edgeAlpha*edgeAlpha*(3.0-2.0*edgeAlpha);"); |
break; |
} |
case kFillBW_GrEffectEdgeType: { |
- fsBuilder->codeAppendf("\t\tedgeAlpha = %s.x*%s.x*%s.x - %s.y*%s.z;\n", |
+ fsBuilder->codeAppendf("edgeAlpha = %s.x * %s.x * %s.x - %s.y * %s.z;", |
fsName, fsName, fsName, fsName, fsName); |
- fsBuilder->codeAppend("\t\tedgeAlpha = float(edgeAlpha < 0.0);\n"); |
+ fsBuilder->codeAppend("edgeAlpha = float(edgeAlpha < 0.0);"); |
break; |
} |
default: |
SkFAIL("Shouldn't get here"); |
} |
- fsBuilder->codeAppendf("\t%s = %s;\n", outputColor, |
+ fsBuilder->codeAppendf("%s = %s;", outputColor, |
(GrGLSLExpr4(inputColor) * GrGLSLExpr1("edgeAlpha")).c_str()); |
} |