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

Unified Diff: src/gpu/gl/builders/GrGLProgramBuilder.cpp

Issue 675193002: Revert of Added varying struct (Closed) Base URL: https://skia.googlesource.com/skia.git@gp_emit_struct
Patch Set: Created 6 years, 2 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 | « src/gpu/gl/builders/GrGLProgramBuilder.h ('k') | src/gpu/gl/builders/GrGLVertexShaderBuilder.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/gl/builders/GrGLProgramBuilder.cpp
diff --git a/src/gpu/gl/builders/GrGLProgramBuilder.cpp b/src/gpu/gl/builders/GrGLProgramBuilder.cpp
index 4a95f33eccef6535c4b4672715ad4d0ad72bde2a..a628febb6962336b0165dd750a1577f76686e5d1 100644
--- a/src/gpu/gl/builders/GrGLProgramBuilder.cpp
+++ b/src/gpu/gl/builders/GrGLProgramBuilder.cpp
@@ -126,19 +126,13 @@
, fUniforms(kVarsPerBlock) {
}
-void GrGLProgramBuilder::addVarying(const char* name,
- GrGLVarying* varying,
+void GrGLProgramBuilder::addVarying(GrSLType type,
+ const char* name,
+ const char** vsOutName,
+ const char** fsInName,
GrGLShaderVar::Precision fsPrecision) {
- SkASSERT(varying);
- if (varying->vsVarying()) {
- fVS.addVarying(name, varying);
- }
- if (fOptState.hasGeometryProcessor() && fOptState.getGeometryProcessor()->willUseGeoShader()) {
- fGS.addVarying(name, varying);
- }
- if (varying->fsVarying()) {
- fFS.addVarying(varying);
- }
+ SkString* fsInputName = fVS.addVarying(type, name, vsOutName);
+ fFS.addVarying(type, fsInputName->c_str(), fsInName, fsPrecision);
}
void GrGLProgramBuilder::nameVariable(SkString* out, char prefix, const char* name) {
@@ -368,8 +362,9 @@
suffixedVaryingName.appendf("_%i", t);
varyingName = suffixedVaryingName.c_str();
}
- GrGLVertToFrag v(varyingType);
- this->addVarying(varyingName, &v);
+ const char* vsVaryingName;
+ const char* fsVaryingName;
+ this->addVarying(varyingType, varyingName, &vsVaryingName, &fsVaryingName);
const GrGLShaderVar& coords =
kPosition_GrCoordSet == effect->coordTransform(t).sourceCoords() ?
@@ -380,13 +375,13 @@
SkASSERT(kVec2f_GrSLType == varyingType || kVec3f_GrSLType == varyingType);
if (kVec2f_GrSLType == varyingType) {
fVS.codeAppendf("%s = (%s * vec3(%s, 1)).xy;",
- v.vsOut(), uniName, coords.c_str());
+ vsVaryingName, uniName, coords.c_str());
} else {
fVS.codeAppendf("%s = %s * vec3(%s, 1);",
- v.vsOut(), uniName, coords.c_str());
+ vsVaryingName, uniName, coords.c_str());
}
SkNEW_APPEND_TO_TARRAY(outCoords, GrGLProcessor::TransformedCoords,
- (SkString(v.fsIn()), varyingType));
+ (SkString(fsVaryingName), varyingType));
}
}
« no previous file with comments | « src/gpu/gl/builders/GrGLProgramBuilder.h ('k') | src/gpu/gl/builders/GrGLVertexShaderBuilder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698