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 "TestClassDef.h" | 9 #include "TestClassDef.h" |
10 #include "SkCanvas.h" | 10 #include "SkCanvas.h" |
(...skipping 1820 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1831 src.addRect(1, 1, 7, 7, SkPath::kCW_Direction); | 1831 src.addRect(1, 1, 7, 7, SkPath::kCW_Direction); |
1832 SkPaint strokePaint; | 1832 SkPaint strokePaint; |
1833 strokePaint.setStyle(SkPaint::kStroke_Style); | 1833 strokePaint.setStyle(SkPaint::kStroke_Style); |
1834 strokePaint.setStrokeWidth(2); | 1834 strokePaint.setStrokeWidth(2); |
1835 strokePaint.getFillPath(src, &dst); | 1835 strokePaint.getFillPath(src, &dst); |
1836 REPORTER_ASSERT(reporter, dst.isNestedRects(NULL)); | 1836 REPORTER_ASSERT(reporter, dst.isNestedRects(NULL)); |
1837 } | 1837 } |
1838 | 1838 |
1839 static void write_and_read_back(skiatest::Reporter* reporter, | 1839 static void write_and_read_back(skiatest::Reporter* reporter, |
1840 const SkPath& p) { | 1840 const SkPath& p) { |
1841 SkWriter32 writer(100); | 1841 SkWriter32 writer; |
1842 writer.writePath(p); | 1842 writer.writePath(p); |
1843 size_t size = writer.bytesWritten(); | 1843 size_t size = writer.bytesWritten(); |
1844 SkAutoMalloc storage(size); | 1844 SkAutoMalloc storage(size); |
1845 writer.flatten(storage.get()); | 1845 writer.flatten(storage.get()); |
1846 SkReader32 reader(storage.get(), size); | 1846 SkReader32 reader(storage.get(), size); |
1847 | 1847 |
1848 SkPath readBack; | 1848 SkPath readBack; |
1849 REPORTER_ASSERT(reporter, readBack != p); | 1849 REPORTER_ASSERT(reporter, readBack != p); |
1850 reader.readPath(&readBack); | 1850 reader.readPath(&readBack); |
1851 REPORTER_ASSERT(reporter, readBack == p); | 1851 REPORTER_ASSERT(reporter, readBack == p); |
(...skipping 1508 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3360 test_rrect(reporter); | 3360 test_rrect(reporter); |
3361 test_arc(reporter); | 3361 test_arc(reporter); |
3362 test_arcTo(reporter); | 3362 test_arcTo(reporter); |
3363 test_addPath(reporter); | 3363 test_addPath(reporter); |
3364 test_conicTo_special_case(reporter); | 3364 test_conicTo_special_case(reporter); |
3365 test_get_point(reporter); | 3365 test_get_point(reporter); |
3366 test_contains(reporter); | 3366 test_contains(reporter); |
3367 PathTest_Private::TestPathTo(reporter); | 3367 PathTest_Private::TestPathTo(reporter); |
3368 PathRefTest_Private::TestPathRef(reporter); | 3368 PathRefTest_Private::TestPathRef(reporter); |
3369 } | 3369 } |
OLD | NEW |