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 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 struct Attribute { | 154 struct Attribute { |
155 Attribute() | 155 Attribute() |
156 : fName(nullptr) | 156 : fName(nullptr) |
157 , fType(kFloat_GrVertexAttribType) | 157 , fType(kFloat_GrVertexAttribType) |
158 , fOffset(0) {} | 158 , fOffset(0) {} |
159 Attribute(const char* name, GrVertexAttribType type, | 159 Attribute(const char* name, GrVertexAttribType type, GrSLPrecision preci
sion) |
160 GrSLPrecision precision = kDefault_GrSLPrecision) | |
161 : fName(name) | 160 : fName(name) |
162 , fType(type) | 161 , fType(type) |
163 , fOffset(SkAlign4(GrVertexAttribTypeSize(type))) | 162 , fOffset(SkAlign4(GrVertexAttribTypeSize(type))) |
164 , fPrecision(precision) {} | 163 , fPrecision(precision) {} |
165 const char* fName; | 164 const char* fName; |
166 GrVertexAttribType fType; | 165 GrVertexAttribType fType; |
167 size_t fOffset; | 166 size_t fOffset; |
168 GrSLPrecision fPrecision; | 167 GrSLPrecision fPrecision; |
169 }; | 168 }; |
170 | 169 |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
233 size_t fVertexStride; | 232 size_t fVertexStride; |
234 | 233 |
235 private: | 234 private: |
236 void notifyRefCntIsZero() const final {}; | 235 void notifyRefCntIsZero() const final {}; |
237 virtual bool hasExplicitLocalCoords() const = 0; | 236 virtual bool hasExplicitLocalCoords() const = 0; |
238 | 237 |
239 typedef GrProcessor INHERITED; | 238 typedef GrProcessor INHERITED; |
240 }; | 239 }; |
241 | 240 |
242 #endif | 241 #endif |
OLD | NEW |