2 * Copyright 2013 Google Inc.
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
8 #ifndef GrVertexEffect_DEFINED
9 #define GrVertexEffect_DEFINED
14 * If an effect needs specialized vertex shader code, then it must inherit from this class.
15 * Otherwise it won't be able to add vertex attribs, and it might be given a vertexless shader
16 * program in emitCode.
18 class GrVertexEffect : public GrEffect {
20 GrVertexEffect() { fHasVertexCode = true; }
24 * Subclasses call this from their constructor to register vertex attributes (at most
25 * kMaxVertexAttribs). This must only be called from the constructor because GrEffects are
28 void addVertexAttrib(GrSLType type) {
29 SkASSERT(fVertexAttribTypes.count() < kMaxVertexAttribs);
30 fVertexAttribTypes.push_back(type);
34 typedef GrEffect INHERITED;