From a1a097ee814d05a92487d85db8ad02e1d852fd6f Mon Sep 17 00:00:00 2001 From: "commit-bot@chromium.org" Date: Thu, 14 Nov 2013 16:53:22 +0000 Subject: increase coverage of SkPath.cpp, remove unused code Using Mike Klein's excellent coverage tool, increase the unit testing of SkPath.cpp from 70% to 95%. Along the way, determined that these functions were not maintained or used: SkPath::pathTo SkPath::contains as well as a large block of SkPath::cheapGetDirection(). Changed SkPath::validate() to permit infinities in the path data points. Fixed errors in preserving direction. Fixed error setting direction when convexity is unknown. Added missing conic to moveTo only detector. BUG= R=bsalomon@google.com, reed@google.com Author: caryclark@google.com Review URL: https://codereview.chromium.org/65493004 git-svn-id: http://skia.googlecode.com/svn/trunk@12291 2bbb7eff-a529-9590-31e7-b0007b416f81 --- bench/PathBench.cpp | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) (limited to 'bench/PathBench.cpp') diff --git a/bench/PathBench.cpp b/bench/PathBench.cpp index d8a2ca9b68..11151d9d45 100644 --- a/bench/PathBench.cpp +++ b/bench/PathBench.cpp @@ -495,7 +495,6 @@ public: kAdd_AddType, kAddTrans_AddType, kAddMatrix_AddType, - kPathTo_AddType, kReverseAdd_AddType, kReversePathTo_AddType, }; @@ -513,8 +512,6 @@ protected: return "path_add_path_trans"; case kAddMatrix_AddType: return "path_add_path_matrix"; - case kPathTo_AddType: - return "path_path_to"; case kReverseAdd_AddType: return "path_reverse_add_path"; case kReversePathTo_AddType: @@ -526,9 +523,8 @@ protected: } virtual void onPreDraw() SK_OVERRIDE { - // pathTo and reversePathTo assume a single contour path. - bool allowMoves = kPathTo_AddType != fType && - kReversePathTo_AddType != fType; + // reversePathTo assumes a single contour path. + bool allowMoves = kReversePathTo_AddType != fType; this->createData(10, 100, allowMoves); fPaths0.reset(kPathCnt); fPaths1.reset(kPathCnt); @@ -562,13 +558,6 @@ protected: result.addPath(fPaths1[idx], fMatrix); } break; - case kPathTo_AddType: - for (int i = 0; i < this->getLoops(); ++i) { - int idx = i & (kPathCnt - 1); - SkPath result = fPaths0[idx]; - result.pathTo(fPaths1[idx]); - } - break; case kReverseAdd_AddType: for (int i = 0; i < this->getLoops(); ++i) { int idx = i & (kPathCnt - 1); @@ -1036,7 +1025,6 @@ DEF_BENCH( return new PathEqualityBench(); ) DEF_BENCH( return new SkBench_AddPathTest(SkBench_AddPathTest::kAdd_AddType); ) DEF_BENCH( return new SkBench_AddPathTest(SkBench_AddPathTest::kAddTrans_AddType); ) DEF_BENCH( return new SkBench_AddPathTest(SkBench_AddPathTest::kAddMatrix_AddType); ) -DEF_BENCH( return new SkBench_AddPathTest(SkBench_AddPathTest::kPathTo_AddType); ) DEF_BENCH( return new SkBench_AddPathTest(SkBench_AddPathTest::kReverseAdd_AddType); ) DEF_BENCH( return new SkBench_AddPathTest(SkBench_AddPathTest::kReversePathTo_AddType); ) -- cgit v1.2.3