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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 | 61 |
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 virtual uint32_t onGetFlags() const SK_OVERRIDE { | 71 uint32_t onGetFlags() const SK_OVERRIDE { |
72 return kSkipTiled_Flag; | 72 return kSkipTiled_Flag; |
73 } | 73 } |
74 | 74 |
75 virtual SkString onShortName() SK_OVERRIDE { | 75 SkString onShortName() SK_OVERRIDE { |
76 return SkString("path-reverse"); | 76 return SkString("path-reverse"); |
77 } | 77 } |
78 | 78 |
79 virtual SkISize onISize() SK_OVERRIDE { | 79 SkISize onISize() SK_OVERRIDE { |
80 return SkISize::Make(640, 480); | 80 return SkISize::Make(640, 480); |
81 } | 81 } |
82 | 82 |
83 virtual void onDraw(SkCanvas* canvas) SK_OVERRIDE { | 83 void onDraw(SkCanvas* canvas) SK_OVERRIDE { |
84 if (false) test_rev(canvas); // avoid bit rot, suppress warning | 84 if (false) test_rev(canvas); // avoid bit rot, suppress warning |
85 SkRect r = { 10, 10, 100, 60 }; | 85 SkRect r = { 10, 10, 100, 60 }; |
86 | 86 |
87 SkPath path; | 87 SkPath path; |
88 | 88 |
89 path.addRect(r); test_rev(canvas, path); | 89 path.addRect(r); test_rev(canvas, path); |
90 | 90 |
91 canvas->translate(0, 100); | 91 canvas->translate(0, 100); |
92 path.offset(20, 20); | 92 path.offset(20, 20); |
93 path.addRect(r); test_rev(canvas, path); | 93 path.addRect(r); test_rev(canvas, path); |
(...skipping 18 matching lines...) Expand all Loading... |
112 private: | 112 private: |
113 typedef GM INHERITED; | 113 typedef GM INHERITED; |
114 }; | 114 }; |
115 | 115 |
116 ////////////////////////////////////////////////////////////////////////////// | 116 ////////////////////////////////////////////////////////////////////////////// |
117 | 117 |
118 static GM* MyFactory(void*) { return new PathReverseGM; } | 118 static GM* MyFactory(void*) { return new PathReverseGM; } |
119 static GMRegistry reg(MyFactory); | 119 static GMRegistry reg(MyFactory); |
120 | 120 |
121 } | 121 } |
OLD | NEW |