From 8d4594175cfff2de9839362d2f1eded27044ef2b Mon Sep 17 00:00:00 2001 From: Mike Reed Date: Fri, 8 Feb 2019 16:56:12 -0500 Subject: [PATCH] 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 Commit-Queue: Mike Reed Auto-Submit: Mike Reed --- include/core/SkContourMeasure.h | 10 ++++++++++ include/core/SkPathMeasure.h | 22 +++++++++------------- 2 files changed, 19 insertions(+), 13 deletions(-) diff --git a/include/core/SkContourMeasure.h b/include/core/SkContourMeasure.h index 223f3b5f61..f3ec519cbc 100644 --- a/include/core/SkContourMeasure.h +++ b/include/core/SkContourMeasure.h @@ -92,9 +92,19 @@ private: 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 9d77da297c..c486d31f31 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