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

Side by Side Diff: src/gpu/effects/GrGeometryProcessor.h

Issue 543623004: Removing vertex attrib indices (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: cleanup 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright 2013 Google Inc. 2 * Copyright 2013 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 #ifndef GrVertexEffect_DEFINED 8 #ifndef GrGeometryProcessor_DEFINED
9 #define GrVertexEffect_DEFINED 9 #define GrGeometryProcessor_DEFINED
10 10
11 #include "GrEffect.h" 11 #include "GrEffect.h"
12 12
13 /** 13 /**
14 * If an effect needs specialized vertex shader code, then it must inherit from this class. 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 ver texless shader 15 * Otherwise it won't be able to add vertex attribs, and it might be given a ver texless shader
16 * program in emitCode. 16 * program in emitCode.
17 */ 17 */
18 class GrVertexEffect : public GrEffect { 18 class GrGeometryProcessor : public GrEffect {
19 public: 19 public:
20 GrVertexEffect() { fRequiresVertexShader = true; } 20 GrGeometryProcessor() { fRequiresVertexShader = true; }
21 21
22 protected: 22 protected:
23 /** 23 /**
24 * Subclasses call this from their constructor to register vertex attributes (at most 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 25 * kMaxVertexAttribs). This must only be called from the constructor because GrEffects are
26 * immutable. 26 * immutable.
27 */ 27 */
28 void addVertexAttrib(GrSLType type) { 28 void addVertexAttrib(const GrShaderVar& var) {
29 SkASSERT(fVertexAttribTypes.count() < kMaxVertexAttribs); 29 fVertexAttribs.push_back(var);
30 fVertexAttribTypes.push_back(type);
31 } 30 }
32 31
33 private: 32 private:
34 typedef GrEffect INHERITED; 33 typedef GrEffect INHERITED;
35 }; 34 };
36 35
37 #endif 36 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698