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 | 9 |
10 namespace skiagm { | 10 namespace skiagm { |
11 | 11 |
12 // Draw various width thin rects at 1/8 horizontal pixel increments | 12 // Draw various width thin rects at 1/8 horizontal pixel increments |
13 class ThinRectsGM : public GM { | 13 class ThinRectsGM : public GM { |
14 public: | 14 public: |
15 ThinRectsGM() { | 15 ThinRectsGM() { |
16 this->setBGColor(0xFF000000); | 16 this->setBGColor(0xFF000000); |
17 } | 17 } |
18 | 18 |
19 protected: | 19 protected: |
20 SkString onShortName() SK_OVERRIDE { | 20 SkString onShortName() override { |
21 return SkString("thinrects"); | 21 return SkString("thinrects"); |
22 } | 22 } |
23 | 23 |
24 SkISize onISize() SK_OVERRIDE { | 24 SkISize onISize() override { |
25 return SkISize::Make(240, 320); | 25 return SkISize::Make(240, 320); |
26 } | 26 } |
27 | 27 |
28 void onDraw(SkCanvas* canvas) SK_OVERRIDE { | 28 void onDraw(SkCanvas* canvas) override { |
29 | 29 |
30 SkPaint white; | 30 SkPaint white; |
31 white.setColor(SK_ColorWHITE); | 31 white.setColor(SK_ColorWHITE); |
32 white.setAntiAlias(true); | 32 white.setAntiAlias(true); |
33 | 33 |
34 SkPaint green; | 34 SkPaint green; |
35 green.setColor(SK_ColorGREEN); | 35 green.setColor(SK_ColorGREEN); |
36 green.setAntiAlias(true); | 36 green.setAntiAlias(true); |
37 | 37 |
38 for (int i = 0; i < 8; ++i) { | 38 for (int i = 0; i < 8; ++i) { |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 | 114 |
115 typedef GM INHERITED; | 115 typedef GM INHERITED; |
116 }; | 116 }; |
117 | 117 |
118 ////////////////////////////////////////////////////////////////////////////// | 118 ////////////////////////////////////////////////////////////////////////////// |
119 | 119 |
120 static GM* MyFactory(void*) { return new ThinRectsGM; } | 120 static GM* MyFactory(void*) { return new ThinRectsGM; } |
121 static GMRegistry reg(MyFactory); | 121 static GMRegistry reg(MyFactory); |
122 | 122 |
123 } | 123 } |
OLD | NEW |