Index: include/gpu/GrTypesPriv.h |
=================================================================== |
--- include/gpu/GrTypesPriv.h (revision 8407) |
+++ include/gpu/GrTypesPriv.h (working copy) |
@@ -24,4 +24,34 @@ |
kSampler2D_GrSLType |
}; |
+/** |
bsalomon
2013/03/27 15:45:47
This is moved from GrDrawState.h
|
+ * Types used to describe format of vertices in arrays |
+ */ |
+enum GrVertexAttribType { |
+ kFloat_GrVertexAttribType = 0, |
+ kVec2f_GrVertexAttribType, |
+ kVec3f_GrVertexAttribType, |
+ kVec4f_GrVertexAttribType, |
+ kVec4ub_GrVertexAttribType, // vector of 4 unsigned bytes, e.g. colors |
+ |
+ kLast_GrVertexAttribType = kVec4ub_GrVertexAttribType |
+}; |
+static const int kGrVertexAttribTypeCount = kLast_GrVertexAttribType + 1; |
+ |
+struct GrVertexAttrib { |
+ inline void set(GrVertexAttribType type, size_t offset) { |
+ fType = type; fOffset = offset; |
+ } |
+ bool operator==(const GrVertexAttrib& other) const { |
+ return fType == other.fType && fOffset == other.fOffset; |
+ }; |
+ bool operator!=(const GrVertexAttrib& other) const { return !(*this == other); } |
+ |
+ GrVertexAttribType fType; |
+ size_t fOffset; |
+}; |
+ |
+template <int N> |
+class GrVertexAttribArray : public SkSTArray<N, GrVertexAttrib, true> {}; |
+ |
#endif |