Index: tests/PathTest.cpp |
diff --git a/tests/PathTest.cpp b/tests/PathTest.cpp |
index 35fbf2fdc309285d37f1e5be276c31ba7d0e9bc8..30044114e16756721a634d2a80859ffa26c3bdf5 100644 |
--- a/tests/PathTest.cpp |
+++ b/tests/PathTest.cpp |
@@ -3419,9 +3419,9 @@ static void test_operatorEqual(skiatest::Reporter* reporter) { |
} |
static void compare_dump(skiatest::Reporter* reporter, const SkPath& path, bool force, |
- const char* str) { |
+ bool dumpAsHex, const char* str) { |
SkDynamicMemoryWStream wStream; |
- path.dump(&wStream, force); |
+ path.dump(&wStream, force, dumpAsHex); |
SkAutoDataUnref data(wStream.copyToData()); |
REPORTER_ASSERT(reporter, data->size() == strlen(str)); |
REPORTER_ASSERT(reporter, !memcmp(data->data(), str, strlen(str))); |
@@ -3429,31 +3429,41 @@ static void compare_dump(skiatest::Reporter* reporter, const SkPath& path, bool |
static void test_dump(skiatest::Reporter* reporter) { |
SkPath p; |
- compare_dump(reporter, p, false, ""); |
- compare_dump(reporter, p, true, ""); |
+ compare_dump(reporter, p, false, false, ""); |
+ compare_dump(reporter, p, true, false, ""); |
p.moveTo(1, 2); |
p.lineTo(3, 4); |
- compare_dump(reporter, p, false, "path.moveTo(1, 2);\n" |
- "path.lineTo(3, 4);\n"); |
- compare_dump(reporter, p, true, "path.moveTo(1, 2);\n" |
- "path.lineTo(3, 4);\n" |
- "path.lineTo(1, 2);\n" |
- "path.close();\n"); |
+ compare_dump(reporter, p, false, false, "path.moveTo(1, 2);\n" |
+ "path.lineTo(3, 4);\n"); |
+ compare_dump(reporter, p, true, false, "path.moveTo(1, 2);\n" |
+ "path.lineTo(3, 4);\n" |
+ "path.lineTo(1, 2);\n" |
+ "path.close();\n"); |
p.reset(); |
p.moveTo(1, 2); |
p.quadTo(3, 4, 5, 6); |
- compare_dump(reporter, p, false, "path.moveTo(1, 2);\n" |
- "path.quadTo(3, 4, 5, 6);\n"); |
+ compare_dump(reporter, p, false, false, "path.moveTo(1, 2);\n" |
+ "path.quadTo(3, 4, 5, 6);\n"); |
p.reset(); |
p.moveTo(1, 2); |
p.conicTo(3, 4, 5, 6, 0.5f); |
- compare_dump(reporter, p, false, "path.moveTo(1, 2);\n" |
- "path.conicTo(3, 4, 5, 6, 0.5f);\n"); |
+ compare_dump(reporter, p, false, false, "path.moveTo(1, 2);\n" |
+ "path.conicTo(3, 4, 5, 6, 0.5f);\n"); |
p.reset(); |
p.moveTo(1, 2); |
p.cubicTo(3, 4, 5, 6, 7, 8); |
- compare_dump(reporter, p, false, "path.moveTo(1, 2);\n" |
- "path.cubicTo(3, 4, 5, 6, 7, 8);\n"); |
+ compare_dump(reporter, p, false, false, "path.moveTo(1, 2);\n" |
+ "path.cubicTo(3, 4, 5, 6, 7, 8);\n"); |
+ 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"); |
+ p.reset(); |
+ p.moveTo(SkBits2Float(0x3f800000), SkBits2Float(0x40000000)); |
+ p.lineTo(SkBits2Float(0x40400000), SkBits2Float(0x40800000)); |
+ compare_dump(reporter, p, false, false, "path.moveTo(1, 2);\n" |
+ "path.lineTo(3, 4);\n"); |
} |
class PathTest_Private { |