Index: src/effects/gradients/SkGradientShader.cpp |
diff --git a/src/effects/gradients/SkGradientShader.cpp b/src/effects/gradients/SkGradientShader.cpp |
index dff2d8cd4338ab421514d6e960584bd4a0a42838..9360ba920e9626a69be5c65f7c8f66e355097e18 100644 |
--- a/src/effects/gradients/SkGradientShader.cpp |
+++ b/src/effects/gradients/SkGradientShader.cpp |
@@ -950,11 +950,8 @@ void GrGLGradientEffect::emitColor(GrGLShaderBuilder* builder, |
builder->fsCodeAppend("\tcolorTemp.rgb *= colorTemp.a;\n"); |
} |
- SkString output; |
- builder->fsCodeAppendf("\t%s = ", outputColor); |
- GrGLSLModulatef<4>(&output, inputColor, "colorTemp"); |
- builder->fsCodeAppend(output.c_str()); |
- builder->fsCodeAppend(";\n"); |
+ builder->fsCodeAppendf("\t%s = %s;\n", outputColor, |
+ (GrGLSLExpr<4>(inputColor) * GrGLSLExpr<4>("colorTemp")).c_str()); |
} else if (GrGradientEffect::kThree_ColorType == ColorTypeFromKey(key)){ |
builder->fsCodeAppendf("\tfloat oneMinus2t = 1.0 - (2.0 * (%s));\n", |
gradientTValue); |
@@ -977,11 +974,8 @@ void GrGLGradientEffect::emitColor(GrGLShaderBuilder* builder, |
builder->fsCodeAppend("\tcolorTemp.rgb *= colorTemp.a;\n"); |
} |
- SkString output; |
- builder->fsCodeAppendf("\t%s = ", outputColor); |
- GrGLSLModulatef<4>(&output, inputColor, "colorTemp"); |
- builder->fsCodeAppend(output.c_str()); |
- builder->fsCodeAppend(";\n"); |
+ builder->fsCodeAppendf("\t%s = %s;\n", outputColor, |
+ (GrGLSLExpr<4>(inputColor) * GrGLSLExpr<4>("colorTemp")).c_str()); |
} else { |
builder->fsCodeAppendf("\tvec2 coord = vec2(%s, %s);\n", |
gradientTValue, |