blob: 76611b763c07e37e93513918f8d8c8b629b28590 [file] [log] [blame]
caryclarkfeff7d22014-10-09 05:36:03 -07001/*
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.h"
9
10namespace skiagm {
11
12// this draws a small arc scaled up
13// see https://code.google.com/p/chromium/issues/detail?id=102411
14// and https://code.google.com/p/skia/issues/detail?id=2769
15class SmallArcGM : public GM {
16public:
17 SmallArcGM() {
18 }
19
20protected:
21
mtklein36352bf2015-03-25 18:17:31 -070022 SkString onShortName() override {
caryclarkfeff7d22014-10-09 05:36:03 -070023 return SkString("smallarc");
24 }
25
mtklein36352bf2015-03-25 18:17:31 -070026 SkISize onISize() override {
caryclarkfeff7d22014-10-09 05:36:03 -070027 return SkISize::Make(762, 762);
28 }
29
mtklein36352bf2015-03-25 18:17:31 -070030 void onDraw(SkCanvas* canvas) override {
caryclarkfeff7d22014-10-09 05:36:03 -070031 SkPaint p;
32 p.setColor(SK_ColorRED);
33 p.setAntiAlias(true);
34 p.setStyle(SkPaint::kStroke_Style);
35 p.setStrokeWidth(120);
36
37 SkPath path;
38 path.moveTo(75, 0);
39 path.cubicTo(33.5, 0, 0, 33.5, 0, 75);
40
41 canvas->translate(-400, -400);
42 canvas->scale(8, 8);
43 canvas->drawPath(path, p);
44 }
45
46private:
47 typedef GM INHERITED;
48};
49
50//////////////////////////////////////////////////////////////////////////////
51
52DEF_GM( return SkNEW(SmallArcGM); )
53
54}