| 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 #include "SkCanvas.h" | 9 #include "SkCanvas.h" |
| 10 #include "SkRRect.h" | 10 #include "SkRRect.h" |
| 11 #include "SkPath.h" | 11 #include "SkPath.h" |
| 12 | 12 |
| 13 class DRRectGM : public skiagm::GM { | 13 class DRRectGM : public skiagm::GM { |
| 14 public: | 14 public: |
| 15 DRRectGM() {} | 15 DRRectGM() {} |
| 16 | 16 |
| 17 protected: | 17 protected: |
| 18 | 18 |
| 19 SkString onShortName() SK_OVERRIDE { | 19 SkString onShortName() override { |
| 20 return SkString("drrect"); | 20 return SkString("drrect"); |
| 21 } | 21 } |
| 22 | 22 |
| 23 SkISize onISize() SK_OVERRIDE { | 23 SkISize onISize() override { |
| 24 return SkISize::Make(640, 480); | 24 return SkISize::Make(640, 480); |
| 25 } | 25 } |
| 26 | 26 |
| 27 void onDraw(SkCanvas* canvas) SK_OVERRIDE { | 27 void onDraw(SkCanvas* canvas) override { |
| 28 SkPaint paint; | 28 SkPaint paint; |
| 29 paint.setAntiAlias(true); | 29 paint.setAntiAlias(true); |
| 30 | 30 |
| 31 SkRRect outers[4]; | 31 SkRRect outers[4]; |
| 32 // like squares/circles, to exercise fast-cases in GPU | 32 // like squares/circles, to exercise fast-cases in GPU |
| 33 SkRect r = { 0, 0, 100, 100 }; | 33 SkRect r = { 0, 0, 100, 100 }; |
| 34 SkVector radii[4] = { | 34 SkVector radii[4] = { |
| 35 { 0, 0 }, { 30, 1 }, { 10, 40 }, { 40, 40 } | 35 { 0, 0 }, { 30, 1 }, { 10, 40 }, { 40, 40 } |
| 36 }; | 36 }; |
| 37 | 37 |
| (...skipping 23 matching lines...) Expand all Loading... |
| 61 canvas->restore(); | 61 canvas->restore(); |
| 62 } | 62 } |
| 63 } | 63 } |
| 64 } | 64 } |
| 65 | 65 |
| 66 private: | 66 private: |
| 67 typedef GM INHERITED; | 67 typedef GM INHERITED; |
| 68 }; | 68 }; |
| 69 | 69 |
| 70 DEF_GM( return new DRRectGM; ) | 70 DEF_GM( return new DRRectGM; ) |
| OLD | NEW |