OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 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 "SkPaint.h" | 8 #include "SkPaint.h" |
9 #include "SkPath.h" | 9 #include "SkPath.h" |
10 #include "SkRect.h" | 10 #include "SkRect.h" |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 paint.setStrokeJoin(joins[i]); | 67 paint.setStrokeJoin(joins[i]); |
68 | 68 |
69 SkPath path, fillPath; | 69 SkPath path, fillPath; |
70 path.addRect(r); | 70 path.addRect(r); |
71 paint.getFillPath(path, &fillPath); | 71 paint.getFillPath(path, &fillPath); |
72 | 72 |
73 REPORTER_ASSERT(reporter, equal(outer, fillPath.getBounds())); | 73 REPORTER_ASSERT(reporter, equal(outer, fillPath.getBounds())); |
74 | 74 |
75 bool isMiter = SkPaint::kMiter_Join == joins[i]; | 75 bool isMiter = SkPaint::kMiter_Join == joins[i]; |
76 SkRect nested[2]; | 76 SkRect nested[2]; |
77 REPORTER_ASSERT(reporter, fillPath.isNestedRects(nested) == isMiter); | 77 REPORTER_ASSERT(reporter, fillPath.isNestedFillRects(nested) == isMiter)
; |
78 if (isMiter) { | 78 if (isMiter) { |
79 SkRect inner(r); | 79 SkRect inner(r); |
80 inner.inset(width/2, width/2); | 80 inner.inset(width/2, width/2); |
81 REPORTER_ASSERT(reporter, equal(nested[0], outer)); | 81 REPORTER_ASSERT(reporter, equal(nested[0], outer)); |
82 REPORTER_ASSERT(reporter, equal(nested[1], inner)); | 82 REPORTER_ASSERT(reporter, equal(nested[1], inner)); |
83 } | 83 } |
84 } | 84 } |
85 } | 85 } |
86 | 86 |
87 DEF_TEST(Stroke, reporter) { | 87 DEF_TEST(Stroke, reporter) { |
88 test_strokecubic(reporter); | 88 test_strokecubic(reporter); |
89 test_strokerect(reporter); | 89 test_strokerect(reporter); |
90 } | 90 } |
OLD | NEW |