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 4226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4237 SkBits2Float(0x423fcdcd), SkBits2Float(0x40ed9341)); | 4237 SkBits2Float(0x423fcdcd), SkBits2Float(0x40ed9341)); |
4238 // AKA: cubicTo(-4.31596e+08f, -4.31602e+08f, -4.31602e+08f, -4.31602e+08f, 47.
951f, 7.42423f); | 4238 // AKA: cubicTo(-4.31596e+08f, -4.31602e+08f, -4.31602e+08f, -4.31602e+08f, 47.
951f, 7.42423f); |
4239 path.lineTo(0, 0); | 4239 path.lineTo(0, 0); |
4240 | 4240 |
4241 auto surface = SkSurface::MakeRasterN32Premul(100, 100); | 4241 auto surface = SkSurface::MakeRasterN32Premul(100, 100); |
4242 SkPaint paint; | 4242 SkPaint paint; |
4243 paint.setAntiAlias(true); | 4243 paint.setAntiAlias(true); |
4244 surface->getCanvas()->drawPath(path, paint); | 4244 surface->getCanvas()->drawPath(path, paint); |
4245 } | 4245 } |
4246 | 4246 |
| 4247 static void test_fuzz_crbug_662952(skiatest::Reporter* reporter) { |
| 4248 SkPath path; |
| 4249 path.moveTo(SkBits2Float(0x4109999a), SkBits2Float(0x411c0000)); // 8.6f, 9
.75f |
| 4250 path.lineTo(SkBits2Float(0x410a6666), SkBits2Float(0x411c0000)); // 8.65f,
9.75f |
| 4251 path.lineTo(SkBits2Float(0x410a6666), SkBits2Float(0x411e6666)); // 8.65f,
9.9f |
| 4252 path.lineTo(SkBits2Float(0x4109999a), SkBits2Float(0x411e6666)); // 8.6f, 9
.9f |
| 4253 path.lineTo(SkBits2Float(0x4109999a), SkBits2Float(0x411c0000)); // 8.6f, 9
.75f |
| 4254 path.close(); |
| 4255 |
| 4256 auto surface = SkSurface::MakeRasterN32Premul(100, 100); |
| 4257 SkPaint paint; |
| 4258 paint.setAntiAlias(true); |
| 4259 surface->getCanvas()->clipPath(path, true); |
| 4260 surface->getCanvas()->drawRectCoords(0, 0, 100, 100, paint); |
| 4261 } |
| 4262 |
4247 static void test_interp(skiatest::Reporter* reporter) { | 4263 static void test_interp(skiatest::Reporter* reporter) { |
4248 SkPath p1, p2, out; | 4264 SkPath p1, p2, out; |
4249 REPORTER_ASSERT(reporter, p1.isInterpolatable(p2)); | 4265 REPORTER_ASSERT(reporter, p1.isInterpolatable(p2)); |
4250 REPORTER_ASSERT(reporter, p1.interpolate(p2, 0, &out)); | 4266 REPORTER_ASSERT(reporter, p1.interpolate(p2, 0, &out)); |
4251 REPORTER_ASSERT(reporter, p1 == out); | 4267 REPORTER_ASSERT(reporter, p1 == out); |
4252 REPORTER_ASSERT(reporter, p1.interpolate(p2, 1, &out)); | 4268 REPORTER_ASSERT(reporter, p1.interpolate(p2, 1, &out)); |
4253 REPORTER_ASSERT(reporter, p1 == out); | 4269 REPORTER_ASSERT(reporter, p1 == out); |
4254 p1.moveTo(0, 2); | 4270 p1.moveTo(0, 2); |
4255 p1.lineTo(0, 4); | 4271 p1.lineTo(0, 4); |
4256 REPORTER_ASSERT(reporter, !p1.isInterpolatable(p2)); | 4272 REPORTER_ASSERT(reporter, !p1.isInterpolatable(p2)); |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4291 test_contains(reporter); | 4307 test_contains(reporter); |
4292 } | 4308 } |
4293 | 4309 |
4294 DEF_TEST(Paths, reporter) { | 4310 DEF_TEST(Paths, reporter) { |
4295 test_fuzz_crbug_647922(); | 4311 test_fuzz_crbug_647922(); |
4296 test_fuzz_crbug_643933(); | 4312 test_fuzz_crbug_643933(); |
4297 test_sect_with_horizontal_needs_pinning(); | 4313 test_sect_with_horizontal_needs_pinning(); |
4298 test_crbug_629455(reporter); | 4314 test_crbug_629455(reporter); |
4299 test_fuzz_crbug_627414(reporter); | 4315 test_fuzz_crbug_627414(reporter); |
4300 test_path_crbug364224(); | 4316 test_path_crbug364224(); |
| 4317 test_fuzz_crbug_662952(reporter); |
4301 | 4318 |
4302 SkTSize<SkScalar>::Make(3,4); | 4319 SkTSize<SkScalar>::Make(3,4); |
4303 | 4320 |
4304 SkPath p, empty; | 4321 SkPath p, empty; |
4305 SkRect bounds, bounds2; | 4322 SkRect bounds, bounds2; |
4306 test_empty(reporter, p); | 4323 test_empty(reporter, p); |
4307 | 4324 |
4308 REPORTER_ASSERT(reporter, p.getBounds().isEmpty()); | 4325 REPORTER_ASSERT(reporter, p.getBounds().isEmpty()); |
4309 | 4326 |
4310 // this triggers a code path in SkPath::operator= which is otherwise unexerc
ised | 4327 // this triggers a code path in SkPath::operator= which is otherwise unexerc
ised |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4446 PathRefTest_Private::TestPathRef(reporter); | 4463 PathRefTest_Private::TestPathRef(reporter); |
4447 PathTest_Private::TestPathrefListeners(reporter); | 4464 PathTest_Private::TestPathrefListeners(reporter); |
4448 test_dump(reporter); | 4465 test_dump(reporter); |
4449 test_path_crbug389050(reporter); | 4466 test_path_crbug389050(reporter); |
4450 test_path_crbugskia2820(reporter); | 4467 test_path_crbugskia2820(reporter); |
4451 test_skbug_3469(reporter); | 4468 test_skbug_3469(reporter); |
4452 test_skbug_3239(reporter); | 4469 test_skbug_3239(reporter); |
4453 test_bounds_crbug_513799(reporter); | 4470 test_bounds_crbug_513799(reporter); |
4454 test_fuzz_crbug_638223(); | 4471 test_fuzz_crbug_638223(); |
4455 } | 4472 } |
OLD | NEW |