| OLD | NEW |
| 1 | |
| 2 /* | 1 /* |
| 3 * Copyright 2011 Google Inc. | 2 * Copyright 2011 Google Inc. |
| 4 * | 3 * |
| 5 * 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 |
| 6 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 7 */ | 6 */ |
| 7 |
| 8 #include "Test.h" | 8 #include "Test.h" |
| 9 #include "TestClassDef.h" |
| 9 #if SK_SUPPORT_GPU | 10 #if SK_SUPPORT_GPU |
| 10 #include "GrReducedClip.h" | 11 #include "GrReducedClip.h" |
| 11 #endif | 12 #endif |
| 12 #include "SkClipStack.h" | 13 #include "SkClipStack.h" |
| 13 #include "SkPath.h" | 14 #include "SkPath.h" |
| 14 #include "SkRandom.h" | 15 #include "SkRandom.h" |
| 15 #include "SkRect.h" | 16 #include "SkRect.h" |
| 16 #include "SkRegion.h" | 17 #include "SkRegion.h" |
| 17 | 18 |
| 18 | |
| 19 static void test_assign_and_comparison(skiatest::Reporter* reporter) { | 19 static void test_assign_and_comparison(skiatest::Reporter* reporter) { |
| 20 SkClipStack s; | 20 SkClipStack s; |
| 21 bool doAA = false; | 21 bool doAA = false; |
| 22 | 22 |
| 23 REPORTER_ASSERT(reporter, 0 == s.getSaveCount()); | 23 REPORTER_ASSERT(reporter, 0 == s.getSaveCount()); |
| 24 | 24 |
| 25 // Build up a clip stack with a path, an empty clip, and a rect. | 25 // Build up a clip stack with a path, an empty clip, and a rect. |
| 26 s.save(); | 26 s.save(); |
| 27 REPORTER_ASSERT(reporter, 1 == s.getSaveCount()); | 27 REPORTER_ASSERT(reporter, 1 == s.getSaveCount()); |
| 28 | 28 |
| (...skipping 1123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1152 inflatedIBounds, | 1152 inflatedIBounds, |
| 1153 &reducedClips, | 1153 &reducedClips, |
| 1154 &reducedGenID, | 1154 &reducedGenID, |
| 1155 &initial, | 1155 &initial, |
| 1156 &tightBounds); | 1156 &tightBounds); |
| 1157 | 1157 |
| 1158 REPORTER_ASSERT(reporter, 0 == reducedClips.count()); | 1158 REPORTER_ASSERT(reporter, 0 == reducedClips.count()); |
| 1159 } | 1159 } |
| 1160 | 1160 |
| 1161 #endif | 1161 #endif |
| 1162 ////////////////////////////////////////////////////////////////////////////////
/////////////////// | |
| 1163 | 1162 |
| 1164 static void TestClipStack(skiatest::Reporter* reporter) { | 1163 DEF_TEST(ClipStack, reporter) { |
| 1165 SkClipStack stack; | 1164 SkClipStack stack; |
| 1166 | 1165 |
| 1167 REPORTER_ASSERT(reporter, 0 == stack.getSaveCount()); | 1166 REPORTER_ASSERT(reporter, 0 == stack.getSaveCount()); |
| 1168 assert_count(reporter, stack, 0); | 1167 assert_count(reporter, stack, 0); |
| 1169 | 1168 |
| 1170 static const SkIRect gRects[] = { | 1169 static const SkIRect gRects[] = { |
| 1171 { 0, 0, 100, 100 }, | 1170 { 0, 0, 100, 100 }, |
| 1172 { 25, 25, 125, 125 }, | 1171 { 25, 25, 125, 125 }, |
| 1173 { 0, 0, 1000, 1000 }, | 1172 { 0, 0, 1000, 1000 }, |
| 1174 { 0, 0, 75, 75 } | 1173 { 0, 0, 75, 75 } |
| (...skipping 28 matching lines...) Expand all Loading... |
| 1203 test_rect_replace(reporter); | 1202 test_rect_replace(reporter); |
| 1204 test_rect_inverse_fill(reporter); | 1203 test_rect_inverse_fill(reporter); |
| 1205 test_path_replace(reporter); | 1204 test_path_replace(reporter); |
| 1206 test_quickContains(reporter); | 1205 test_quickContains(reporter); |
| 1207 #if SK_SUPPORT_GPU | 1206 #if SK_SUPPORT_GPU |
| 1208 test_reduced_clip_stack(reporter); | 1207 test_reduced_clip_stack(reporter); |
| 1209 test_reduced_clip_stack_genid(reporter); | 1208 test_reduced_clip_stack_genid(reporter); |
| 1210 test_reduced_clip_stack_no_aa_crash(reporter); | 1209 test_reduced_clip_stack_no_aa_crash(reporter); |
| 1211 #endif | 1210 #endif |
| 1212 } | 1211 } |
| 1213 | |
| 1214 #include "TestClassDef.h" | |
| 1215 DEFINE_TESTCLASS("ClipStack", TestClipStackClass, TestClipStack) | |
| OLD | NEW |