}
}
-void GrGLSLGeometryProcessor::emitTransforms(GrGLSLVertexBuilder* vb,
- GrGLSLVaryingHandler* varyingHandler,
- const char* localCoords,
- const TransformsIn& tin,
- TransformsOut* tout) {
- tout->push_back_n(tin.count());
- for (int i = 0; i < tin.count(); i++) {
- const ProcCoords& coordTransforms = tin[i];
- for (int t = 0; t < coordTransforms.count(); t++) {
- GrSLType varyingType = kVec2f_GrSLType;
-
- // Device coords aren't supported
- SkASSERT(kDevice_GrCoordSet != coordTransforms[t]->sourceCoords());
- GrSLPrecision precision = coordTransforms[t]->precision();
-
- SkString strVaryingName("MatrixCoord");
- strVaryingName.appendf("_%i_%i", i, t);
-
- GrGLSLVertToFrag v(varyingType);
- varyingHandler->addVarying(strVaryingName.c_str(), &v, precision);
- vb->codeAppendf("%s = %s;", v.vsOut(), localCoords);
-
- (*tout)[i].emplace_back(SkString(v.fsIn()), varyingType);
- }
- }
-}
-
void GrGLSLGeometryProcessor::setupPosition(GrGLSLVertexBuilder* vertBuilder,
GrGPArgs* gpArgs,
const char* posName) {
const TransformsIn&,
TransformsOut*);
- // caller has emitted transforms via attributes
- void emitTransforms(GrGLSLVertexBuilder*,
- GrGLSLVaryingHandler*,
- const char* localCoords,
- const TransformsIn& tin,
- TransformsOut* tout);
-
struct GrGPArgs {
// The variable used by a GP to store its position. It can be
// either a vec2 or a vec3 depending on the presence of perspective.