OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2011 Google Inc. | 3 * Copyright 2011 Google Inc. |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 #include "gm.h" | 8 #include "gm.h" |
9 | 9 |
10 typedef SkScalar (*MakePathProc)(SkPath*); | 10 typedef SkScalar (*MakePathProc)(SkPath*); |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 SkPath fPath[N]; | 118 SkPath fPath[N]; |
119 SkScalar fDY[N]; | 119 SkScalar fDY[N]; |
120 public: | 120 public: |
121 PathFillGM() { | 121 PathFillGM() { |
122 for (size_t i = 0; i < N; i++) { | 122 for (size_t i = 0; i < N; i++) { |
123 fDY[i] = gProcs[i](&fPath[i]); | 123 fDY[i] = gProcs[i](&fPath[i]); |
124 } | 124 } |
125 } | 125 } |
126 | 126 |
127 protected: | 127 protected: |
| 128 virtual uint32_t onGetFlags() const SK_OVERRIDE { |
| 129 return kSkipTiled_Flag; |
| 130 } |
| 131 |
128 virtual SkString onShortName() { | 132 virtual SkString onShortName() { |
129 return SkString("pathfill"); | 133 return SkString("pathfill"); |
130 } | 134 } |
131 | 135 |
132 virtual SkISize onISize() { | 136 virtual SkISize onISize() { |
133 return SkISize::Make(640, 480); | 137 return SkISize::Make(640, 480); |
134 } | 138 } |
135 | 139 |
136 virtual void onDraw(SkCanvas* canvas) { | 140 virtual void onDraw(SkCanvas* canvas) { |
137 SkPaint paint; | 141 SkPaint paint; |
(...skipping 14 matching lines...) Expand all Loading... |
152 SkPath fPath[N]; | 156 SkPath fPath[N]; |
153 SkScalar fDY[N]; | 157 SkScalar fDY[N]; |
154 public: | 158 public: |
155 PathInverseFillGM() { | 159 PathInverseFillGM() { |
156 for (size_t i = 0; i < N; i++) { | 160 for (size_t i = 0; i < N; i++) { |
157 fDY[i] = gProcs[i](&fPath[i]); | 161 fDY[i] = gProcs[i](&fPath[i]); |
158 } | 162 } |
159 } | 163 } |
160 | 164 |
161 protected: | 165 protected: |
| 166 virtual uint32_t onGetFlags() const SK_OVERRIDE { |
| 167 return kSkipTiled_Flag; |
| 168 } |
| 169 |
162 virtual SkString onShortName() { | 170 virtual SkString onShortName() { |
163 return SkString("pathinvfill"); | 171 return SkString("pathinvfill"); |
164 } | 172 } |
165 | 173 |
166 virtual SkISize onISize() { | 174 virtual SkISize onISize() { |
167 return SkISize::Make(450, 220); | 175 return SkISize::Make(450, 220); |
168 } | 176 } |
169 | 177 |
170 static void show(SkCanvas* canvas, const SkPath& path, const SkPaint& paint, | 178 static void show(SkCanvas* canvas, const SkPath& path, const SkPaint& paint, |
171 const SkRect* clip, SkScalar top, const SkScalar bottom) { | 179 const SkRect* clip, SkScalar top, const SkScalar bottom) { |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
213 typedef skiagm::GM INHERITED; | 221 typedef skiagm::GM INHERITED; |
214 }; | 222 }; |
215 | 223 |
216 /////////////////////////////////////////////////////////////////////////////// | 224 /////////////////////////////////////////////////////////////////////////////// |
217 | 225 |
218 static skiagm::GM* MyFactory(void*) { return new PathFillGM; } | 226 static skiagm::GM* MyFactory(void*) { return new PathFillGM; } |
219 static skiagm::GMRegistry reg(MyFactory); | 227 static skiagm::GMRegistry reg(MyFactory); |
220 | 228 |
221 static skiagm::GM* F1(void*) { return new PathInverseFillGM; } | 229 static skiagm::GM* F1(void*) { return new PathInverseFillGM; } |
222 static skiagm::GMRegistry gR1(F1); | 230 static skiagm::GMRegistry gR1(F1); |
OLD | NEW |