aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/effects/gradients
diff options
context:
space:
mode:
authorGravatar Ethan Nicholas <ethannicholas@google.com>2017-05-02 15:37:57 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-05-02 20:05:56 +0000
commit93f20f5629e52eed732d2b9d6dbbb351cc30b2cd (patch)
tree70ba3a46eb5d55fb05cc24a790b883684143f92f /src/effects/gradients
parent37f16551f45919a1a039f081b5c8ea275e58427d (diff)
eliminated GrGLSLExpr
Now that skslc performs all of the optimizations (and then some) that GrGLSLExpr is responsible for, it's just extra work for no benefit. Bug: skia: Change-Id: I40b0629e00a33873ed9fc6c0a9f41d8350221f9a Reviewed-on: https://skia-review.googlesource.com/14560 Commit-Queue: Ethan Nicholas <ethannicholas@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'src/effects/gradients')
-rw-r--r--src/effects/gradients/SkGradientShader.cpp15
1 files changed, 5 insertions, 10 deletions
diff --git a/src/effects/gradients/SkGradientShader.cpp b/src/effects/gradients/SkGradientShader.cpp
index 276eaac8ed..f1cf1954ad 100644
--- a/src/effects/gradients/SkGradientShader.cpp
+++ b/src/effects/gradients/SkGradientShader.cpp
@@ -1434,8 +1434,7 @@ void GrGradientEffect::GLSLProcessor::emitColor(GrGLSLFPFragmentBuilder* fragBui
if (ge.fColorSpaceXform) {
fragBuilder->codeAppend("colorTemp.rgb = clamp(colorTemp.rgb, 0, colorTemp.a);");
}
- fragBuilder->codeAppendf("%s = %s;", outputColor,
- (GrGLSLExpr4(inputColor) * GrGLSLExpr4("colorTemp")).c_str());
+ fragBuilder->codeAppendf("%s = %s * colorTemp;", outputColor, inputColor);
break;
}
@@ -1473,8 +1472,7 @@ void GrGradientEffect::GLSLProcessor::emitColor(GrGLSLFPFragmentBuilder* fragBui
if (ge.fColorSpaceXform) {
fragBuilder->codeAppend("colorTemp.rgb = clamp(colorTemp.rgb, 0, colorTemp.a);");
}
- fragBuilder->codeAppendf("%s = %s;", outputColor,
- (GrGLSLExpr4(inputColor) * GrGLSLExpr4("colorTemp")).c_str());
+ fragBuilder->codeAppendf("%s = %s * colorTemp;", outputColor, inputColor);
break;
}
@@ -1512,8 +1510,7 @@ void GrGradientEffect::GLSLProcessor::emitColor(GrGLSLFPFragmentBuilder* fragBui
if (ge.fColorSpaceXform) {
fragBuilder->codeAppend("colorTemp.rgb = clamp(colorTemp.rgb, 0, colorTemp.a);");
}
- fragBuilder->codeAppendf("%s = %s;", outputColor,
- (GrGLSLExpr4(inputColor) * GrGLSLExpr4("colorTemp")).c_str());
+ fragBuilder->codeAppendf("%s = %s * colorTemp;", outputColor, inputColor);
break;
}
@@ -1539,8 +1536,7 @@ void GrGradientEffect::GLSLProcessor::emitColor(GrGLSLFPFragmentBuilder* fragBui
fragBuilder->codeAppend("colorTemp.rgb = clamp(colorTemp.rgb, 0, colorTemp.a);");
}
- fragBuilder->codeAppendf("%s = %s;", outputColor,
- (GrGLSLExpr4(inputColor) * GrGLSLExpr4("colorTemp")).c_str());
+ fragBuilder->codeAppendf("%s = %s * colorTemp;", outputColor, inputColor);
break;
}
@@ -1571,8 +1567,7 @@ void GrGradientEffect::GLSLProcessor::emitColor(GrGLSLFPFragmentBuilder* fragBui
fragBuilder->codeAppend("colorTemp.rgb = clamp(colorTemp.rgb, 0, colorTemp.a);");
}
- fragBuilder->codeAppendf("%s = %s;", outputColor,
- (GrGLSLExpr4(inputColor) * GrGLSLExpr4("colorTemp")).c_str());
+ fragBuilder->codeAppendf("%s = %s * colorTemp;", outputColor, inputColor);
break;
}