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

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

Issue 551253004: Changes to remove program effects builder (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rebase Created 6 years, 3 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/GrGLShaderBuilder.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/gl/builders/GrGLVertexShaderBuilder.cpp
diff --git a/src/gpu/gl/builders/GrGLVertexShaderBuilder.cpp b/src/gpu/gl/builders/GrGLVertexShaderBuilder.cpp
index 7445676f5884c5bf4a01110b1579f0e761182a94..9e666ad3da21389483155b20deb3e31c886dfe87 100644
--- a/src/gpu/gl/builders/GrGLVertexShaderBuilder.cpp
+++ b/src/gpu/gl/builders/GrGLVertexShaderBuilder.cpp
@@ -118,9 +118,9 @@ bool GrGLVertexShaderBuilder::compileAndAttachShaders(GrGLuint programId,
fProgramBuilder->appendUniformDecls(GrGLProgramBuilder::kVertex_Visibility, &vertShaderSrc);
fProgramBuilder->appendDecls(fInputs, &vertShaderSrc);
fProgramBuilder->appendDecls(fOutputs, &vertShaderSrc);
- vertShaderSrc.append("void main() {\n");
+ vertShaderSrc.append("void main() {");
vertShaderSrc.append(fCode);
- vertShaderSrc.append("}\n");
+ vertShaderSrc.append("}");
GrGLuint vertShaderId = GrGLCompileAndAttachShader(glCtx, programId,
GR_GL_VERTEX_SHADER, vertShaderSrc);
if (!vertShaderId) {
@@ -140,7 +140,7 @@ void GrGLVertexShaderBuilder::emitCodeAfterEffects() {
// Transform from Skia's device coords to GL's normalized device coords.
this->codeAppendf(
- "\tgl_Position = vec4(dot(pos3.xz, %s.xy), dot(pos3.yz, %s.zw), 0, pos3.z);\n",
+ "gl_Position = vec4(dot(pos3.xz, %s.xy), dot(pos3.yz, %s.zw), 0, pos3.z);",
rtAdjustName, rtAdjustName);
}
@@ -148,12 +148,12 @@ void GrGLVertexShaderBuilder::emitCodeBeforeEffects(GrGLSLExpr4* color, GrGLSLEx
const GrGLProgramDesc::KeyHeader& header = fProgramBuilder->desc().getHeader();
fPositionVar = &fInputs.push_back();
- fPositionVar->set(kVec2f_GrSLType, GrGLShaderVar::kAttribute_TypeModifier, "aPosition");
+ fPositionVar->set(kVec2f_GrSLType, GrGLShaderVar::kAttribute_TypeModifier, "inPosition");
if (-1 != header.fLocalCoordAttributeIndex) {
fLocalCoordsVar = &fInputs.push_back();
fLocalCoordsVar->set(kVec2f_GrSLType,
GrGLShaderVar::kAttribute_TypeModifier,
- "aLocalCoords");
+ "inLocalCoords");
} else {
fLocalCoordsVar = fPositionVar;
}
@@ -166,7 +166,7 @@ void GrGLVertexShaderBuilder::emitCodeBeforeEffects(GrGLSLExpr4* color, GrGLSLEx
&viewMName);
// Transform the position into Skia's device coords.
- this->codeAppendf("\tvec3 pos3 = %s * vec3(%s, 1);\n",
+ this->codeAppendf("vec3 pos3 = %s * vec3(%s, 1);",
viewMName, fPositionVar->c_str());
// we output point size in the GS if present
@@ -175,7 +175,7 @@ void GrGLVertexShaderBuilder::emitCodeBeforeEffects(GrGLSLExpr4* color, GrGLSLEx
&& !header.fExperimentalGS
#endif
) {
- this->codeAppend("\tgl_PointSize = 1.0;\n");
+ this->codeAppend("gl_PointSize = 1.0;");
}
if (GrGLProgramDesc::kAttribute_ColorInput == header.fColorInput) {
@@ -184,7 +184,7 @@ void GrGLVertexShaderBuilder::emitCodeBeforeEffects(GrGLSLExpr4* color, GrGLSLEx
GrShaderVar::kAttribute_TypeModifier));
const char *vsName, *fsName;
fFullProgramBuilder->addVarying(kVec4f_GrSLType, "Color", &vsName, &fsName);
- this->codeAppendf("\t%s = %s;\n", vsName, color_attribute_name());
+ this->codeAppendf("%s = %s;", vsName, color_attribute_name());
*color = fsName;
}
@@ -194,7 +194,7 @@ void GrGLVertexShaderBuilder::emitCodeBeforeEffects(GrGLSLExpr4* color, GrGLSLEx
GrShaderVar::kAttribute_TypeModifier));
const char *vsName, *fsName;
fFullProgramBuilder->addVarying(kVec4f_GrSLType, "Coverage", &vsName, &fsName);
- this->codeAppendf("\t%s = %s;\n", vsName, coverage_attribute_name());
+ this->codeAppendf("%s = %s;", vsName, coverage_attribute_name());
*coverage = fsName;
}
fEffectAttribOffset = fInputs.count();
« no previous file with comments | « src/gpu/gl/builders/GrGLShaderBuilder.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698