Chromium Code Reviews| Index: src/effects/gradients/SkTwoPointConicalGradient.cpp |
| diff --git a/src/effects/gradients/SkTwoPointConicalGradient.cpp b/src/effects/gradients/SkTwoPointConicalGradient.cpp |
| index 5e0c4b892b472f67e81b3685a2d0099bb531ffe5..91881ef43d53815aadd7fcfecb10679f91eb8401 100644 |
| --- a/src/effects/gradients/SkTwoPointConicalGradient.cpp |
| +++ b/src/effects/gradients/SkTwoPointConicalGradient.cpp |
| @@ -506,9 +506,11 @@ void GrGLConical2Gradient::emitCode(GrGLShaderBuilder* builder, |
| // For radial gradients without perspective we can pass the linear |
| // part of the quadratic as a varying. |
| - if (kVec2f_GrSLType == coordsVaryingType) { |
| - builder->addVarying(kFloat_GrSLType, "Conical2BCoeff", |
| - &fVSVaryingName, &fFSVaryingName); |
| + GrGLShaderBuilder::VertexBuilder* conical2BBuilder = |
|
bsalomon
2013/08/30 17:59:17
Could we call this vsBuilder, vertexBuilder, or vB
Chris Dalton
2013/08/30 19:10:30
Done.
|
| + (kVec2f_GrSLType == coordsVaryingType) ? builder->getVertexBuilder() : NULL; |
| + if (conical2BBuilder) { |
|
bsalomon
2013/08/30 17:59:17
Not really my pref, but at least in Gr code we ten
Chris Dalton
2013/08/30 19:10:30
Done.
|
| + conical2BBuilder->addVarying(kFloat_GrSLType, "Conical2BCoeff", |
| + &fVSVaryingName, &fFSVaryingName); |
| } |
| // VS |
| @@ -522,11 +524,11 @@ void GrGLConical2Gradient::emitCode(GrGLShaderBuilder* builder, |
| // For radial gradients without perspective we can pass the linear |
| // part of the quadratic as a varying. |
| - if (kVec2f_GrSLType == coordsVaryingType) { |
| + if (conical2BBuilder) { |
| // r2Var = -2 * (r2Parm[2] * varCoord.x - r2Param[3] * r2Param[5]) |
| - builder->vsCodeAppendf("\t%s = -2.0 * (%s * %s.x + %s * %s);\n", |
| - fVSVaryingName, p2.c_str(), |
| - vsCoordsVarying.c_str(), p3.c_str(), p5.c_str()); |
| + conical2BBuilder->vsCodeAppendf("\t%s = -2.0 * (%s * %s.x + %s * %s);\n", |
| + fVSVaryingName, p2.c_str(), |
| + vsCoordsVarying.c_str(), p3.c_str(), p5.c_str()); |
| } |
| } |
| @@ -557,7 +559,7 @@ void GrGLConical2Gradient::emitCode(GrGLShaderBuilder* builder, |
| // If we we're able to interpolate the linear component, |
| // bVar is the varying; otherwise compute it |
| SkString bVar; |
| - if (kVec2f_GrSLType == coordsVaryingType) { |
| + if (conical2BBuilder) { |
| bVar = fFSVaryingName; |
| } else { |
| bVar = "b"; |