diff options
author | Mike Reed <reed@google.com> | 2009-10-28 14:29:41 -0400 |
---|---|---|
committer | Mike Reed <reed@google.com> | 2009-10-28 14:30:57 -0400 |
commit | 3798ac8a1beee1c03d45bde7cf810353829d5f93 (patch) | |
tree | adfdab5a205f32113c66443b90f1f868dcc07d64 /include/utils/SkMeshUtils.h | |
parent | 1ba87c2b414250b98cf5580cf105a80bbe7d311d (diff) | |
download | external_skia-3798ac8a1beee1c03d45bde7cf810353829d5f93.zip external_skia-3798ac8a1beee1c03d45bde7cf810353829d5f93.tar.gz external_skia-3798ac8a1beee1c03d45bde7cf810353829d5f93.tar.bz2 |
add boundary patch utils
Diffstat (limited to 'include/utils/SkMeshUtils.h')
-rw-r--r-- | include/utils/SkMeshUtils.h | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/include/utils/SkMeshUtils.h b/include/utils/SkMeshUtils.h new file mode 100644 index 0000000..1235485 --- /dev/null +++ b/include/utils/SkMeshUtils.h @@ -0,0 +1,43 @@ +#ifndef SkMeshUtils_DEFINED +#define SkMeshUtils_DEFINED + +#include "SkPoint.h" +#include "SkColor.h" + +class SkBitmap; +class SkCanvas; +class SkPaint; + +class SkMeshIndices { +public: + SkMeshIndices(); + ~SkMeshIndices(); + + bool init(int texW, int texH, int rows, int cols) { + return this->init(NULL, NULL, texW, texH, rows, cols); + } + + bool init(SkPoint tex[], uint16_t indices[], + int texW, int texH, int rows, int cols); + + size_t indexCount() const { return fIndexCount; } + const uint16_t* indices() const { return fIndices; } + + size_t texCount() const { return fTexCount; } + const SkPoint* tex() const { return fTex; } + +private: + size_t fIndexCount, fTexCount; + SkPoint* fTex; + uint16_t* fIndices; + void* fStorage; // may be null +}; + +class SkMeshUtils { +public: + static void Draw(SkCanvas*, const SkBitmap&, int rows, int cols, + const SkPoint verts[], const SkColor colors[], + const SkPaint& paint); +}; + +#endif |