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

Side by Side Diff: src/gpu/glsl/GrGLSLGeometryProcessor.cpp

Issue 2338453002: Remove unused GrGLSLGeometryProcessor::emitTransform variation (Closed)
Patch Set: Created 4 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 unified diff | Download patch
« no previous file with comments | « src/gpu/glsl/GrGLSLGeometryProcessor.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2014 Google Inc. 2 * Copyright 2014 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "GrGLSLGeometryProcessor.h" 8 #include "GrGLSLGeometryProcessor.h"
9 9
10 #include "GrCoordTransform.h" 10 #include "GrCoordTransform.h"
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 if (kVec2f_GrSLType == varyingType) { 89 if (kVec2f_GrSLType == varyingType) {
90 vb->codeAppendf("%s = (%s * vec3(%s, 1)).xy;", v.vsOut(), un iName, localCoords); 90 vb->codeAppendf("%s = (%s * vec3(%s, 1)).xy;", v.vsOut(), un iName, localCoords);
91 } else { 91 } else {
92 vb->codeAppendf("%s = %s * vec3(%s, 1);", v.vsOut(), uniName , localCoords); 92 vb->codeAppendf("%s = %s * vec3(%s, 1);", v.vsOut(), uniName , localCoords);
93 } 93 }
94 } 94 }
95 } 95 }
96 } 96 }
97 } 97 }
98 98
99 void GrGLSLGeometryProcessor::emitTransforms(GrGLSLVertexBuilder* vb,
100 GrGLSLVaryingHandler* varyingHandle r,
101 const char* localCoords,
102 const TransformsIn& tin,
103 TransformsOut* tout) {
104 tout->push_back_n(tin.count());
105 for (int i = 0; i < tin.count(); i++) {
106 const ProcCoords& coordTransforms = tin[i];
107 for (int t = 0; t < coordTransforms.count(); t++) {
108 GrSLType varyingType = kVec2f_GrSLType;
109
110 // Device coords aren't supported
111 SkASSERT(kDevice_GrCoordSet != coordTransforms[t]->sourceCoords());
112 GrSLPrecision precision = coordTransforms[t]->precision();
113
114 SkString strVaryingName("MatrixCoord");
115 strVaryingName.appendf("_%i_%i", i, t);
116
117 GrGLSLVertToFrag v(varyingType);
118 varyingHandler->addVarying(strVaryingName.c_str(), &v, precision);
119 vb->codeAppendf("%s = %s;", v.vsOut(), localCoords);
120
121 (*tout)[i].emplace_back(SkString(v.fsIn()), varyingType);
122 }
123 }
124 }
125
126 void GrGLSLGeometryProcessor::setupPosition(GrGLSLVertexBuilder* vertBuilder, 99 void GrGLSLGeometryProcessor::setupPosition(GrGLSLVertexBuilder* vertBuilder,
127 GrGPArgs* gpArgs, 100 GrGPArgs* gpArgs,
128 const char* posName) { 101 const char* posName) {
129 gpArgs->fPositionVar.set(kVec2f_GrSLType, "pos2"); 102 gpArgs->fPositionVar.set(kVec2f_GrSLType, "pos2");
130 vertBuilder->codeAppendf("vec2 %s = %s;", gpArgs->fPositionVar.c_str(), posN ame); 103 vertBuilder->codeAppendf("vec2 %s = %s;", gpArgs->fPositionVar.c_str(), posN ame);
131 } 104 }
132 105
133 void GrGLSLGeometryProcessor::setupPosition(GrGLSLVertexBuilder* vertBuilder, 106 void GrGLSLGeometryProcessor::setupPosition(GrGLSLVertexBuilder* vertBuilder,
134 GrGLSLUniformHandler* uniformHandler , 107 GrGLSLUniformHandler* uniformHandler ,
135 GrGPArgs* gpArgs, 108 GrGPArgs* gpArgs,
(...skipping 13 matching lines...) Expand all
149 gpArgs->fPositionVar.set(kVec2f_GrSLType, "pos2"); 122 gpArgs->fPositionVar.set(kVec2f_GrSLType, "pos2");
150 vertBuilder->codeAppendf("vec2 %s = vec2(%s * vec3(%s, 1));", 123 vertBuilder->codeAppendf("vec2 %s = vec2(%s * vec3(%s, 1));",
151 gpArgs->fPositionVar.c_str(), viewMatrixNam e, posName); 124 gpArgs->fPositionVar.c_str(), viewMatrixNam e, posName);
152 } else { 125 } else {
153 gpArgs->fPositionVar.set(kVec3f_GrSLType, "pos3"); 126 gpArgs->fPositionVar.set(kVec3f_GrSLType, "pos3");
154 vertBuilder->codeAppendf("vec3 %s = %s * vec3(%s, 1);", 127 vertBuilder->codeAppendf("vec3 %s = %s * vec3(%s, 1);",
155 gpArgs->fPositionVar.c_str(), viewMatrixNam e, posName); 128 gpArgs->fPositionVar.c_str(), viewMatrixNam e, posName);
156 } 129 }
157 } 130 }
158 } 131 }
OLDNEW
« no previous file with comments | « src/gpu/glsl/GrGLSLGeometryProcessor.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698