aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/effects/gradients
diff options
context:
space:
mode:
authorGravatar bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-08-30 18:11:48 +0000
committerGravatar bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-08-30 18:11:48 +0000
commita3d707b4ec17e925f71cc0c39d40252d2b788314 (patch)
treefd547ab1ea2fa48b1f2e20847f7f035f2c6e8cdd /src/effects/gradients
parentb41b2bc29c0411052f9f45855a98be370d586438 (diff)
Revert 5350 while image changes are diagnosed.
git-svn-id: http://skia.googlecode.com/svn/trunk@5351 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/effects/gradients')
-rw-r--r--src/effects/gradients/SkGradientShader.cpp15
-rw-r--r--src/effects/gradients/SkGradientShaderPriv.h7
-rw-r--r--src/effects/gradients/SkLinearGradient.cpp2
-rw-r--r--src/effects/gradients/SkRadialGradient.cpp2
-rw-r--r--src/effects/gradients/SkSweepGradient.cpp2
-rw-r--r--src/effects/gradients/SkTwoPointConicalGradient.cpp6
-rw-r--r--src/effects/gradients/SkTwoPointRadialGradient.cpp2
7 files changed, 14 insertions, 22 deletions
diff --git a/src/effects/gradients/SkGradientShader.cpp b/src/effects/gradients/SkGradientShader.cpp
index 3d989b7611..891b1cdf9b 100644
--- a/src/effects/gradients/SkGradientShader.cpp
+++ b/src/effects/gradients/SkGradientShader.cpp
@@ -699,19 +699,14 @@ void GrGLGradientStage::setData(const GrGLUniformManager& uman,
}
void GrGLGradientStage::emitColorLookup(GrGLShaderBuilder* builder,
- const char* gradientTValue,
+ const char* tName,
const char* outputColor,
- const char* inputColor,
const char* samplerName) {
- 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");
+ builder->fFSCode.appendf("\tvec2 coord = vec2(%s, %s);\n",
+ tName,
+ builder->getUniformVariable(fFSYUni).c_str());
+ builder->emitTextureLookupAndModulate(outputColor, samplerName, "coord");
}
/////////////////////////////////////////////////////////////////////
diff --git a/src/effects/gradients/SkGradientShaderPriv.h b/src/effects/gradients/SkGradientShaderPriv.h
index 2b584f30b6..37959678a2 100644
--- a/src/effects/gradients/SkGradientShaderPriv.h
+++ b/src/effects/gradients/SkGradientShaderPriv.h
@@ -287,11 +287,8 @@ public:
// emit code that gets a fragment's color from an expression for t; for now
// this always uses the texture, but for simpler cases we'll be able to lerp
- void emitColorLookup(GrGLShaderBuilder* builder,
- const char* gradientTValue,
- const char* outputColor,
- const char* inputColor,
- const char* samplerName);
+ void emitColorLookup(GrGLShaderBuilder* builder, const char* t,
+ const char* outputColor, const char* samplerName);
private:
diff --git a/src/effects/gradients/SkLinearGradient.cpp b/src/effects/gradients/SkLinearGradient.cpp
index 6415927c72..78d2f24a04 100644
--- a/src/effects/gradients/SkLinearGradient.cpp
+++ b/src/effects/gradients/SkLinearGradient.cpp
@@ -553,7 +553,7 @@ void GrGLLinearGradient::emitFS(GrGLShaderBuilder* builder,
const char* samplerName) {
SkString t;
t.printf("%s.x", builder->defaultTexCoordsName());
- this->emitColorLookup(builder, t.c_str(), outputColor, inputColor, samplerName);
+ this->emitColorLookup(builder, t.c_str(), outputColor, samplerName);
}
/////////////////////////////////////////////////////////////////////
diff --git a/src/effects/gradients/SkRadialGradient.cpp b/src/effects/gradients/SkRadialGradient.cpp
index 98433e28ef..317ab68b47 100644
--- a/src/effects/gradients/SkRadialGradient.cpp
+++ b/src/effects/gradients/SkRadialGradient.cpp
@@ -553,7 +553,7 @@ void GrGLRadialGradient::emitFS(GrGLShaderBuilder* builder,
const char* samplerName) {
SkString t;
t.printf("length(%s.xy)", builder->defaultTexCoordsName());
- this->emitColorLookup(builder, t.c_str(), outputColor, inputColor, samplerName);
+ this->emitColorLookup(builder, t.c_str(), outputColor, samplerName);
}
/////////////////////////////////////////////////////////////////////
diff --git a/src/effects/gradients/SkSweepGradient.cpp b/src/effects/gradients/SkSweepGradient.cpp
index 22b211871c..15547de6d4 100644
--- a/src/effects/gradients/SkSweepGradient.cpp
+++ b/src/effects/gradients/SkSweepGradient.cpp
@@ -459,7 +459,7 @@ void GrGLSweepGradient::emitFS(GrGLShaderBuilder* builder,
SkString t;
t.printf("atan(- %s.y, - %s.x) * 0.1591549430918 + 0.5",
builder->defaultTexCoordsName(), builder->defaultTexCoordsName());
- this->emitColorLookup(builder, t.c_str(), outputColor, inputColor, samplerName);
+ this->emitColorLookup(builder, t.c_str(), outputColor, samplerName);
}
/////////////////////////////////////////////////////////////////////
diff --git a/src/effects/gradients/SkTwoPointConicalGradient.cpp b/src/effects/gradients/SkTwoPointConicalGradient.cpp
index c84989b67f..8b32ab6bb7 100644
--- a/src/effects/gradients/SkTwoPointConicalGradient.cpp
+++ b/src/effects/gradients/SkTwoPointConicalGradient.cpp
@@ -593,7 +593,7 @@ void GrGLConical2Gradient::emitFS(GrGLShaderBuilder* builder,
p5.c_str(), p3.c_str());
code->appendf("\t\t");
- this->emitColorLookup(builder, tName.c_str(), outputColor, inputColor, samplerName);
+ this->emitColorLookup(builder, tName.c_str(), outputColor, samplerName);
// otherwise, if r(t) for the larger root was <= 0, try the other root
code->appendf("\t\t} else {\n");
@@ -605,7 +605,7 @@ void GrGLConical2Gradient::emitFS(GrGLShaderBuilder* builder,
tName.c_str(), p5.c_str(), p3.c_str());
code->appendf("\t\t\t");
- this->emitColorLookup(builder, tName.c_str(), outputColor, inputColor, samplerName);
+ this->emitColorLookup(builder, tName.c_str(), outputColor, samplerName);
// end if (r(t) > 0) for smaller root
code->appendf("\t\t\t}\n");
@@ -623,7 +623,7 @@ void GrGLConical2Gradient::emitFS(GrGLShaderBuilder* builder,
code->appendf("\tif (%s * %s + %s > 0.0) {\n", tName.c_str(),
p5.c_str(), p3.c_str());
code->appendf("\t");
- this->emitColorLookup(builder, tName.c_str(), outputColor, inputColor, samplerName);
+ this->emitColorLookup(builder, tName.c_str(), outputColor, samplerName);
code->appendf("\t}\n");
}
}
diff --git a/src/effects/gradients/SkTwoPointRadialGradient.cpp b/src/effects/gradients/SkTwoPointRadialGradient.cpp
index 2192707cc4..693dc32b0a 100644
--- a/src/effects/gradients/SkTwoPointRadialGradient.cpp
+++ b/src/effects/gradients/SkTwoPointRadialGradient.cpp
@@ -601,7 +601,7 @@ void GrGLRadial2Gradient::emitFS(GrGLShaderBuilder* builder,
t.printf("-%s / %s", cName.c_str(), bVar.c_str());
}
- this->emitColorLookup(builder, t.c_str(), outputColor, inputColor, samplerName);
+ this->emitColorLookup(builder, t.c_str(), outputColor, samplerName);
}
void GrGLRadial2Gradient::setData(const GrGLUniformManager& uman,