OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2011 Google Inc. | 3 * Copyright 2011 Google Inc. |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 #include "Test.h" | 8 #include "Test.h" |
9 #include "SkCanvas.h" | 9 #include "SkCanvas.h" |
10 #include "SkPaint.h" | 10 #include "SkPaint.h" |
(...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
358 make_arb_round_rect(&temp, r, 0, 0); | 358 make_arb_round_rect(&temp, r, 0, 0); |
359 | 359 |
360 SkRect result; | 360 SkRect result; |
361 REPORTER_ASSERT(reporter, temp.isRect(&result)); | 361 REPORTER_ASSERT(reporter, temp.isRect(&result)); |
362 REPORTER_ASSERT(reporter, r == result); | 362 REPORTER_ASSERT(reporter, r == result); |
363 } | 363 } |
364 } | 364 } |
365 | 365 |
366 static void test_rect_isfinite(skiatest::Reporter* reporter) { | 366 static void test_rect_isfinite(skiatest::Reporter* reporter) { |
367 const SkScalar inf = SK_ScalarInfinity; | 367 const SkScalar inf = SK_ScalarInfinity; |
| 368 const SkScalar negInf = SK_ScalarNegativeInfinity; |
368 const SkScalar nan = SK_ScalarNaN; | 369 const SkScalar nan = SK_ScalarNaN; |
369 | 370 |
370 SkRect r; | 371 SkRect r; |
371 r.setEmpty(); | 372 r.setEmpty(); |
372 REPORTER_ASSERT(reporter, r.isFinite()); | 373 REPORTER_ASSERT(reporter, r.isFinite()); |
373 r.set(0, 0, inf, -inf); | 374 r.set(0, 0, inf, negInf); |
374 REPORTER_ASSERT(reporter, !r.isFinite()); | 375 REPORTER_ASSERT(reporter, !r.isFinite()); |
375 r.set(0, 0, nan, 0); | 376 r.set(0, 0, nan, 0); |
376 REPORTER_ASSERT(reporter, !r.isFinite()); | 377 REPORTER_ASSERT(reporter, !r.isFinite()); |
377 | 378 |
378 SkPoint pts[] = { | 379 SkPoint pts[] = { |
379 { 0, 0 }, | 380 { 0, 0 }, |
380 { SK_Scalar1, 0 }, | 381 { SK_Scalar1, 0 }, |
381 { 0, SK_Scalar1 }, | 382 { 0, SK_Scalar1 }, |
382 }; | 383 }; |
383 | 384 |
(...skipping 1989 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2373 test_arb_zero_rad_round_rect_is_rect(reporter); | 2374 test_arb_zero_rad_round_rect_is_rect(reporter); |
2374 test_addrect_isfinite(reporter); | 2375 test_addrect_isfinite(reporter); |
2375 test_tricky_cubic(); | 2376 test_tricky_cubic(); |
2376 test_clipped_cubic(); | 2377 test_clipped_cubic(); |
2377 test_crbug_170666(); | 2378 test_crbug_170666(); |
2378 test_bad_cubic_crbug229478(); | 2379 test_bad_cubic_crbug229478(); |
2379 } | 2380 } |
2380 | 2381 |
2381 #include "TestClassDef.h" | 2382 #include "TestClassDef.h" |
2382 DEFINE_TESTCLASS("Path", PathTestClass, TestPath) | 2383 DEFINE_TESTCLASS("Path", PathTestClass, TestPath) |
OLD | NEW |