Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(715)

Unified Diff: src/effects/gradients/SkTwoPointConicalGradient.cpp

Issue 23754003: Isolate VertexBuilder from GrGLShaderBuilder (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: comment fix Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/effects/gradients/SkTwoPointRadialGradient.cpp » ('j') | src/gpu/gl/GrGLShaderBuilder.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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";
« no previous file with comments | « no previous file | src/effects/gradients/SkTwoPointRadialGradient.cpp » ('j') | src/gpu/gl/GrGLShaderBuilder.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698