blob: 2433a70e771b07cc47164db25d39dad8cf897693 [file] [log] [blame]
joshualitt8072caa2015-02-12 14:20:52 -08001/*
2 * Copyright 2014 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
Mike Kleinc0bd9f92019-04-23 12:05:21 -05008#include "src/gpu/glsl/GrGLSLGeometryProcessor.h"
joshualitt8072caa2015-02-12 14:20:52 -08009
Mike Kleinc0bd9f92019-04-23 12:05:21 -050010#include "src/gpu/GrCoordTransform.h"
Ethan Nicholas58430122020-04-14 09:54:02 -040011#include "src/gpu/GrPipeline.h"
Mike Kleinc0bd9f92019-04-23 12:05:21 -050012#include "src/gpu/glsl/GrGLSLFragmentShaderBuilder.h"
13#include "src/gpu/glsl/GrGLSLUniformHandler.h"
14#include "src/gpu/glsl/GrGLSLVarying.h"
15#include "src/gpu/glsl/GrGLSLVertexGeoBuilder.h"
joshualitt8072caa2015-02-12 14:20:52 -080016
Ethan Nicholasd3a95c22020-06-03 13:24:46 -040017#include <unordered_map>
18
egdaniele659a582015-11-13 09:55:43 -080019void GrGLSLGeometryProcessor::emitCode(EmitArgs& args) {
joshualitt8072caa2015-02-12 14:20:52 -080020 GrGPArgs gpArgs;
21 this->onEmitCode(args, &gpArgs);
Chris Daltonc17bf322017-10-24 10:59:03 -060022
Michael Ludwige7e25ac2020-06-26 12:53:03 -040023 if (gpArgs.fLocalCoordVar.getType() != kVoid_GrSLType) {
24 this->collectTransforms(args.fVertBuilder, args.fVaryingHandler, args.fUniformHandler,
25 gpArgs.fLocalCoordVar, args.fFPCoordTransformHandler);
26 }
Michael Ludwig553db622020-06-19 10:47:30 -040027
Chris Dalton5a2f9622019-12-27 14:56:38 -070028 if (args.fGP.willUseTessellationShaders()) {
29 // Tessellation shaders are temporarily responsible for integrating their own code strings
30 // while we work out full support.
31 return;
32 }
33
Chris Daltonc17bf322017-10-24 10:59:03 -060034 GrGLSLVertexBuilder* vBuilder = args.fVertBuilder;
35 if (!args.fGP.willUseGeoShader()) {
36 // Emit the vertex position to the hardware in the normalized window coordinates it expects.
Chris Dalton23261772017-12-10 16:41:45 -070037 SkASSERT(kFloat2_GrSLType == gpArgs.fPositionVar.getType() ||
38 kFloat3_GrSLType == gpArgs.fPositionVar.getType());
Chris Daltonc17bf322017-10-24 10:59:03 -060039 vBuilder->emitNormalizedSkPosition(gpArgs.fPositionVar.c_str(), args.fRTAdjustName,
40 gpArgs.fPositionVar.getType());
Chris Dalton23261772017-12-10 16:41:45 -070041 if (kFloat2_GrSLType == gpArgs.fPositionVar.getType()) {
42 args.fVaryingHandler->setNoPerspective();
43 }
Chris Daltonc17bf322017-10-24 10:59:03 -060044 } else {
45 // Since we have a geometry shader, leave the vertex position in Skia device space for now.
46 // The geometry Shader will operate in device space, and then convert the final positions to
47 // normalized hardware window coordinates under the hood, once everything else has finished.
Chris Dalton23261772017-12-10 16:41:45 -070048 // The subclass must call setNoPerspective on the varying handler, if applicable.
Chris Daltonc17bf322017-10-24 10:59:03 -060049 vBuilder->codeAppendf("sk_Position = float4(%s", gpArgs.fPositionVar.c_str());
Chris Dalton23261772017-12-10 16:41:45 -070050 switch (gpArgs.fPositionVar.getType()) {
51 case kFloat_GrSLType:
John Stiles30212b72020-06-11 17:55:07 -040052 vBuilder->codeAppend(", 0");
53 [[fallthrough]];
Chris Dalton23261772017-12-10 16:41:45 -070054 case kFloat2_GrSLType:
John Stiles30212b72020-06-11 17:55:07 -040055 vBuilder->codeAppend(", 0");
56 [[fallthrough]];
Chris Dalton23261772017-12-10 16:41:45 -070057 case kFloat3_GrSLType:
John Stiles30212b72020-06-11 17:55:07 -040058 vBuilder->codeAppend(", 1");
59 [[fallthrough]];
Chris Dalton23261772017-12-10 16:41:45 -070060 case kFloat4_GrSLType:
61 vBuilder->codeAppend(");");
62 break;
63 default:
64 SK_ABORT("Invalid position var type");
65 break;
Chris Daltonc17bf322017-10-24 10:59:03 -060066 }
cdaltonc08f1962016-02-12 12:14:06 -080067 }
joshualitt8072caa2015-02-12 14:20:52 -080068}
69
Michael Ludwig553db622020-06-19 10:47:30 -040070void GrGLSLGeometryProcessor::collectTransforms(GrGLSLVertexBuilder* vb,
71 GrGLSLVaryingHandler* varyingHandler,
72 GrGLSLUniformHandler* uniformHandler,
73 const GrShaderVar& localCoordsVar,
74 FPCoordTransformHandler* handler) {
Michael Ludwige88320b2020-06-24 09:04:56 -040075 SkASSERT(localCoordsVar.getType() == kFloat2_GrSLType ||
Michael Ludwige7e25ac2020-06-26 12:53:03 -040076 localCoordsVar.getType() == kFloat3_GrSLType);
Michael Ludwige88320b2020-06-24 09:04:56 -040077 // Cached varyings produced by parent FPs. If parent FPs introduce transformations, but all
78 // subsequent children are not transformed, they should share the same varying.
79 std::unordered_map<const GrFragmentProcessor*, GrShaderVar> localCoordsMap;
80
81 GrGLSLVarying baseLocalCoord;
82 auto getBaseLocalCoord = [&baseLocalCoord, &localCoordsVar, vb, varyingHandler]() {
83 SkASSERT(GrSLTypeIsFloatType(localCoordsVar.getType()));
84 if (baseLocalCoord.type() == kVoid_GrSLType) {
85 // Initialize to the GP provided coordinate
86 SkString baseLocalCoordName = SkStringPrintf("LocalCoord");
87 baseLocalCoord = GrGLSLVarying(localCoordsVar.getType());
88 varyingHandler->addVarying(baseLocalCoordName.c_str(), &baseLocalCoord);
89 vb->codeAppendf("%s = %s;\n", baseLocalCoord.vsOut(),
90 localCoordsVar.getName().c_str());
Brian Salomon706851d2020-02-20 14:18:00 -050091 }
Michael Ludwige88320b2020-06-24 09:04:56 -040092 return GrShaderVar(SkString(baseLocalCoord.fsIn()), baseLocalCoord.type(),
93 GrShaderVar::TypeModifier::In);
Brian Salomon706851d2020-02-20 14:18:00 -050094 };
Brian Salomon04460cc2017-12-06 14:47:42 -050095
Brian Salomon7d8b3972019-11-26 22:34:44 -050096 for (int i = 0; *handler; ++*handler, ++i) {
97 auto [coordTransform, fp] = handler->get();
Michael Ludwige7e25ac2020-06-26 12:53:03 -040098 // FIXME: GrCoordTransform is used solely as a vehicle for iterating over all FPs that
99 // require sample coordinates directly. We should make this iteration lighter weight.
100 SkASSERT(coordTransform.isNoOp());
Michael Ludwige88320b2020-06-24 09:04:56 -0400101
Michael Ludwige88320b2020-06-24 09:04:56 -0400102 // FPs that use local coordinates need a varying to convey the coordinate. This may be the
103 // base GP's local coord if transforms have to be computed in the FS, or it may be a unique
104 // varying that computes the equivalent transformation hierarchy in the VS.
105 GrShaderVar varyingVar;
106
Michael Ludwige88320b2020-06-24 09:04:56 -0400107 // If the FP references local coords, we need to make sure the vertex shader sets up the
108 // right transforms or pass-through variables for the FP to evaluate in the fragment shader
109 if (fp.referencesSampleCoords()) {
Michael Ludwige7e25ac2020-06-26 12:53:03 -0400110 if (fp.isSampledWithExplicitCoords()) {
Michael Ludwige88320b2020-06-24 09:04:56 -0400111 // If the FP local coords are evaluated in the fragment shader, we only need to
112 // produce the original local coordinate to pass into the root; any other situation,
113 // the FP will have a 2nd parameter to its function and the caller sends the coords
114 if (!fp.parent()) {
115 varyingVar = getBaseLocalCoord();
116 }
117 } else {
118 // The FP's local coordinates are determined by the const/uniform transform
119 // hierarchy from this FP to the root, and can be computed in the vertex shader.
120 // If this hierarchy would be the identity transform, then we should use the
121 // original local coordinate.
122 // NOTE: The actual transform logic is handled in emitTransformCode(), this just
123 // needs to determine if a unique varying should be added for the FP.
124 GrShaderVar transformedLocalCoord;
125 const GrFragmentProcessor* coordOwner = nullptr;
Brian Salomon7eabfe82019-12-02 14:20:20 -0500126
Michael Ludwige88320b2020-06-24 09:04:56 -0400127 const GrFragmentProcessor* node = &fp;
128 while(node) {
129 SkASSERT(!node->isSampledWithExplicitCoords() &&
130 (node->sampleMatrix().isNoOp() ||
131 node->sampleMatrix().isConstUniform()));
132
133 if (node->sampleMatrix().isConstUniform()) {
134 // We can stop once we hit an FP that adds transforms; this FP can reuse
135 // that FPs varying (possibly vivifying it if this was the first use).
136 transformedLocalCoord = localCoordsMap[node];
137 coordOwner = node;
138 break;
139 } // else intervening FP is an identity transform so skip past it
140
141 node = node->parent();
142 }
143
Michael Ludwige88320b2020-06-24 09:04:56 -0400144 if (coordOwner) {
145 // The FP will use coordOwner's varying; add varying if this was the first use
146 if (transformedLocalCoord.getType() == kVoid_GrSLType) {
147 GrGLSLVarying v(kFloat2_GrSLType);
Michael Ludwige7e25ac2020-06-26 12:53:03 -0400148 if (GrSLTypeVecLength(localCoordsVar.getType()) == 3 ||
Michael Ludwige88320b2020-06-24 09:04:56 -0400149 coordOwner->hasPerspectiveTransform()) {
150 v = GrGLSLVarying(kFloat3_GrSLType);
151 }
152 SkString strVaryingName;
153 strVaryingName.printf("TransformedCoords_%d", i);
154 varyingHandler->addVarying(strVaryingName.c_str(), &v);
155
156 fTransformInfos.push_back({GrShaderVar(v.vsOut(), v.type()),
Michael Ludwige88320b2020-06-24 09:04:56 -0400157 localCoordsVar,
158 coordOwner});
159 transformedLocalCoord = GrShaderVar(SkString(v.fsIn()), v.type(),
160 GrShaderVar::TypeModifier::In);
Michael Ludwige7e25ac2020-06-26 12:53:03 -0400161 localCoordsMap[coordOwner] = transformedLocalCoord;
Michael Ludwige88320b2020-06-24 09:04:56 -0400162 }
163
164 varyingVar = transformedLocalCoord;
Ethan Nicholasbffad832020-05-05 14:31:55 -0400165 } else {
Michael Ludwige88320b2020-06-24 09:04:56 -0400166 // The FP transform hierarchy is the identity, so use the original local coord
167 varyingVar = getBaseLocalCoord();
Ethan Nicholasbffad832020-05-05 14:31:55 -0400168 }
Brian Salomon7eabfe82019-12-02 14:20:20 -0500169 }
joshualitt8072caa2015-02-12 14:20:52 -0800170 }
Michael Ludwige88320b2020-06-24 09:04:56 -0400171
Michael Ludwige7e25ac2020-06-26 12:53:03 -0400172 if (varyingVar.getType() != kVoid_GrSLType) {
173 handler->specifyCoordsForCurrCoordTransform(GrShaderVar(), varyingVar);
Michael Ludwige88320b2020-06-24 09:04:56 -0400174 } else {
175 handler->omitCoordsForCurrCoordTransform();
176 }
Michael Ludwige7e25ac2020-06-26 12:53:03 -0400177 // Must stay parallel with calls to handler
178 fInstalledTransforms.push_back();
Ethan Nicholas58430122020-04-14 09:54:02 -0400179 }
180}
181
182void GrGLSLGeometryProcessor::emitTransformCode(GrGLSLVertexBuilder* vb,
183 GrGLSLUniformHandler* uniformHandler) {
Michael Ludwige88320b2020-06-24 09:04:56 -0400184 std::unordered_map<const GrFragmentProcessor*, GrShaderVar> localCoordsMap;
Ethan Nicholas58430122020-04-14 09:54:02 -0400185 for (const auto& tr : fTransformInfos) {
Michael Ludwige7e25ac2020-06-26 12:53:03 -0400186 // If we recorded a transform info, its sample matrix must be const/uniform
187 SkASSERT(tr.fFP->sampleMatrix().isConstUniform());
Michael Ludwige88320b2020-06-24 09:04:56 -0400188
189 SkString localCoords;
190 // Build a concatenated matrix expression that we apply to the root local coord.
191 // If we have an expression cached from an early FP in the hierarchy chain, we can stop
192 // there instead of going all the way to the GP.
193 SkString transformExpression;
Michael Ludwige88320b2020-06-24 09:04:56 -0400194
Michael Ludwige7e25ac2020-06-26 12:53:03 -0400195 const auto* base = tr.fFP;
196 while(base) {
197 GrShaderVar cachedBaseCoord = localCoordsMap[base];
198 if (cachedBaseCoord.getType() != kVoid_GrSLType) {
199 // Can stop here, as this varying already holds all transforms from higher FPs
200 if (cachedBaseCoord.getType() == kFloat3_GrSLType) {
201 localCoords = cachedBaseCoord.getName();
Ethan Nicholasd3a95c22020-06-03 13:24:46 -0400202 } else {
Michael Ludwige7e25ac2020-06-26 12:53:03 -0400203 localCoords = SkStringPrintf("%s.xy1", cachedBaseCoord.getName().c_str());
204 }
205 break;
206 } else if (base->sampleMatrix().isConstUniform()) {
207 // The FP knows the matrix expression it's sampled with, but its parent defined
208 // the uniform (when the expression is not a constant).
209 GrShaderVar uniform = uniformHandler->liftUniformToVertexShader(
210 *base->parent(), SkString(base->sampleMatrix().fExpression));
211
212 // Accumulate the base matrix expression as a preConcat
213 SkString matrix;
214 if (uniform.getType() != kVoid_GrSLType) {
215 SkASSERT(uniform.getType() == kFloat3x3_GrSLType);
216 matrix = uniform.getName();
217 } else {
218 // No uniform found, so presumably this is a constant
219 matrix = SkString(base->sampleMatrix().fExpression);
Ethan Nicholasd3a95c22020-06-03 13:24:46 -0400220 }
Michael Ludwige88320b2020-06-24 09:04:56 -0400221
Michael Ludwige7e25ac2020-06-26 12:53:03 -0400222 if (!transformExpression.isEmpty()) {
223 transformExpression.append(" * ");
224 }
225 transformExpression.appendf("(%s)", matrix.c_str());
226 } else {
227 // This intermediate FP is just a pass through and doesn't need to be built
228 // in to the expression, but must visit its parents in case they add transforms
229 SkASSERT(base->sampleMatrix().isNoOp());
Ethan Nicholasd3a95c22020-06-03 13:24:46 -0400230 }
Michael Ludwige7e25ac2020-06-26 12:53:03 -0400231
232 base = base->parent();
Michael Ludwige88320b2020-06-24 09:04:56 -0400233 }
234
235 if (localCoords.isEmpty()) {
236 // Must use GP's local coords
237 if (tr.fLocalCoords.getType() == kFloat3_GrSLType) {
238 localCoords = tr.fLocalCoords.getName();
239 } else {
240 localCoords = SkStringPrintf("%s.xy1", tr.fLocalCoords.getName().c_str());
241 }
242 }
243
244 vb->codeAppend("{\n");
245 if (tr.fOutputCoords.getType() == kFloat2_GrSLType) {
246 vb->codeAppendf("%s = ((%s) * %s).xy", tr.fOutputCoords.getName().c_str(),
247 transformExpression.c_str(),
248 localCoords.c_str());
249 } else {
250 SkASSERT(tr.fOutputCoords.getType() == kFloat3_GrSLType);
251 vb->codeAppendf("%s = (%s) * %s", tr.fOutputCoords.getName().c_str(),
252 transformExpression.c_str(),
253 localCoords.c_str());
254 }
255 vb->codeAppend(";\n");
256 vb->codeAppend("}\n");
257
Michael Ludwige7e25ac2020-06-26 12:53:03 -0400258 localCoordsMap.insert({ tr.fFP, tr.fOutputCoords });
joshualitt8072caa2015-02-12 14:20:52 -0800259 }
260}
261
Michael Ludwig553db622020-06-19 10:47:30 -0400262void GrGLSLGeometryProcessor::setTransformDataHelper(const GrGLSLProgramDataManager& pdman,
Brian Salomonc241b582019-11-27 08:57:17 -0500263 const CoordTransformRange& transformRange) {
bsalomona624bf32016-09-20 09:12:47 -0700264 int i = 0;
Brian Salomonc241b582019-11-27 08:57:17 -0500265 for (auto [transform, fp] : transformRange) {
Brian Salomon7eabfe82019-12-02 14:20:20 -0500266 if (fInstalledTransforms[i].fHandle.isValid()) {
Michael Ludwig553db622020-06-19 10:47:30 -0400267 SkMatrix m = GetTransformMatrix(transform, SkMatrix::I());
Mike Reed2c383152019-12-18 16:47:47 -0500268 if (!SkMatrixPriv::CheapEqual(fInstalledTransforms[i].fCurrentValue, m)) {
Brian Salomon8d1dcd72020-03-20 21:06:41 -0400269 if (fInstalledTransforms[i].fType == kFloat4_GrSLType) {
270 float values[4] = {m.getScaleX(), m.getTranslateX(),
271 m.getScaleY(), m.getTranslateY()};
Brian Salomon14ed8852020-03-24 10:43:38 -0400272 SkASSERT(m.isScaleTranslate());
Brian Salomon8d1dcd72020-03-20 21:06:41 -0400273 pdman.set4fv(fInstalledTransforms[i].fHandle.toIndex(), 1, values);
274 } else {
Brian Salomon14ed8852020-03-24 10:43:38 -0400275 SkASSERT(!m.isScaleTranslate() || !fp.isSampledWithExplicitCoords());
Brian Salomon8d1dcd72020-03-20 21:06:41 -0400276 SkASSERT(fInstalledTransforms[i].fType == kFloat3x3_GrSLType);
277 pdman.setSkMatrix(fInstalledTransforms[i].fHandle.toIndex(), m);
278 }
Brian Salomon7eabfe82019-12-02 14:20:20 -0500279 fInstalledTransforms[i].fCurrentValue = m;
280 }
bsalomona624bf32016-09-20 09:12:47 -0700281 }
282 ++i;
283 }
284 SkASSERT(i == fInstalledTransforms.count());
285}
286
Michael Ludwig553db622020-06-19 10:47:30 -0400287void GrGLSLGeometryProcessor::setTransform(const GrGLSLProgramDataManager& pdman,
288 const UniformHandle& uniform,
289 const SkMatrix& matrix,
290 SkMatrix* state) const {
291 if (!uniform.isValid() || (state && SkMatrixPriv::CheapEqual(*state, matrix))) {
292 // No update needed
293 return;
294 }
295 if (state) {
296 *state = matrix;
297 }
298 if (matrix.isScaleTranslate()) {
299 // ComputeMatrixKey and writeX() assume the uniform is a float4 (can't assert since nothing
300 // is exposed on a handle, but should be caught lower down).
301 float values[4] = {matrix.getScaleX(), matrix.getTranslateX(),
302 matrix.getScaleY(), matrix.getTranslateY()};
303 pdman.set4fv(uniform, 1, values);
304 } else {
305 pdman.setSkMatrix(uniform, matrix);
306 }
307}
308
309static void write_vertex_position(GrGLSLVertexBuilder* vertBuilder,
310 GrGLSLUniformHandler* uniformHandler,
311 const GrShaderVar& inPos,
312 const SkMatrix& matrix,
313 const char* matrixName,
314 GrShaderVar* outPos,
315 GrGLSLGeometryProcessor::UniformHandle* matrixUniform) {
316 SkASSERT(inPos.getType() == kFloat3_GrSLType || inPos.getType() == kFloat2_GrSLType);
317 SkString outName = vertBuilder->newTmpVarName(inPos.getName().c_str());
318
319 if (matrix.isIdentity()) {
320 // Direct assignment, we won't use a uniform for the matrix.
321 outPos->set(inPos.getType(), outName.c_str());
322 vertBuilder->codeAppendf("float%d %s = %s;", GrSLTypeVecLength(inPos.getType()),
323 outName.c_str(), inPos.getName().c_str());
324 } else {
325 SkASSERT(matrixUniform);
326
327 bool useCompactTransform = matrix.isScaleTranslate();
328 const char* mangledMatrixName;
329 *matrixUniform = uniformHandler->addUniform(nullptr,
330 kVertex_GrShaderFlag,
331 useCompactTransform ? kFloat4_GrSLType
332 : kFloat3x3_GrSLType,
333 matrixName,
334 &mangledMatrixName);
335
336 if (inPos.getType() == kFloat3_GrSLType) {
337 // A float3 stays a float3 whether or not the matrix adds perspective
338 if (useCompactTransform) {
339 vertBuilder->codeAppendf("float3 %s = %s.xz1 * %s + %s.yw0;\n",
340 outName.c_str(), mangledMatrixName,
341 inPos.getName().c_str(), mangledMatrixName);
342 } else {
343 vertBuilder->codeAppendf("float3 %s = %s * %s;\n", outName.c_str(),
344 mangledMatrixName, inPos.getName().c_str());
345 }
346 outPos->set(kFloat3_GrSLType, outName.c_str());
347 } else if (matrix.hasPerspective()) {
348 // A float2 is promoted to a float3 if we add perspective via the matrix
349 SkASSERT(!useCompactTransform);
350 vertBuilder->codeAppendf("float3 %s = (%s * %s.xy1);",
351 outName.c_str(), mangledMatrixName, inPos.getName().c_str());
352 outPos->set(kFloat3_GrSLType, outName.c_str());
353 } else {
354 if (useCompactTransform) {
355 vertBuilder->codeAppendf("float2 %s = %s.xz * %s + %s.yw;\n",
356 outName.c_str(), mangledMatrixName,
357 inPos.getName().c_str(), mangledMatrixName);
358 } else {
359 vertBuilder->codeAppendf("float2 %s = (%s * %s.xy1).xy;\n",
360 outName.c_str(), mangledMatrixName,
361 inPos.getName().c_str());
362 }
363 outPos->set(kFloat2_GrSLType, outName.c_str());
364 }
365 }
366}
367
Brian Salomon7f235432017-08-16 09:41:48 -0400368void GrGLSLGeometryProcessor::writeOutputPosition(GrGLSLVertexBuilder* vertBuilder,
369 GrGPArgs* gpArgs,
370 const char* posName) {
Michael Ludwig553db622020-06-19 10:47:30 -0400371 // writeOutputPosition assumes the incoming pos name points to a float2 variable
372 GrShaderVar inPos(posName, kFloat2_GrSLType);
373 write_vertex_position(vertBuilder, nullptr, inPos, SkMatrix::I(), "viewMatrix",
374 &gpArgs->fPositionVar, nullptr);
joshualitt5559ca22015-05-21 15:50:36 -0700375}
376
Brian Salomon7f235432017-08-16 09:41:48 -0400377void GrGLSLGeometryProcessor::writeOutputPosition(GrGLSLVertexBuilder* vertBuilder,
378 GrGLSLUniformHandler* uniformHandler,
379 GrGPArgs* gpArgs,
380 const char* posName,
381 const SkMatrix& mat,
382 UniformHandle* viewMatrixUniform) {
Michael Ludwig553db622020-06-19 10:47:30 -0400383 GrShaderVar inPos(posName, kFloat2_GrSLType);
384 write_vertex_position(vertBuilder, uniformHandler, inPos, mat, "viewMatrix",
385 &gpArgs->fPositionVar, viewMatrixUniform);
386}
387
388void GrGLSLGeometryProcessor::writeLocalCoord(GrGLSLVertexBuilder* vertBuilder,
389 GrGLSLUniformHandler* uniformHandler,
390 GrGPArgs* gpArgs,
391 GrShaderVar localVar,
392 const SkMatrix& localMatrix,
393 UniformHandle* localMatrixUniform) {
394 write_vertex_position(vertBuilder, uniformHandler, localVar, localMatrix, "localMatrix",
395 &gpArgs->fLocalCoordVar, localMatrixUniform);
joshualitt8072caa2015-02-12 14:20:52 -0800396}