OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #include "Test.h" | 8 #include "Test.h" |
9 #include "SkCanvas.h" | 9 #include "SkCanvas.h" |
10 #include "SkPaint.h" | 10 #include "SkPaint.h" |
(...skipping 1750 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1761 strokePaint.setStyle(SkPaint::kStroke_Style); | 1761 strokePaint.setStyle(SkPaint::kStroke_Style); |
1762 strokePaint.setStrokeWidth(2); | 1762 strokePaint.setStrokeWidth(2); |
1763 strokePaint.getFillPath(src, &dst); | 1763 strokePaint.getFillPath(src, &dst); |
1764 REPORTER_ASSERT(reporter, dst.isNestedRects(NULL)); | 1764 REPORTER_ASSERT(reporter, dst.isNestedRects(NULL)); |
1765 } | 1765 } |
1766 | 1766 |
1767 static void write_and_read_back(skiatest::Reporter* reporter, | 1767 static void write_and_read_back(skiatest::Reporter* reporter, |
1768 const SkPath& p) { | 1768 const SkPath& p) { |
1769 SkWriter32 writer(100); | 1769 SkWriter32 writer(100); |
1770 writer.writePath(p); | 1770 writer.writePath(p); |
1771 size_t size = writer.size(); | 1771 size_t size = writer.bytesWritten(); |
1772 SkAutoMalloc storage(size); | 1772 SkAutoMalloc storage(size); |
1773 writer.flatten(storage.get()); | 1773 writer.flatten(storage.get()); |
1774 SkReader32 reader(storage.get(), size); | 1774 SkReader32 reader(storage.get(), size); |
1775 | 1775 |
1776 SkPath readBack; | 1776 SkPath readBack; |
1777 REPORTER_ASSERT(reporter, readBack != p); | 1777 REPORTER_ASSERT(reporter, readBack != p); |
1778 reader.readPath(&readBack); | 1778 reader.readPath(&readBack); |
1779 REPORTER_ASSERT(reporter, readBack == p); | 1779 REPORTER_ASSERT(reporter, readBack == p); |
1780 | 1780 |
1781 REPORTER_ASSERT(reporter, readBack.getConvexityOrUnknown() == | 1781 REPORTER_ASSERT(reporter, readBack.getConvexityOrUnknown() == |
(...skipping 888 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2670 test_bad_cubic_crbug229478(); | 2670 test_bad_cubic_crbug229478(); |
2671 test_bad_cubic_crbug234190(); | 2671 test_bad_cubic_crbug234190(); |
2672 test_android_specific_behavior(reporter); | 2672 test_android_specific_behavior(reporter); |
2673 test_gen_id(reporter); | 2673 test_gen_id(reporter); |
2674 test_path_close_issue1474(reporter); | 2674 test_path_close_issue1474(reporter); |
2675 test_path_to_region(reporter); | 2675 test_path_to_region(reporter); |
2676 } | 2676 } |
2677 | 2677 |
2678 #include "TestClassDef.h" | 2678 #include "TestClassDef.h" |
2679 DEFINE_TESTCLASS("Path", PathTestClass, TestPath) | 2679 DEFINE_TESTCLASS("Path", PathTestClass, TestPath) |
OLD | NEW |