update dox for pathmeasure
Of note, the client need not keep the path around after creating/resetting the measure
object. The parts that are needed are copied, so the client is free to modify/delete
the path afterwards.
Bug: skia:
Change-Id: I9b9a0fd8e3cd6fd6c60de0017bcaee1fbc2fb893
Reviewed-on: https://skia-review.googlesource.com/c/190679
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Auto-Submit: Mike Reed <reed@google.com>
diff --git a/include/core/SkContourMeasure.h b/include/core/SkContourMeasure.h
index 223f3b5..f3ec519 100644
--- a/include/core/SkContourMeasure.h
+++ b/include/core/SkContourMeasure.h
@@ -92,9 +92,19 @@
class SK_API SkContourMeasureIter : SkNoncopyable {
public:
SkContourMeasureIter();
+ /**
+ * Initialize the Iter with a path.
+ * The parts of the path that are needed are copied, so the client is free to modify/delete
+ * the path after this call.
+ */
SkContourMeasureIter(const SkPath& path, bool forceClosed, SkScalar resScale = 1);
~SkContourMeasureIter();
+ /**
+ * Reset the Iter with a path.
+ * The parts of the path that are needed are copied, so the client is free to modify/delete
+ * the path after this call.
+ */
void reset(const SkPath& path, bool forceClosed, SkScalar resScale = 1);
/**
diff --git a/include/core/SkPathMeasure.h b/include/core/SkPathMeasure.h
index 9d77da2..c486d31 100644
--- a/include/core/SkPathMeasure.h
+++ b/include/core/SkPathMeasure.h
@@ -16,22 +16,18 @@
class SK_API SkPathMeasure : SkNoncopyable {
public:
SkPathMeasure();
- /** Initialize the pathmeasure with the specified path. The path must remain valid
- for the lifetime of the measure object, or until setPath() is called with
- a different path (or null), since the measure object keeps a pointer to the
- path object (does not copy its data).
-
- resScale controls the precision of the measure. values > 1 increase the
- precision (and possible slow down the computation).
- */
+ /** Initialize the pathmeasure with the specified path. The parts of the path that are needed
+ * are copied, so the client is free to modify/delete the path after this call.
+ *
+ * resScale controls the precision of the measure. values > 1 increase the
+ * precision (and possible slow down the computation).
+ */
SkPathMeasure(const SkPath& path, bool forceClosed, SkScalar resScale = 1);
~SkPathMeasure();
- /** Reset the pathmeasure with the specified path. The path must remain valid
- for the lifetime of the measure object, or until setPath() is called with
- a different path (or null), since the measure object keeps a pointer to the
- path object (does not copy its data).
- */
+ /** Reset the pathmeasure with the specified path. The parts of the path that are needed
+ * are copied, so the client is free to modify/delete the path after this call..
+ */
void setPath(const SkPath*, bool forceClosed);
/** Return the total length of the current contour, or 0 if no path