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 <cmath> | 8 #include <cmath> |
9 #include "SkCanvas.h" | 9 #include "SkCanvas.h" |
10 #include "SkGeometry.h" | 10 #include "SkGeometry.h" |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
90 path->lineTo(3.747501373f, 2.724499941f); | 90 path->lineTo(3.747501373f, 2.724499941f); |
91 path->close(); | 91 path->close(); |
92 } | 92 } |
93 | 93 |
94 static void make_path_crbug364224_simplified(SkPath* path) { | 94 static void make_path_crbug364224_simplified(SkPath* path) { |
95 path->moveTo(3.747501373f, 2.724499941f); | 95 path->moveTo(3.747501373f, 2.724499941f); |
96 path->cubicTo(3.648251295f, 0.5194999576f, 3.575501442f, 0.4999999702f, 3.49 7501373f, 0.4999999702f); | 96 path->cubicTo(3.648251295f, 0.5194999576f, 3.575501442f, 0.4999999702f, 3.49 7501373f, 0.4999999702f); |
97 path->close(); | 97 path->close(); |
98 } | 98 } |
99 | 99 |
100 static void make_path_crbug638575(SkPath* path) { | |
101 // Test that sect_with_horizontal in SkLineClipper.cpp needs to pin after co mputing the | |
102 // intersection. | |
103 path->reset(); | |
104 path->moveTo(-540000, -720000); | |
105 path->lineTo(-9.10000017e-05f, 9.99999996e-13f); | |
106 path->lineTo(1, 1); | |
107 } | |
mtklein
2016/08/17 14:06:23
We've dropped any sort of assert here... is this j
reed1
2016/08/17 14:15:02
The line-clipper itself is loaded with the appropr
| |
108 | |
100 static void test_path_crbug364224() { | 109 static void test_path_crbug364224() { |
101 SkPath path; | 110 SkPath path; |
102 SkPaint paint; | 111 SkPaint paint; |
103 auto surface(SkSurface::MakeRasterN32Premul(84, 88)); | 112 auto surface(SkSurface::MakeRasterN32Premul(84, 88)); |
104 SkCanvas* canvas = surface->getCanvas(); | 113 SkCanvas* canvas = surface->getCanvas(); |
105 | 114 |
106 make_path_crbug364224_simplified(&path); | 115 make_path_crbug364224_simplified(&path); |
107 canvas->drawPath(path, paint); | 116 canvas->drawPath(path, paint); |
108 | 117 |
109 make_path_crbug364224(&path); | 118 make_path_crbug364224(&path); |
110 canvas->drawPath(path, paint); | 119 canvas->drawPath(path, paint); |
120 | |
121 make_path_crbug638575(&path); | |
mtklein
2016/08/17 14:06:23
It doesn't look like this has anything to do with
reed1
2016/08/17 14:15:02
True enough. That bug pointed this out, but really
| |
122 canvas->drawPath(path, paint); | |
111 } | 123 } |
112 | 124 |
113 /** | 125 /** |
114 * In debug mode, this path was causing an assertion to fail in | 126 * In debug mode, this path was causing an assertion to fail in |
115 * SkPathStroker::preJoinTo() and, in Release, the use of an unitialized value. | 127 * SkPathStroker::preJoinTo() and, in Release, the use of an unitialized value. |
116 */ | 128 */ |
117 static void make_path_crbugskia2820(SkPath* path, skiatest::Reporter* reporter) { | 129 static void make_path_crbugskia2820(SkPath* path, skiatest::Reporter* reporter) { |
118 SkPoint orig, p1, p2, p3; | 130 SkPoint orig, p1, p2, p3; |
119 orig = SkPoint::Make(1.f, 1.f); | 131 orig = SkPoint::Make(1.f, 1.f); |
120 p1 = SkPoint::Make(1.f - SK_ScalarNearlyZero, 1.f); | 132 p1 = SkPoint::Make(1.f - SK_ScalarNearlyZero, 1.f); |
(...skipping 4257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4378 PathTest_Private::TestPathTo(reporter); | 4390 PathTest_Private::TestPathTo(reporter); |
4379 PathRefTest_Private::TestPathRef(reporter); | 4391 PathRefTest_Private::TestPathRef(reporter); |
4380 PathTest_Private::TestPathrefListeners(reporter); | 4392 PathTest_Private::TestPathrefListeners(reporter); |
4381 test_dump(reporter); | 4393 test_dump(reporter); |
4382 test_path_crbug389050(reporter); | 4394 test_path_crbug389050(reporter); |
4383 test_path_crbugskia2820(reporter); | 4395 test_path_crbugskia2820(reporter); |
4384 test_skbug_3469(reporter); | 4396 test_skbug_3469(reporter); |
4385 test_skbug_3239(reporter); | 4397 test_skbug_3239(reporter); |
4386 test_bounds_crbug_513799(reporter); | 4398 test_bounds_crbug_513799(reporter); |
4387 } | 4399 } |
OLD | NEW |