OLD | NEW |
(Empty) | |
| 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.h" |
| 9 |
| 10 namespace 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 |
| 15 class SmallArcGM : public GM { |
| 16 public: |
| 17 SmallArcGM() { |
| 18 } |
| 19 |
| 20 protected: |
| 21 |
| 22 virtual SkString onShortName() SK_OVERRIDE { |
| 23 return SkString("smallarc"); |
| 24 } |
| 25 |
| 26 virtual SkISize onISize() SK_OVERRIDE { |
| 27 return SkISize::Make(762, 762); |
| 28 } |
| 29 |
| 30 virtual void onDraw(SkCanvas* canvas) SK_OVERRIDE { |
| 31 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 |
| 46 private: |
| 47 typedef GM INHERITED; |
| 48 }; |
| 49 |
| 50 ////////////////////////////////////////////////////////////////////////////// |
| 51 |
| 52 DEF_GM( return SkNEW(SmallArcGM); ) |
| 53 |
| 54 } |
OLD | NEW |