OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 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 #include "SkRandom.h" | 9 #include "SkRandom.h" |
10 | 10 |
11 namespace skiagm { | 11 namespace skiagm { |
12 | 12 |
13 // This GM draws a lot of arcs in a 'Z' shape. It particularly exercises | 13 // This GM draws a lot of arcs in a 'Z' shape. It particularly exercises |
14 // the 'drawArc' code near a singularly of its processing (i.e., near the | 14 // the 'drawArc' code near a singularly of its processing (i.e., near the |
15 // edge of one of its underlying quads). | 15 // edge of one of its underlying quads). |
16 class ArcOfZorroGM : public GM { | 16 class ArcOfZorroGM : public GM { |
17 public: | 17 public: |
18 ArcOfZorroGM() { | 18 ArcOfZorroGM() { |
19 this->setBGColor(0xFFCCCCCC); | 19 this->setBGColor(0xFFCCCCCC); |
20 } | 20 } |
21 | 21 |
22 protected: | 22 protected: |
23 | 23 |
24 SkString onShortName() SK_OVERRIDE { | 24 SkString onShortName() override { |
25 return SkString("arcofzorro"); | 25 return SkString("arcofzorro"); |
26 } | 26 } |
27 | 27 |
28 SkISize onISize() SK_OVERRIDE { | 28 SkISize onISize() override { |
29 return SkISize::Make(1000, 1000); | 29 return SkISize::Make(1000, 1000); |
30 } | 30 } |
31 | 31 |
32 void onDraw(SkCanvas* canvas) SK_OVERRIDE { | 32 void onDraw(SkCanvas* canvas) override { |
33 SkRandom rand; | 33 SkRandom rand; |
34 | 34 |
35 SkRect rect = SkRect::MakeXYWH(10, 10, 200, 200); | 35 SkRect rect = SkRect::MakeXYWH(10, 10, 200, 200); |
36 | 36 |
37 SkPaint p; | 37 SkPaint p; |
38 | 38 |
39 p.setStyle(SkPaint::kStroke_Style); | 39 p.setStyle(SkPaint::kStroke_Style); |
40 p.setStrokeWidth(35); | 40 p.setStrokeWidth(35); |
41 int xOffset = 0, yOffset = 0; | 41 int xOffset = 0, yOffset = 0; |
42 int direction = 0; | 42 int direction = 0; |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 | 75 |
76 private: | 76 private: |
77 typedef GM INHERITED; | 77 typedef GM INHERITED; |
78 }; | 78 }; |
79 | 79 |
80 ////////////////////////////////////////////////////////////////////////////// | 80 ////////////////////////////////////////////////////////////////////////////// |
81 | 81 |
82 DEF_GM( return SkNEW(ArcOfZorroGM); ) | 82 DEF_GM( return SkNEW(ArcOfZorroGM); ) |
83 | 83 |
84 } | 84 } |
OLD | NEW |