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 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
187 | 187 |
188 class Tiling2GM : public skiagm::GM { | 188 class Tiling2GM : public skiagm::GM { |
189 ShaderProc fProc; | 189 ShaderProc fProc; |
190 SkString fName; | 190 SkString fName; |
191 public: | 191 public: |
192 Tiling2GM(ShaderProc proc, const char name[]) : fProc(proc) { | 192 Tiling2GM(ShaderProc proc, const char name[]) : fProc(proc) { |
193 fName.printf("tilemode_%s", name); | 193 fName.printf("tilemode_%s", name); |
194 } | 194 } |
195 | 195 |
196 protected: | 196 protected: |
197 uint32_t onGetFlags() const SK_OVERRIDE { | |
198 return kSkipTiled_Flag; | |
199 } | |
200 | 197 |
201 SkString onShortName() SK_OVERRIDE { | 198 SkString onShortName() SK_OVERRIDE { |
202 return fName; | 199 return fName; |
203 } | 200 } |
204 | 201 |
205 SkISize onISize() SK_OVERRIDE { return SkISize::Make(880, 560); } | 202 SkISize onISize() SK_OVERRIDE { return SkISize::Make(880, 560); } |
206 | 203 |
207 void onDraw(SkCanvas* canvas) SK_OVERRIDE { | 204 void onDraw(SkCanvas* canvas) SK_OVERRIDE { |
208 canvas->scale(SkIntToScalar(3)/2, SkIntToScalar(3)/2); | 205 canvas->scale(SkIntToScalar(3)/2, SkIntToScalar(3)/2); |
209 | 206 |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
260 private: | 257 private: |
261 typedef skiagm::GM INHERITED; | 258 typedef skiagm::GM INHERITED; |
262 }; | 259 }; |
263 | 260 |
264 ////////////////////////////////////////////////////////////////////////////// | 261 ////////////////////////////////////////////////////////////////////////////// |
265 | 262 |
266 DEF_GM( return new TilingGM(true); ) | 263 DEF_GM( return new TilingGM(true); ) |
267 DEF_GM( return new TilingGM(false); ) | 264 DEF_GM( return new TilingGM(false); ) |
268 DEF_GM( return new Tiling2GM(make_bm, "bitmap"); ) | 265 DEF_GM( return new Tiling2GM(make_bm, "bitmap"); ) |
269 DEF_GM( return new Tiling2GM(make_grad, "gradient"); ) | 266 DEF_GM( return new Tiling2GM(make_grad, "gradient"); ) |
OLD | NEW |