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 "gm.h" | 8 #include "gm.h" |
9 #include "SkCanvas.h" | 9 #include "SkCanvas.h" |
10 #include "SkPathPriv.h" | 10 #include "SkPathPriv.h" |
(...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
324 | 324 |
325 r = SkRect::MakeXYWH(x + SkIntToScalar(310), y + SkIntToScalar(280), | 325 r = SkRect::MakeXYWH(x + SkIntToScalar(310), y + SkIntToScalar(280), |
326 SkIntToScalar(100), SkIntToScalar(100)); | 326 SkIntToScalar(100), SkIntToScalar(100)); |
327 path4.reset(); | 327 path4.reset(); |
328 SkASSERT(!SkPathPriv::CheapComputeFirstDirection(path4, nullptr)); | 328 SkASSERT(!SkPathPriv::CheapComputeFirstDirection(path4, nullptr)); |
329 path4.addRect(r, SkPath::kCW_Direction); | 329 path4.addRect(r, SkPath::kCW_Direction); |
330 SkASSERT(SkPathPriv::CheapIsFirstDirection(path4, SkPathPriv::kCW_FirstD
irection)); | 330 SkASSERT(SkPathPriv::CheapIsFirstDirection(path4, SkPathPriv::kCW_FirstD
irection)); |
331 path4.moveTo(0, 0); // test for crbug.com/247770 | 331 path4.moveTo(0, 0); // test for crbug.com/247770 |
332 canvas->drawPath(path4, paint); | 332 canvas->drawPath(path4, paint); |
333 } | 333 } |
| 334 |
| 335 DEF_SIMPLE_GM(bug339297, canvas, 640, 480) { |
| 336 SkPath path; |
| 337 path.moveTo(-469515, -10354890); |
| 338 path.cubicTo(771919.62f, -10411179, 2013360.1f, -10243774, 3195542.8f, -9860
664); |
| 339 path.lineTo(3195550, -9860655); |
| 340 path.lineTo(3195539, -9860652); |
| 341 path.lineTo(3195539, -9860652); |
| 342 path.lineTo(3195539, -9860652); |
| 343 path.cubicTo(2013358.1f, -10243761, 771919.25f, -10411166, -469513.84f, -103
54877); |
| 344 path.lineTo(-469515, -10354890); |
| 345 path.close(); |
| 346 |
| 347 canvas->translate(258, 10365663); |
| 348 |
| 349 SkPaint paint; |
| 350 paint.setAntiAlias(true); |
| 351 paint.setColor(SK_ColorBLACK); |
| 352 paint.setStyle(SkPaint::kFill_Style); |
| 353 canvas->drawPath(path, paint); |
| 354 |
| 355 paint.setColor(SK_ColorRED); |
| 356 paint.setStyle(SkPaint::kStroke_Style); |
| 357 paint.setStrokeWidth(1); |
| 358 canvas->drawPath(path, paint); |
| 359 } |
OLD | NEW |