| 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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 } | 58 } |
| 59 | 59 |
| 60 SkBitmap fTexture[SK_ARRAY_COUNT(gColorTypes)]; | 60 SkBitmap fTexture[SK_ARRAY_COUNT(gColorTypes)]; |
| 61 | 61 |
| 62 protected: | 62 protected: |
| 63 enum { | 63 enum { |
| 64 kPOTSize = 4, | 64 kPOTSize = 4, |
| 65 kNPOTSize = 3, | 65 kNPOTSize = 3, |
| 66 }; | 66 }; |
| 67 | 67 |
| 68 virtual uint32_t onGetFlags() const SK_OVERRIDE { | |
| 69 if (!fPowerOfTwoSize) { | |
| 70 return kSkipTiled_Flag; // Only for 565. 8888 is fine. | |
| 71 } | |
| 72 return 0; | |
| 73 } | |
| 74 | |
| 75 SkString onShortName() { | 68 SkString onShortName() { |
| 76 SkString name("scaled_tilemodes"); | 69 SkString name("scaled_tilemodes"); |
| 77 if (!fPowerOfTwoSize) { | 70 if (!fPowerOfTwoSize) { |
| 78 name.append("_npot"); | 71 name.append("_npot"); |
| 79 } | 72 } |
| 80 return name; | 73 return name; |
| 81 } | 74 } |
| 82 | 75 |
| 83 SkISize onISize() { return SkISize::Make(880, 760); } | 76 SkISize onISize() { return SkISize::Make(880, 760); } |
| 84 | 77 |
| (...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 277 private: | 270 private: |
| 278 typedef skiagm::GM INHERITED; | 271 typedef skiagm::GM INHERITED; |
| 279 }; | 272 }; |
| 280 | 273 |
| 281 ////////////////////////////////////////////////////////////////////////////// | 274 ////////////////////////////////////////////////////////////////////////////// |
| 282 | 275 |
| 283 DEF_GM( return new ScaledTilingGM(true); ) | 276 DEF_GM( return new ScaledTilingGM(true); ) |
| 284 DEF_GM( return new ScaledTilingGM(false); ) | 277 DEF_GM( return new ScaledTilingGM(false); ) |
| 285 DEF_GM( return new ScaledTiling2GM(make_bm, "bitmap"); ) | 278 DEF_GM( return new ScaledTiling2GM(make_bm, "bitmap"); ) |
| 286 DEF_GM( return new ScaledTiling2GM(make_grad, "gradient"); ) | 279 DEF_GM( return new ScaledTiling2GM(make_grad, "gradient"); ) |
| OLD | NEW |