Index: include/core/SkVertState.h |
diff --git a/include/core/SkVertState.h b/include/core/SkVertState.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..d0cc886769ac3b055de3c4a3de609d6775396d09 |
--- /dev/null |
+++ b/include/core/SkVertState.h |
@@ -0,0 +1,42 @@ |
+/* |
+ * Copyright 2014 Google Inc. |
+ * |
+ * Use of this source code is governed by a BSD-style license that can be |
+ * found in the LICENSE file. |
+ */ |
+ |
+#ifndef SkVertState_DEFINED |
+#define SkVertState_DEFINED |
+ |
+#include "SkCanvas.h" |
+ |
+struct VertState { |
bsalomon
2014/05/15 13:13:33
I think this class could use some documentation if
yunchao
2014/05/15 14:15:53
Agree. I will update the document for your reviewi
|
+ int f0, f1, f2; |
+ |
+ VertState(int vCount, const uint16_t indices[], int indexCount) |
+ : fIndices(indices) { |
+ fCurrIndex = 0; |
+ if (indices) { |
+ fCount = indexCount; |
+ } else { |
+ fCount = vCount; |
+ } |
+ } |
+ |
+ typedef bool (*Proc)(VertState*); |
+ Proc chooseProc(SkCanvas::VertexMode mode); |
+ |
+private: |
+ int fCount; |
+ int fCurrIndex; |
+ const uint16_t* fIndices; |
+ |
+ static bool Triangles(VertState*); |
+ static bool TrianglesX(VertState*); |
+ static bool TriangleStrip(VertState*); |
+ static bool TriangleStripX(VertState*); |
+ static bool TriangleFan(VertState*); |
+ static bool TriangleFanX(VertState*); |
+}; |
+ |
+#endif |