Chromium Code Reviews| 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 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 119 * This is a safeguard to prevent GrPrimitiveProcessor's from going beyond p latform specific | 119 * This is a safeguard to prevent GrPrimitiveProcessor's from going beyond p latform specific |
| 120 * attribute limits. This number can almost certainly be raised if required. | 120 * attribute limits. This number can almost certainly be raised if required. |
| 121 */ | 121 */ |
| 122 static const int kMaxVertexAttribs = 6; | 122 static const int kMaxVertexAttribs = 6; |
| 123 | 123 |
| 124 struct Attribute { | 124 struct Attribute { |
| 125 Attribute() | 125 Attribute() |
| 126 : fName(NULL) | 126 : fName(NULL) |
| 127 , fType(kFloat_GrVertexAttribType) | 127 , fType(kFloat_GrVertexAttribType) |
| 128 , fOffset(0) {} | 128 , fOffset(0) {} |
| 129 Attribute(const char* name, GrVertexAttribType type) | 129 Attribute(const char* name, GrVertexAttribType type, GrSLPrecision preci sion = kDefault_GrSLPrecision) |
|
joshualitt
2015/05/20 20:36:10
newline
Stephen White
2015/05/20 20:47:43
Done.
| |
| 130 : fName(name) | 130 : fName(name) |
| 131 , fType(type) | 131 , fType(type) |
| 132 , fOffset(SkAlign4(GrVertexAttribTypeSize(type))) {} | 132 , fOffset(SkAlign4(GrVertexAttribTypeSize(type))) |
| 133 , fPrecision(precision) {} | |
| 133 const char* fName; | 134 const char* fName; |
| 134 GrVertexAttribType fType; | 135 GrVertexAttribType fType; |
| 135 size_t fOffset; | 136 size_t fOffset; |
| 137 GrSLPrecision fPrecision; | |
| 136 }; | 138 }; |
| 137 | 139 |
| 138 int numAttribs() const { return fNumAttribs; } | 140 int numAttribs() const { return fNumAttribs; } |
| 139 const Attribute& getAttrib(int index) const { | 141 const Attribute& getAttrib(int index) const { |
| 140 SkASSERT(index < fNumAttribs); | 142 SkASSERT(index < fNumAttribs); |
| 141 return fAttribs[index]; | 143 return fAttribs[index]; |
| 142 } | 144 } |
| 143 | 145 |
| 144 // Returns the vertex stride of the GP. A common use case is to request geo metry from a | 146 // Returns the vertex stride of the GP. A common use case is to request geo metry from a |
| 145 // drawtarget based off of the stride, and to populate this memory using an implicit array of | 147 // drawtarget based off of the stride, and to populate this memory using an implicit array of |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 180 | 182 |
| 181 private: | 183 private: |
| 182 virtual bool hasExplicitLocalCoords() const = 0; | 184 virtual bool hasExplicitLocalCoords() const = 0; |
| 183 | 185 |
| 184 bool fIsPathRendering; | 186 bool fIsPathRendering; |
| 185 | 187 |
| 186 typedef GrProcessor INHERITED; | 188 typedef GrProcessor INHERITED; |
| 187 }; | 189 }; |
| 188 | 190 |
| 189 #endif | 191 #endif |
| OLD | NEW |