Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(13)

Unified Diff: include/utils/SkPathUtils.h

Issue 16829003: Adding my Bitmap2Path sample for 1on1 meeting. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Added SkRegion mode to PathUtils and Test. Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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
« no previous file with comments | « gyp/utils.gyp ('k') | samplecode/SamplePathUtils.cpp » ('j') | src/utils/SkPathUtils.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698