| 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 "SkPath.h" | 10 #include "SkPath.h" |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 namespace skiagm { | 62 namespace skiagm { |
| 63 | 63 |
| 64 class PathReverseGM : public GM { | 64 class PathReverseGM : public GM { |
| 65 public: | 65 public: |
| 66 PathReverseGM() { | 66 PathReverseGM() { |
| 67 | 67 |
| 68 } | 68 } |
| 69 | 69 |
| 70 protected: | 70 protected: |
| 71 | 71 |
| 72 SkString onShortName() SK_OVERRIDE { | 72 SkString onShortName() override { |
| 73 return SkString("path-reverse"); | 73 return SkString("path-reverse"); |
| 74 } | 74 } |
| 75 | 75 |
| 76 SkISize onISize() SK_OVERRIDE { | 76 SkISize onISize() override { |
| 77 return SkISize::Make(640, 480); | 77 return SkISize::Make(640, 480); |
| 78 } | 78 } |
| 79 | 79 |
| 80 void onDraw(SkCanvas* canvas) SK_OVERRIDE { | 80 void onDraw(SkCanvas* canvas) override { |
| 81 if (false) test_rev(canvas); // avoid bit rot, suppress warning | 81 if (false) test_rev(canvas); // avoid bit rot, suppress warning |
| 82 SkRect r = { 10, 10, 100, 60 }; | 82 SkRect r = { 10, 10, 100, 60 }; |
| 83 | 83 |
| 84 SkPath path; | 84 SkPath path; |
| 85 | 85 |
| 86 path.addRect(r); test_rev(canvas, path); | 86 path.addRect(r); test_rev(canvas, path); |
| 87 | 87 |
| 88 canvas->translate(0, 100); | 88 canvas->translate(0, 100); |
| 89 path.offset(20, 20); | 89 path.offset(20, 20); |
| 90 path.addRect(r); test_rev(canvas, path); | 90 path.addRect(r); test_rev(canvas, path); |
| (...skipping 18 matching lines...) Expand all Loading... |
| 109 private: | 109 private: |
| 110 typedef GM INHERITED; | 110 typedef GM INHERITED; |
| 111 }; | 111 }; |
| 112 | 112 |
| 113 ////////////////////////////////////////////////////////////////////////////// | 113 ////////////////////////////////////////////////////////////////////////////// |
| 114 | 114 |
| 115 static GM* MyFactory(void*) { return new PathReverseGM; } | 115 static GM* MyFactory(void*) { return new PathReverseGM; } |
| 116 static GMRegistry reg(MyFactory); | 116 static GMRegistry reg(MyFactory); |
| 117 | 117 |
| 118 } | 118 } |
| OLD | NEW |