| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 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 GrDrawState_DEFINED | 8 #ifndef GrDrawState_DEFINED |
| 9 #define GrDrawState_DEFINED | 9 #define GrDrawState_DEFINED |
| 10 | 10 |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 kVec2f_GrVertexAttribType, | 31 kVec2f_GrVertexAttribType, |
| 32 kVec3f_GrVertexAttribType, | 32 kVec3f_GrVertexAttribType, |
| 33 kVec4f_GrVertexAttribType, | 33 kVec4f_GrVertexAttribType, |
| 34 kVec4ub_GrVertexAttribType, // vector of 4 unsigned bytes, e.g. colors | 34 kVec4ub_GrVertexAttribType, // vector of 4 unsigned bytes, e.g. colors |
| 35 | 35 |
| 36 kLast_GrVertexAttribType = kVec4ub_GrVertexAttribType | 36 kLast_GrVertexAttribType = kVec4ub_GrVertexAttribType |
| 37 }; | 37 }; |
| 38 static const int kGrVertexAttribTypeCount = kLast_GrVertexAttribType + 1; | 38 static const int kGrVertexAttribTypeCount = kLast_GrVertexAttribType + 1; |
| 39 | 39 |
| 40 struct GrVertexAttrib { | 40 struct GrVertexAttrib { |
| 41 inline GrVertexAttrib() {} | 41 inline void set(GrVertexAttribType type, size_t offset) { |
| 42 inline GrVertexAttrib(GrVertexAttribType type, size_t offset) : | 42 fType = type; fOffset = offset; |
| 43 fType(type), fOffset(offset) {} | 43 } |
| 44 bool operator==(const GrVertexAttrib& other) const { | 44 bool operator==(const GrVertexAttrib& other) const { |
| 45 return fType == other.fType && fOffset == other.fOffset; | 45 return fType == other.fType && fOffset == other.fOffset; |
| 46 }; | 46 }; |
| 47 bool operator!=(const GrVertexAttrib& other) const { return !(*this == other
); } | 47 bool operator!=(const GrVertexAttrib& other) const { return !(*this == other
); } |
| 48 | 48 |
| 49 GrVertexAttribType fType; | 49 GrVertexAttribType fType; |
| 50 size_t fOffset; | 50 size_t fOffset; |
| 51 }; | 51 }; |
| 52 | 52 |
| 53 template <int N> | 53 template <int N> |
| (...skipping 1316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1370 int fAttribIndices[kAttribIndexCount]; | 1370 int fAttribIndices[kAttribIndexCount]; |
| 1371 GrVertexAttribArray<kVertexAttribCnt> fVertexAttribs; | 1371 GrVertexAttribArray<kVertexAttribCnt> fVertexAttribs; |
| 1372 GrEffectStage fStages[kNumStages]; | 1372 GrEffectStage fStages[kNumStages]; |
| 1373 | 1373 |
| 1374 typedef GrRefCnt INHERITED; | 1374 typedef GrRefCnt INHERITED; |
| 1375 }; | 1375 }; |
| 1376 | 1376 |
| 1377 GR_MAKE_BITFIELD_OPS(GrDrawState::BlendOptFlags); | 1377 GR_MAKE_BITFIELD_OPS(GrDrawState::BlendOptFlags); |
| 1378 | 1378 |
| 1379 #endif | 1379 #endif |
| OLD | NEW |