| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 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 | 9 |
| 10 namespace skiagm { | 10 namespace skiagm { |
| 11 | 11 |
| 12 // this draws a small arc scaled up | 12 // this draws a small arc scaled up |
| 13 // see https://code.google.com/p/chromium/issues/detail?id=102411 | 13 // see https://code.google.com/p/chromium/issues/detail?id=102411 |
| 14 // and https://code.google.com/p/skia/issues/detail?id=2769 | 14 // and https://code.google.com/p/skia/issues/detail?id=2769 |
| 15 class SmallArcGM : public GM { | 15 class SmallArcGM : public GM { |
| 16 public: | 16 public: |
| 17 SmallArcGM() { | 17 SmallArcGM() { |
| 18 } | 18 } |
| 19 | 19 |
| 20 protected: | 20 protected: |
| 21 | 21 |
| 22 SkString onShortName() SK_OVERRIDE { | 22 SkString onShortName() override { |
| 23 return SkString("smallarc"); | 23 return SkString("smallarc"); |
| 24 } | 24 } |
| 25 | 25 |
| 26 SkISize onISize() SK_OVERRIDE { | 26 SkISize onISize() override { |
| 27 return SkISize::Make(762, 762); | 27 return SkISize::Make(762, 762); |
| 28 } | 28 } |
| 29 | 29 |
| 30 void onDraw(SkCanvas* canvas) SK_OVERRIDE { | 30 void onDraw(SkCanvas* canvas) override { |
| 31 SkPaint p; | 31 SkPaint p; |
| 32 p.setColor(SK_ColorRED); | 32 p.setColor(SK_ColorRED); |
| 33 p.setAntiAlias(true); | 33 p.setAntiAlias(true); |
| 34 p.setStyle(SkPaint::kStroke_Style); | 34 p.setStyle(SkPaint::kStroke_Style); |
| 35 p.setStrokeWidth(120); | 35 p.setStrokeWidth(120); |
| 36 | 36 |
| 37 SkPath path; | 37 SkPath path; |
| 38 path.moveTo(75, 0); | 38 path.moveTo(75, 0); |
| 39 path.cubicTo(33.5, 0, 0, 33.5, 0, 75); | 39 path.cubicTo(33.5, 0, 0, 33.5, 0, 75); |
| 40 | 40 |
| 41 canvas->translate(-400, -400); | 41 canvas->translate(-400, -400); |
| 42 canvas->scale(8, 8); | 42 canvas->scale(8, 8); |
| 43 canvas->drawPath(path, p); | 43 canvas->drawPath(path, p); |
| 44 } | 44 } |
| 45 | 45 |
| 46 private: | 46 private: |
| 47 typedef GM INHERITED; | 47 typedef GM INHERITED; |
| 48 }; | 48 }; |
| 49 | 49 |
| 50 ////////////////////////////////////////////////////////////////////////////// | 50 ////////////////////////////////////////////////////////////////////////////// |
| 51 | 51 |
| 52 DEF_GM( return SkNEW(SmallArcGM); ) | 52 DEF_GM( return SkNEW(SmallArcGM); ) |
| 53 | 53 |
| 54 } | 54 } |
| OLD | NEW |