Chromium Code Reviews| Index: include/utils/SkPathUtils.h |
| diff --git a/include/utils/SkPathUtils.h b/include/utils/SkPathUtils.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..c10ac93293441b034fa1da6d3a0a238438f6a09f |
| --- /dev/null |
| +++ b/include/utils/SkPathUtils.h |
| @@ -0,0 +1,40 @@ |
| +/* |
| + * CAUTION: EXPERIMENTAL CODE |
| + * |
| + * This code is not to be used and will not be supported |
| + * if it fails on you. DO NOT USE! |
| + * |
| + * |
| + * |
| + */ |
| + |
| +#ifndef SkPathUtils_DEFINED |
| +#define SKPathUtils_DEFINED |
| + |
| +#include "SkPath.h" |
| +//#include "SkPathOps.h" // this file can't be found |
|
reed1
2013/06/26 16:54:24
Not needed anyway for a header (just the impl)
|
| + |
| +typedef void (*line2path)(SkPath*, const char*, int, int); |
|
reed1
2013/06/26 16:54:24
These 4 lines need not be in the header
|
| +#define SQRT_2 1.41421356237f |
| +#define ON 0xFF000000 // black pixel |
| +#define OFF 0x00000000 // transparent pixel |
| + |
| + |
| +class SK_API SkPathUtils { |
| +public: |
| + static void fillRandomBits(int chars, char* bits); |
| + static int getBit(const char* buffer, int x); |
| + static void line2path_pixel(SkPath* path, const char* line, |
| + int lineIdx, int width); |
| + static void line2path_pixelCircle(SkPath* path, const char* line, |
| + int lineIdx, int width); |
| + static void line2path_span(SkPath* path, const char* line, |
| + int lineIdx, int width); |
| + static void bitmap2path(SkPath* path, const char* bitmap, |
|
reed1
2013/06/26 16:54:24
1. I think only these last 2 need to be in the pub
|
| + const line2path l2p_fn, |
|
reed1
2013/06/26 16:54:24
Since "bitmap" is a pretty loaded word in Skia, pe
|
| + int h, int w, int stride); |
| + static void bitmap2path_region(SkPath* path, const char* bitmap, |
| + int h, int w, int stride); |
| +}; |
| + |
| +#endif |