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

Side by Side Diff: src/gpu/GrPrimitiveProcessor.h

Issue 2248323003: Simplify adding attributes to GrGeometryProcessor (Closed) Base URL: https://chromium.googlesource.com/skia.git@xformhelper
Patch Set: Revert removal of fAttribNames Created 4 years, 4 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
« no previous file with comments | « src/gpu/GrOvalRenderer.cpp ('k') | src/gpu/batches/GrAAConvexPathRenderer.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 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
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
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
OLDNEW
« no previous file with comments | « src/gpu/GrOvalRenderer.cpp ('k') | src/gpu/batches/GrAAConvexPathRenderer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698