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 "SkCanvas.h" | 8 #include "SkCanvas.h" |
9 #include "SkEdgeClipper.h" | 9 #include "SkEdgeClipper.h" |
10 #include "SkLineClipper.h" | 10 #include "SkLineClipper.h" |
(...skipping 30 matching lines...) Expand all Loading... |
41 if (nonWhite) { | 41 if (nonWhite) { |
42 REPORTER_ASSERT(reporter, 0xFFFFFFFF != c); | 42 REPORTER_ASSERT(reporter, 0xFFFFFFFF != c); |
43 } else { | 43 } else { |
44 REPORTER_ASSERT(reporter, 0xFFFFFFFF == c); | 44 REPORTER_ASSERT(reporter, 0xFFFFFFFF == c); |
45 } | 45 } |
46 } | 46 } |
47 } | 47 } |
48 } | 48 } |
49 | 49 |
50 static void test_edgeclipper() { | 50 static void test_edgeclipper() { |
51 SkEdgeClipper clipper; | 51 SkEdgeClipper clipper(false); |
52 | 52 |
53 const SkPoint pts[] = { | 53 const SkPoint pts[] = { |
54 { 3.0995476e+010f, 42.929779f }, | 54 { 3.0995476e+010f, 42.929779f }, |
55 { -3.0995163e+010f, 51.050385f }, | 55 { -3.0995163e+010f, 51.050385f }, |
56 { -3.0995157e+010f, 51.050392f }, | 56 { -3.0995157e+010f, 51.050392f }, |
57 { -3.0995134e+010f, 51.050400f }, | 57 { -3.0995134e+010f, 51.050400f }, |
58 }; | 58 }; |
59 | 59 |
60 const SkRect clip = { 0, 0, SkIntToScalar(300), SkIntToScalar(200) }; | 60 const SkRect clip = { 0, 0, SkIntToScalar(300), SkIntToScalar(200) }; |
61 | 61 |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 !memcmp(&gPartial[i+2], dst, sizeof(dst))); | 141 !memcmp(&gPartial[i+2], dst, sizeof(dst))); |
142 } | 142 } |
143 | 143 |
144 } | 144 } |
145 | 145 |
146 DEF_TEST(Clipper, reporter) { | 146 DEF_TEST(Clipper, reporter) { |
147 test_intersectline(reporter); | 147 test_intersectline(reporter); |
148 test_edgeclipper(); | 148 test_edgeclipper(); |
149 test_hairclipping(reporter); | 149 test_hairclipping(reporter); |
150 } | 150 } |
OLD | NEW |