caryclark | feff7d2 | 2014-10-09 05:36:03 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2014 Google Inc. |
| 3 | * |
| 4 | * Use of this source code is governed by a BSD-style license that can be |
| 5 | * found in the LICENSE file. |
| 6 | */ |
| 7 | |
Mike Klein | c0bd9f9 | 2019-04-23 12:05:21 -0500 | [diff] [blame] | 8 | #include "gm/gm.h" |
Ben Wagner | 7fde8e1 | 2019-05-01 17:28:53 -0400 | [diff] [blame] | 9 | #include "include/core/SkCanvas.h" |
| 10 | #include "include/core/SkColor.h" |
| 11 | #include "include/core/SkPaint.h" |
Mike Klein | c0bd9f9 | 2019-04-23 12:05:21 -0500 | [diff] [blame] | 12 | #include "include/core/SkPath.h" |
caryclark | feff7d2 | 2014-10-09 05:36:03 -0700 | [diff] [blame] | 13 | |
caryclark | feff7d2 | 2014-10-09 05:36:03 -0700 | [diff] [blame] | 14 | // this draws a small arc scaled up |
| 15 | // see https://code.google.com/p/chromium/issues/detail?id=102411 |
| 16 | // and https://code.google.com/p/skia/issues/detail?id=2769 |
halcanary | 2a24338 | 2015-09-09 08:16:41 -0700 | [diff] [blame] | 17 | DEF_SIMPLE_GM(smallarc, canvas, 762, 762) { |
caryclark | feff7d2 | 2014-10-09 05:36:03 -0700 | [diff] [blame] | 18 | SkPaint p; |
| 19 | p.setColor(SK_ColorRED); |
| 20 | p.setAntiAlias(true); |
| 21 | p.setStyle(SkPaint::kStroke_Style); |
| 22 | p.setStrokeWidth(120); |
| 23 | |
| 24 | SkPath path; |
| 25 | path.moveTo(75, 0); |
| 26 | path.cubicTo(33.5, 0, 0, 33.5, 0, 75); |
| 27 | |
| 28 | canvas->translate(-400, -400); |
| 29 | canvas->scale(8, 8); |
| 30 | canvas->drawPath(path, p); |
caryclark | feff7d2 | 2014-10-09 05:36:03 -0700 | [diff] [blame] | 31 | } |