aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/effects/gradients/SkGradientShader.cpp
diff options
context:
space:
mode:
authorGravatar bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-08-30 17:54:14 +0000
committerGravatar bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-08-30 17:54:14 +0000
commitb41b2bc29c0411052f9f45855a98be370d586438 (patch)
treeeaa731fed5fb2f3ae8e7bb703d23eb51f6e7449f /src/effects/gradients/SkGradientShader.cpp
parent1ea01bf4cedc3067e980367e3f189a6d8642d6ce (diff)
Remove fModulate from GrGLShaderBuilder
Review URL: https://codereview.appspot.com/6495051/ git-svn-id: http://skia.googlecode.com/svn/trunk@5350 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/effects/gradients/SkGradientShader.cpp')
-rw-r--r--src/effects/gradients/SkGradientShader.cpp15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/effects/gradients/SkGradientShader.cpp b/src/effects/gradients/SkGradientShader.cpp
index 891b1cdf9b..3d989b7611 100644
--- a/src/effects/gradients/SkGradientShader.cpp
+++ b/src/effects/gradients/SkGradientShader.cpp
@@ -699,14 +699,19 @@ void GrGLGradientStage::setData(const GrGLUniformManager& uman,
}
void GrGLGradientStage::emitColorLookup(GrGLShaderBuilder* builder,
- const char* tName,
+ const char* gradientTValue,
const char* outputColor,
+ const char* inputColor,
const char* samplerName) {
- builder->fFSCode.appendf("\tvec2 coord = vec2(%s, %s);\n",
- tName,
- builder->getUniformVariable(fFSYUni).c_str());
- builder->emitTextureLookupAndModulate(outputColor, samplerName, "coord");
+ SkString* code = &builder->fFSCode;
+ code->appendf("\tvec2 coord = vec2(%s, %s);\n",
+ gradientTValue,
+ builder->getUniformVariable(fFSYUni).c_str());
+ GrGLSLMulVarBy4f(code, 1, outputColor, inputColor);
+ code->appendf("\t%s = ", outputColor);
+ builder->appendTextureLookupAndModulate(code, inputColor, samplerName, "coord");
+ code->append(";\n");
}
/////////////////////////////////////////////////////////////////////