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

Unified Diff: include/pathops/SkPathOps.h

Issue 12827020: Add base types for path ops (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 9 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
« no previous file with comments | « no previous file | src/pathops/SkPathOpsBounds.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/pathops/SkPathOps.h
===================================================================
--- include/pathops/SkPathOps.h (revision 0)
+++ include/pathops/SkPathOps.h (revision 0)
@@ -0,0 +1,39 @@
+/*
+ * Copyright 2012 Google Inc.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+#ifndef SkPathOps_DEFINED
+#define SkPathOps_DEFINED
+
+class SkPath;
+
+// FIXME: move this into SkPaths.h or just use the equivalent in SkRegion.h
+enum SkPathOp {
+ kDifference_PathOp, //!< subtract the op path from the first path
+ kIntersect_PathOp, //!< intersect the two paths
+ kUnion_PathOp, //!< union (inclusive-or) the two paths
+ kXOR_PathOp, //!< exclusive-or the two paths
+ /** subtract the first path from the op path */
+ kReverseDifference_PathOp, // FIXME: unsupported
+ kReplace_PathOp //!< replace the dst path with the op FIXME: unsupported: should it be?
+};
+
+// FIXME: these functions become members of SkPath
+/**
+ * Set this path to the result of applying the Op to this path and the
+ * specified path: this = (this op operand). The resulting path will be constructed
+ * from non-overlapping contours. The curve order is reduced where possible so that cubics may
+ * be turned into quadratics, and quadratics maybe turned into lines.
+ */
+void Op(const SkPath& one, const SkPath& two, SkPathOp op, SkPath* result);
+
+/**
+ * Set this path to a set of non-overlapping contours that describe the same
+ * area as the original path. The curve order is reduced where possible so that cubics may
+ * be turned into quadratics, and quadratics maybe turned into lines.
+ */
+void Simplify(const SkPath& path, SkPath* result);
+
+#endif
« no previous file with comments | « no previous file | src/pathops/SkPathOpsBounds.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698