diff options
author | 2014-02-11 01:38:30 +0000 | |
---|---|---|
committer | 2014-02-11 01:38:30 +0000 | |
commit | 7e90e8dbb96f2084f7dd4a6a20cb4b880b362438 (patch) | |
tree | 7898adca3ed3c902becf9389214c4e80ccd9c95f | |
parent | 6d254ee4aceabb7aeb86c5615139676dfe224a89 (diff) |
fix minor error between kStroke_PathAsRect and kFill_PathAsRect in SkPath::asRect
R=caryclark@google.com, reed@google.com
Author: yunchao.he@intel.com
Review URL: https://codereview.chromium.org/138703008
git-svn-id: http://skia.googlecode.com/svn/trunk@13390 2bbb7eff-a529-9590-31e7-b0007b416f81
-rw-r--r-- | include/core/SkPath.h | 4 | ||||
-rw-r--r-- | src/core/SkPath.cpp | 4 | ||||
-rw-r--r-- | tests/PathTest.cpp | 4 |
3 files changed, 6 insertions, 6 deletions
diff --git a/include/core/SkPath.h b/include/core/SkPath.h index 2d63bb2353..5e31e2813c 100644 --- a/include/core/SkPath.h +++ b/include/core/SkPath.h @@ -558,10 +558,10 @@ public: enum PathAsRect { /** The path can not draw the same as its bounds. */ kNone_PathAsRect, - /** The path draws the same as its bounds when stroked or filled. */ - kStroke_PathAsRect, /** The path draws the same as its bounds when filled. */ kFill_PathAsRect, + /** The path draws the same as its bounds when stroked or filled. */ + kStroke_PathAsRect, }; /** Returns kFill_PathAsRect or kStroke_PathAsRect if drawing the path (either filled or diff --git a/src/core/SkPath.cpp b/src/core/SkPath.cpp index d3f493d46f..5023d60f3c 100644 --- a/src/core/SkPath.cpp +++ b/src/core/SkPath.cpp @@ -500,8 +500,8 @@ bool SkPath::isRectContour(bool allowPartial, int* currVerb, const SkPoint** pts SkPath::PathAsRect SkPath::asRect(Direction* direction) const { SK_COMPILE_ASSERT(0 == kNone_PathAsRect, path_as_rect_mismatch); - SK_COMPILE_ASSERT(1 == kStroke_PathAsRect, path_as_rect_mismatch); - SK_COMPILE_ASSERT(2 == kFill_PathAsRect, path_as_rect_mismatch); + SK_COMPILE_ASSERT(1 == kFill_PathAsRect, path_as_rect_mismatch); + SK_COMPILE_ASSERT(2 == kStroke_PathAsRect, path_as_rect_mismatch); bool isClosed = false; return (PathAsRect) (isRect(&isClosed, direction) + isClosed); } diff --git a/tests/PathTest.cpp b/tests/PathTest.cpp index e872b0c839..f9466f5944 100644 --- a/tests/PathTest.cpp +++ b/tests/PathTest.cpp @@ -1443,7 +1443,7 @@ static void test_isRect_open_close(skiatest::Reporter* reporter) { REPORTER_ASSERT(reporter, path.isRect(NULL, NULL)); REPORTER_ASSERT(reporter, path.isRect(&isClosed, NULL)); REPORTER_ASSERT(reporter, isClosed); - REPORTER_ASSERT(reporter, SkPath::kFill_PathAsRect == path.asRect(NULL)); + REPORTER_ASSERT(reporter, SkPath::kStroke_PathAsRect == path.asRect(NULL)); } // Simple isRect test is inline TestPath, below. @@ -1562,7 +1562,7 @@ static void test_isRect(skiatest::Reporter* reporter) { REPORTER_ASSERT(reporter, isClosed == tests[testIndex].fClose); REPORTER_ASSERT(reporter, direction == cheapDirection); direction = (SkPath::Direction) -1; - if (tests[testIndex].fClose) { + if (!tests[testIndex].fClose) { REPORTER_ASSERT(reporter, SkPath::kFill_PathAsRect == path.asRect()); REPORTER_ASSERT(reporter, SkPath::kFill_PathAsRect == path.asRect(&direction)); } else { |