OLD | NEW |
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 GrPrimitiveProcessor_DEFINED | 8 #ifndef GrPrimitiveProcessor_DEFINED |
9 #define GrPrimitiveProcessor_DEFINED | 9 #define GrPrimitiveProcessor_DEFINED |
10 | 10 |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
148 class GrPrimitiveProcessor : public GrProcessor { | 148 class GrPrimitiveProcessor : public GrProcessor { |
149 public: | 149 public: |
150 // Only the GrGeometryProcessor subclass actually has a geo shader or vertex
attributes, but | 150 // Only the GrGeometryProcessor subclass actually has a geo shader or vertex
attributes, but |
151 // we put these calls on the base class to prevent having to cast | 151 // we put these calls on the base class to prevent having to cast |
152 virtual bool willUseGeoShader() const = 0; | 152 virtual bool willUseGeoShader() const = 0; |
153 | 153 |
154 /* | 154 /* |
155 * This is a safeguard to prevent GrPrimitiveProcessor's from going beyond p
latform specific | 155 * This is a safeguard to prevent GrPrimitiveProcessor's from going beyond p
latform specific |
156 * attribute limits. This number can almost certainly be raised if required. | 156 * attribute limits. This number can almost certainly be raised if required. |
157 */ | 157 */ |
158 static const int kMaxVertexAttribs = 6; | 158 static const int kMaxVertexAttribs = 8; |
159 | 159 |
160 struct Attribute { | 160 struct Attribute { |
161 Attribute() | 161 Attribute() |
162 : fName(nullptr) | 162 : fName(nullptr) |
163 , fType(kFloat_GrVertexAttribType) | 163 , fType(kFloat_GrVertexAttribType) |
164 , fOffset(0) {} | 164 , fOffset(0) {} |
165 Attribute(const char* name, GrVertexAttribType type, | 165 Attribute(const char* name, GrVertexAttribType type, |
166 GrSLPrecision precision = kDefault_GrSLPrecision) | 166 GrSLPrecision precision = kDefault_GrSLPrecision) |
167 : fName(name) | 167 : fName(name) |
168 , fType(type) | 168 , fType(type) |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
236 size_t fVertexStride; | 236 size_t fVertexStride; |
237 | 237 |
238 private: | 238 private: |
239 void notifyRefCntIsZero() const final {}; | 239 void notifyRefCntIsZero() const final {}; |
240 virtual bool hasExplicitLocalCoords() const = 0; | 240 virtual bool hasExplicitLocalCoords() const = 0; |
241 | 241 |
242 typedef GrProcessor INHERITED; | 242 typedef GrProcessor INHERITED; |
243 }; | 243 }; |
244 | 244 |
245 #endif | 245 #endif |
OLD | NEW |