OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 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" | |
9 #include "SkBitmapDevice.h" | 8 #include "SkBitmapDevice.h" |
10 #include "SkCanvas.h" | 9 #include "SkCanvas.h" |
11 #include "SkCanvasStateUtils.h" | 10 #include "SkCanvasStateUtils.h" |
12 #include "SkDrawFilter.h" | 11 #include "SkDrawFilter.h" |
13 #include "SkError.h" | 12 #include "SkError.h" |
14 #include "SkPaint.h" | 13 #include "SkPaint.h" |
| 14 #include "SkRRect.h" |
15 #include "SkRect.h" | 15 #include "SkRect.h" |
16 #include "SkRRect.h" | 16 #include "Test.h" |
17 | 17 |
18 static void test_complex_layers(skiatest::Reporter* reporter) { | 18 static void test_complex_layers(skiatest::Reporter* reporter) { |
19 const int WIDTH = 400; | 19 const int WIDTH = 400; |
20 const int HEIGHT = 400; | 20 const int HEIGHT = 400; |
21 const int SPACER = 10; | 21 const int SPACER = 10; |
22 | 22 |
23 SkRect rect = SkRect::MakeXYWH(SkIntToScalar(SPACER), SkIntToScalar(SPACER), | 23 SkRect rect = SkRect::MakeXYWH(SkIntToScalar(SPACER), SkIntToScalar(SPACER), |
24 SkIntToScalar(WIDTH-(2*SPACER)), | 24 SkIntToScalar(WIDTH-(2*SPACER)), |
25 SkIntToScalar((HEIGHT-(2*SPACER)) / 7)); | 25 SkIntToScalar((HEIGHT-(2*SPACER)) / 7)); |
26 | 26 |
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
225 REPORTER_ASSERT(reporter, kInvalidOperation_SkError == SkGetLastError()); | 225 REPORTER_ASSERT(reporter, kInvalidOperation_SkError == SkGetLastError()); |
226 SkClearLastError(); | 226 SkClearLastError(); |
227 } | 227 } |
228 | 228 |
229 DEF_TEST(CanvasState, reporter) { | 229 DEF_TEST(CanvasState, reporter) { |
230 test_complex_layers(reporter); | 230 test_complex_layers(reporter); |
231 test_complex_clips(reporter); | 231 test_complex_clips(reporter); |
232 test_draw_filters(reporter); | 232 test_draw_filters(reporter); |
233 test_soft_clips(reporter); | 233 test_soft_clips(reporter); |
234 } | 234 } |
OLD | NEW |