| 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 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 | 127 |
| 128 class AARectModesGM : public GM { | 128 class AARectModesGM : public GM { |
| 129 SkPaint fBGPaint; | 129 SkPaint fBGPaint; |
| 130 public: | 130 public: |
| 131 AARectModesGM () { | 131 AARectModesGM () { |
| 132 fBGPaint.setShader(make_bg_shader())->unref(); | 132 fBGPaint.setShader(make_bg_shader())->unref(); |
| 133 } | 133 } |
| 134 | 134 |
| 135 protected: | 135 protected: |
| 136 | 136 |
| 137 SkString onShortName() SK_OVERRIDE { | 137 SkString onShortName() override { |
| 138 return SkString("aarectmodes"); | 138 return SkString("aarectmodes"); |
| 139 } | 139 } |
| 140 | 140 |
| 141 SkISize onISize() SK_OVERRIDE { return SkISize::Make(640, 480); } | 141 SkISize onISize() override { return SkISize::Make(640, 480); } |
| 142 | 142 |
| 143 void onDraw(SkCanvas* canvas) SK_OVERRIDE { | 143 void onDraw(SkCanvas* canvas) override { |
| 144 if (false) { // avoid bit rot, suppress warning | 144 if (false) { // avoid bit rot, suppress warning |
| 145 test4(canvas); | 145 test4(canvas); |
| 146 } | 146 } |
| 147 const SkRect bounds = SkRect::MakeWH(W, H); | 147 const SkRect bounds = SkRect::MakeWH(W, H); |
| 148 static const SkAlpha gAlphaValue[] = { 0xFF, 0x88, 0x88 }; | 148 static const SkAlpha gAlphaValue[] = { 0xFF, 0x88, 0x88 }; |
| 149 | 149 |
| 150 canvas->translate(SkIntToScalar(4), SkIntToScalar(4)); | 150 canvas->translate(SkIntToScalar(4), SkIntToScalar(4)); |
| 151 | 151 |
| 152 for (int alpha = 0; alpha < 4; ++alpha) { | 152 for (int alpha = 0; alpha < 4; ++alpha) { |
| 153 canvas->save(); | 153 canvas->save(); |
| (...skipping 25 matching lines...) Expand all Loading... |
| 179 private: | 179 private: |
| 180 typedef GM INHERITED; | 180 typedef GM INHERITED; |
| 181 }; | 181 }; |
| 182 | 182 |
| 183 ////////////////////////////////////////////////////////////////////////////// | 183 ////////////////////////////////////////////////////////////////////////////// |
| 184 | 184 |
| 185 static GM* MyFactory(void*) { return new AARectModesGM; } | 185 static GM* MyFactory(void*) { return new AARectModesGM; } |
| 186 static GMRegistry reg(MyFactory); | 186 static GMRegistry reg(MyFactory); |
| 187 | 187 |
| 188 } | 188 } |
| OLD | NEW |