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 #include "SkPath.h" | 9 #include "SkPath.h" |
10 #include "SkRegion.h" | 10 #include "SkRegion.h" |
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 | 193 |
194 class Tiling2GM : public skiagm::GM { | 194 class Tiling2GM : public skiagm::GM { |
195 ShaderProc fProc; | 195 ShaderProc fProc; |
196 SkString fName; | 196 SkString fName; |
197 public: | 197 public: |
198 Tiling2GM(ShaderProc proc, const char name[]) : fProc(proc) { | 198 Tiling2GM(ShaderProc proc, const char name[]) : fProc(proc) { |
199 fName.printf("tilemode_%s", name); | 199 fName.printf("tilemode_%s", name); |
200 } | 200 } |
201 | 201 |
202 protected: | 202 protected: |
| 203 virtual uint32_t onGetFlags() const SK_OVERRIDE { |
| 204 return kSkipTiled_Flag; |
| 205 } |
| 206 |
203 SkString onShortName() { | 207 SkString onShortName() { |
204 return fName; | 208 return fName; |
205 } | 209 } |
206 | 210 |
207 SkISize onISize() { return SkISize::Make(880, 560); } | 211 SkISize onISize() { return SkISize::Make(880, 560); } |
208 | 212 |
209 virtual void onDraw(SkCanvas* canvas) { | 213 virtual void onDraw(SkCanvas* canvas) { |
210 canvas->scale(SkIntToScalar(3)/2, SkIntToScalar(3)/2); | 214 canvas->scale(SkIntToScalar(3)/2, SkIntToScalar(3)/2); |
211 | 215 |
212 const SkScalar w = SkIntToScalar(gWidth); | 216 const SkScalar w = SkIntToScalar(gWidth); |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
261 private: | 265 private: |
262 typedef skiagm::GM INHERITED; | 266 typedef skiagm::GM INHERITED; |
263 }; | 267 }; |
264 | 268 |
265 ////////////////////////////////////////////////////////////////////////////// | 269 ////////////////////////////////////////////////////////////////////////////// |
266 | 270 |
267 DEF_GM( return new TilingGM(true); ) | 271 DEF_GM( return new TilingGM(true); ) |
268 DEF_GM( return new TilingGM(false); ) | 272 DEF_GM( return new TilingGM(false); ) |
269 DEF_GM( return new Tiling2GM(make_bm, "bitmap"); ) | 273 DEF_GM( return new Tiling2GM(make_bm, "bitmap"); ) |
270 DEF_GM( return new Tiling2GM(make_grad, "gradient"); ) | 274 DEF_GM( return new Tiling2GM(make_grad, "gradient"); ) |
OLD | NEW |