OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 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 "SkCanvas.h" | 9 #include "SkCanvas.h" |
10 #include "SkColorPriv.h" | 10 #include "SkColorPriv.h" |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 SkShader::kRepeat_TileMode, | 71 SkShader::kRepeat_TileMode, |
72 &m); | 72 &m); |
73 } | 73 } |
74 | 74 |
75 namespace skiagm { | 75 namespace skiagm { |
76 | 76 |
77 class HairModesGM : public GM { | 77 class HairModesGM : public GM { |
78 SkPaint fBGPaint; | 78 SkPaint fBGPaint; |
79 | 79 |
80 protected: | 80 protected: |
81 SkString onShortName() SK_OVERRIDE { | 81 SkString onShortName() override { |
82 return SkString("hairmodes"); | 82 return SkString("hairmodes"); |
83 } | 83 } |
84 | 84 |
85 virtual SkISize onISize() SK_OVERRIDE { return SkISize::Make(640, 480);
} | 85 virtual SkISize onISize() override { return SkISize::Make(640, 480); } |
86 | 86 |
87 void onOnceBeforeDraw() SK_OVERRIDE { | 87 void onOnceBeforeDraw() override { |
88 fBGPaint.setShader(make_bg_shader())->unref(); | 88 fBGPaint.setShader(make_bg_shader())->unref(); |
89 } | 89 } |
90 | 90 |
91 void onDraw(SkCanvas* canvas) SK_OVERRIDE { | 91 void onDraw(SkCanvas* canvas) override { |
92 const SkRect bounds = SkRect::MakeWH(W, H); | 92 const SkRect bounds = SkRect::MakeWH(W, H); |
93 static const SkAlpha gAlphaValue[] = { 0xFF, 0x88, 0x88 }; | 93 static const SkAlpha gAlphaValue[] = { 0xFF, 0x88, 0x88 }; |
94 | 94 |
95 canvas->translate(SkIntToScalar(4), SkIntToScalar(4)); | 95 canvas->translate(SkIntToScalar(4), SkIntToScalar(4)); |
96 | 96 |
97 for (int alpha = 0; alpha < 4; ++alpha) { | 97 for (int alpha = 0; alpha < 4; ++alpha) { |
98 canvas->save(); | 98 canvas->save(); |
99 canvas->save(); | 99 canvas->save(); |
100 for (size_t i = 0; i < SK_ARRAY_COUNT(gModes); ++i) { | 100 for (size_t i = 0; i < SK_ARRAY_COUNT(gModes); ++i) { |
101 if (6 == i) { | 101 if (6 == i) { |
(...skipping 22 matching lines...) Expand all Loading... |
124 private: | 124 private: |
125 typedef GM INHERITED; | 125 typedef GM INHERITED; |
126 }; | 126 }; |
127 | 127 |
128 ////////////////////////////////////////////////////////////////////////////
// | 128 ////////////////////////////////////////////////////////////////////////////
// |
129 | 129 |
130 static GM* MyFactory(void*) { return new HairModesGM; } | 130 static GM* MyFactory(void*) { return new HairModesGM; } |
131 static GMRegistry reg(MyFactory); | 131 static GMRegistry reg(MyFactory); |
132 | 132 |
133 } | 133 } |
OLD | NEW |