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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 }; | 66 }; |
67 | 67 |
68 SkString onShortName() SK_OVERRIDE { | 68 SkString onShortName() SK_OVERRIDE { |
69 SkString name("scaled_tilemodes"); | 69 SkString name("scaled_tilemodes"); |
70 if (!fPowerOfTwoSize) { | 70 if (!fPowerOfTwoSize) { |
71 name.append("_npot"); | 71 name.append("_npot"); |
72 } | 72 } |
73 return name; | 73 return name; |
74 } | 74 } |
75 | 75 |
76 #ifdef SK_CPU_ARM64 | |
77 // Skip tiled drawing on 64-bit ARM until https://skbug.com/2908 is fixed. | |
78 uint32_t onGetFlags() const SK_OVERRIDE { | |
79 return kSkipTiled_Flag; | |
80 } | |
81 #endif | |
82 | |
83 SkISize onISize() SK_OVERRIDE { return SkISize::Make(880, 760); } | 76 SkISize onISize() SK_OVERRIDE { return SkISize::Make(880, 760); } |
84 | 77 |
85 void onOnceBeforeDraw() SK_OVERRIDE { | 78 void onOnceBeforeDraw() SK_OVERRIDE { |
86 int size = fPowerOfTwoSize ? kPOTSize : kNPOTSize; | 79 int size = fPowerOfTwoSize ? kPOTSize : kNPOTSize; |
87 for (size_t i = 0; i < SK_ARRAY_COUNT(gColorTypes); i++) { | 80 for (size_t i = 0; i < SK_ARRAY_COUNT(gColorTypes); i++) { |
88 makebm(&fTexture[i], gColorTypes[i], size, size); | 81 makebm(&fTexture[i], gColorTypes[i], size, size); |
89 } | 82 } |
90 } | 83 } |
91 | 84 |
92 void onDraw(SkCanvas* canvas) SK_OVERRIDE { | 85 void onDraw(SkCanvas* canvas) SK_OVERRIDE { |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
206 | 199 |
207 class ScaledTiling2GM : public skiagm::GM { | 200 class ScaledTiling2GM : public skiagm::GM { |
208 ShaderProc fProc; | 201 ShaderProc fProc; |
209 SkString fName; | 202 SkString fName; |
210 public: | 203 public: |
211 ScaledTiling2GM(ShaderProc proc, const char name[]) : fProc(proc) { | 204 ScaledTiling2GM(ShaderProc proc, const char name[]) : fProc(proc) { |
212 fName.printf("scaled_tilemode_%s", name); | 205 fName.printf("scaled_tilemode_%s", name); |
213 } | 206 } |
214 | 207 |
215 protected: | 208 protected: |
216 uint32_t onGetFlags() const SK_OVERRIDE { | |
217 return kSkipTiled_Flag; | |
218 } | |
219 | 209 |
220 SkString onShortName() SK_OVERRIDE { | 210 SkString onShortName() SK_OVERRIDE { |
221 return fName; | 211 return fName; |
222 } | 212 } |
223 | 213 |
224 SkISize onISize() SK_OVERRIDE { return SkISize::Make(880, 560); } | 214 SkISize onISize() SK_OVERRIDE { return SkISize::Make(880, 560); } |
225 | 215 |
226 void onDraw(SkCanvas* canvas) SK_OVERRIDE { | 216 void onDraw(SkCanvas* canvas) SK_OVERRIDE { |
227 canvas->scale(SkIntToScalar(3)/2, SkIntToScalar(3)/2); | 217 canvas->scale(SkIntToScalar(3)/2, SkIntToScalar(3)/2); |
228 | 218 |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
279 private: | 269 private: |
280 typedef skiagm::GM INHERITED; | 270 typedef skiagm::GM INHERITED; |
281 }; | 271 }; |
282 | 272 |
283 ////////////////////////////////////////////////////////////////////////////// | 273 ////////////////////////////////////////////////////////////////////////////// |
284 | 274 |
285 DEF_GM( return new ScaledTilingGM(true); ) | 275 DEF_GM( return new ScaledTilingGM(true); ) |
286 DEF_GM( return new ScaledTilingGM(false); ) | 276 DEF_GM( return new ScaledTilingGM(false); ) |
287 DEF_GM( return new ScaledTiling2GM(make_bm, "bitmap"); ) | 277 DEF_GM( return new ScaledTiling2GM(make_bm, "bitmap"); ) |
288 DEF_GM( return new ScaledTiling2GM(make_grad, "gradient"); ) | 278 DEF_GM( return new ScaledTiling2GM(make_grad, "gradient"); ) |
OLD | NEW |