diff options
-rw-r--r-- | src/core/SkPath.cpp | 16 | ||||
-rw-r--r-- | tests/PathTest.cpp | 5 |
2 files changed, 18 insertions, 3 deletions
diff --git a/src/core/SkPath.cpp b/src/core/SkPath.cpp index 06f8b7e259..f756ce365c 100644 --- a/src/core/SkPath.cpp +++ b/src/core/SkPath.cpp @@ -2050,7 +2050,21 @@ static void append_params(SkString* str, const char label[], const SkPoint pts[] str->append(", "); append_scalar(str, conicWeight, dumpAsHex); } - str->append(");\n"); + str->append(");"); + if (dumpAsHex) { + str->append(" // "); + for (int i = 0; i < count; ++i) { + append_scalar(str, values[i], false); + if (i < count - 1) { + str->append(", "); + } + } + if (conicWeight >= 0) { + str->append(", "); + append_scalar(str, conicWeight, false); + } + } + str->append("\n"); } void SkPath::dump(SkWStream* wStream, bool forceClose, bool dumpAsHex) const { diff --git a/tests/PathTest.cpp b/tests/PathTest.cpp index 1f0422d788..bc3a3d7bdb 100644 --- a/tests/PathTest.cpp +++ b/tests/PathTest.cpp @@ -3468,8 +3468,9 @@ static void test_dump(skiatest::Reporter* reporter) { p.reset(); p.moveTo(1, 2); p.lineTo(3, 4); - compare_dump(reporter, p, false, true, "path.moveTo(SkBits2Float(0x3f800000), SkBits2Float(0x40000000));\n" - "path.lineTo(SkBits2Float(0x40400000), SkBits2Float(0x40800000));\n"); + compare_dump(reporter, p, false, true, + "path.moveTo(SkBits2Float(0x3f800000), SkBits2Float(0x40000000)); // 1, 2\n" + "path.lineTo(SkBits2Float(0x40400000), SkBits2Float(0x40800000)); // 3, 4\n"); p.reset(); p.moveTo(SkBits2Float(0x3f800000), SkBits2Float(0x40000000)); p.lineTo(SkBits2Float(0x40400000), SkBits2Float(0x40800000)); |