Chromium Code Reviews| 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 "SkPaint.h" | 9 #include "SkPaint.h" |
| 10 #include "SkParse.h" | 10 #include "SkParse.h" |
| 11 #include "SkParsePath.h" | 11 #include "SkParsePath.h" |
| 12 #include "SkPath.h" | 12 #include "SkPath.h" |
| 13 #include "SkPathEffect.h" | 13 #include "SkPathEffect.h" |
| 14 #include "SkRRect.h" | 14 #include "SkRRect.h" |
| 15 #include "SkRandom.h" | 15 #include "SkRandom.h" |
| 16 #include "SkReader32.h" | 16 #include "SkReader32.h" |
| 17 #include "SkSize.h" | 17 #include "SkSize.h" |
| 18 #include "SkStream.h" | 18 #include "SkStream.h" |
| 19 #include "SkSurface.h" | 19 #include "SkSurface.h" |
| 20 #include "SkTypes.h" | 20 #include "SkTypes.h" |
| 21 #include "SkWriter32.h" | 21 #include "SkWriter32.h" |
| 22 #include "Test.h" | 22 #include "Test.h" |
| 23 | 23 |
| 24 static void test_skbug_3239(skiatest::Reporter* reporter) { | |
| 25 const SkRect rect = SkRect::MakeLTRB(SkBits2Float(0xcb7f16c8), /* -16717512 .000000 */ | |
| 26 SkBits2Float(0xcb7f16c8), /* -16717512 .000000 */ | |
| 27 SkBits2Float(0x4b7f1c1d), /* 16718877. 000000 */ | |
| 28 SkBits2Float(0x4b7f1bd7)); /* 16718807. 000000 */ | |
|
robertphillips
2014/12/15 19:13:21
Can we test the four variants having the huge radi
reed1
2014/12/15 19:58:28
Done.
| |
| 29 const SkVector radii[] = { | |
| 30 { 0, 0 }, | |
| 31 { 0, 0 }, | |
| 32 { 0, 0 }, | |
| 33 { 33436320, 33436320 }, | |
| 34 }; | |
| 35 SkRRect rrect; | |
| 36 rrect.setRectRadii(rect, radii); | |
| 37 | |
| 38 SkPath path; | |
| 39 // this line should not assert in the debug build (from validate) | |
| 40 path.addRRect(rrect); | |
| 41 REPORTER_ASSERT(reporter, rrect.rect() == path.getBounds()); | |
| 42 } | |
| 43 | |
| 24 static void make_path_crbug364224(SkPath* path) { | 44 static void make_path_crbug364224(SkPath* path) { |
| 25 path->reset(); | 45 path->reset(); |
| 26 path->moveTo(3.747501373f, 2.724499941f); | 46 path->moveTo(3.747501373f, 2.724499941f); |
| 27 path->lineTo(3.747501373f, 3.75f); | 47 path->lineTo(3.747501373f, 3.75f); |
| 28 path->cubicTo(3.747501373f, 3.88774991f, 3.635501385f, 4.0f, 3.497501373f, 4 .0f); | 48 path->cubicTo(3.747501373f, 3.88774991f, 3.635501385f, 4.0f, 3.497501373f, 4 .0f); |
| 29 path->lineTo(0.7475013733f, 4.0f); | 49 path->lineTo(0.7475013733f, 4.0f); |
| 30 path->cubicTo(0.6095013618f, 4.0f, 0.4975013733f, 3.88774991f, 0.4975013733f , 3.75f); | 50 path->cubicTo(0.6095013618f, 4.0f, 0.4975013733f, 3.88774991f, 0.4975013733f , 3.75f); |
| 31 path->lineTo(0.4975013733f, 1.0f); | 51 path->lineTo(0.4975013733f, 1.0f); |
| 32 path->cubicTo(0.4975013733f, 0.8622499704f, 0.6095013618f, 0.75f, 0.74750137 33f,0.75f); | 52 path->cubicTo(0.4975013733f, 0.8622499704f, 0.6095013618f, 0.75f, 0.74750137 33f,0.75f); |
| 33 path->lineTo(3.497501373f, 0.75f); | 53 path->lineTo(3.497501373f, 0.75f); |
| (...skipping 3688 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3722 test_extendClosedPath(reporter); | 3742 test_extendClosedPath(reporter); |
| 3723 test_addEmptyPath(reporter, SkPath::kExtend_AddPathMode); | 3743 test_addEmptyPath(reporter, SkPath::kExtend_AddPathMode); |
| 3724 test_addEmptyPath(reporter, SkPath::kAppend_AddPathMode); | 3744 test_addEmptyPath(reporter, SkPath::kAppend_AddPathMode); |
| 3725 test_conicTo_special_case(reporter); | 3745 test_conicTo_special_case(reporter); |
| 3726 test_get_point(reporter); | 3746 test_get_point(reporter); |
| 3727 test_contains(reporter); | 3747 test_contains(reporter); |
| 3728 PathTest_Private::TestPathTo(reporter); | 3748 PathTest_Private::TestPathTo(reporter); |
| 3729 PathRefTest_Private::TestPathRef(reporter); | 3749 PathRefTest_Private::TestPathRef(reporter); |
| 3730 test_dump(reporter); | 3750 test_dump(reporter); |
| 3731 test_path_crbugskia2820(reporter); | 3751 test_path_crbugskia2820(reporter); |
| 3752 test_skbug_3239(reporter); | |
| 3732 } | 3753 } |
| OLD | NEW |