| 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 |
|
| 8 |
#include "gm/gm.h" |
| 9 |
#include "include/core/SkCanvas.h" |
| 10 |
#include "include/core/SkColor.h" |
| 11 |
#include "include/core/SkPaint.h" |
| 12 |
#include "include/core/SkPath.h" |
| 13 |
#include "include/core/SkPathBuilder.h" |
| 14 |
|
| 15 |
// this draws a small arc scaled up |
| 16 |
// see https://code.google.com/p/chromium/issues/detail?id=102411 |
| 17 |
// and https://code.google.com/p/skia/issues/detail?id=2769 |
| 18 |
DEF_SIMPLE_GM(smallarc, canvas, 762, 762) { |
| 19 |
SkPaint p; |
| 20 |
p.setColor(SK_ColorRED); |
| 21 |
p.setAntiAlias(true); |
| 22 |
p.setStyle(SkPaint::kStroke_Style); |
| 23 |
p.setStrokeWidth(120); |
| 24 |
|
| 25 |
SkPath path = SkPathBuilder() |
| 26 |
.moveTo(75, 0) |
| 27 |
.cubicTo(33.5, 0, 0, 33.5, 0, 75) |
| 28 |
.detach(); |
| 29 |
|
| 30 |
canvas->translate(-400, -400); |
| 31 |
canvas->scale(8, 8); |
| 32 |
canvas->drawPath(path, p); |
| 33 |
} |