OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #include "Benchmark.h" | 8 #include "Benchmark.h" |
9 #include "SkCanvas.h" | 9 #include "SkCanvas.h" |
10 #include "SkGradientShader.h" | 10 #include "SkGradientShader.h" |
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 case kBig_Size: | 193 case kBig_Size: |
194 size.set("big"); | 194 size.set("big"); |
195 break; | 195 break; |
196 default: | 196 default: |
197 break; | 197 break; |
198 } | 198 } |
199 fName.printf("patch_grid_%s_%s", vertexMode.c_str(), size.c_str()); | 199 fName.printf("patch_grid_%s_%s", vertexMode.c_str(), size.c_str()); |
200 return fName.c_str(); | 200 return fName.c_str(); |
201 } | 201 } |
202 | 202 |
203 void onPreDraw() override { | 203 void onDelayedSetup() override { |
204 this->setGrid(); | 204 this->setGrid(); |
205 switch (fVertexMode) { | 205 switch (fVertexMode) { |
206 case kTexCoords_VertexMode: | 206 case kTexCoords_VertexMode: |
207 case kBoth_VertexMode: | 207 case kBoth_VertexMode: |
208 fPaint.setShader(createShader())->unref(); | 208 fPaint.setShader(createShader())->unref(); |
209 break; | 209 break; |
210 default: | 210 default: |
211 fPaint.setShader(nullptr); | 211 fPaint.setShader(nullptr); |
212 break; | 212 break; |
213 } | 213 } |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
250 DEF_BENCH( return new PatchGridBench(PatchGridBench::kMedium_Size, | 250 DEF_BENCH( return new PatchGridBench(PatchGridBench::kMedium_Size, |
251 PatchGridBench::kBoth_VertexMode); ) | 251 PatchGridBench::kBoth_VertexMode); ) |
252 DEF_BENCH( return new PatchGridBench(PatchGridBench::kBig_Size, | 252 DEF_BENCH( return new PatchGridBench(PatchGridBench::kBig_Size, |
253 PatchGridBench::kNone_VertexMode); ) | 253 PatchGridBench::kNone_VertexMode); ) |
254 DEF_BENCH( return new PatchGridBench(PatchGridBench::kBig_Size, | 254 DEF_BENCH( return new PatchGridBench(PatchGridBench::kBig_Size, |
255 PatchGridBench::kColors_VertexMode); ) | 255 PatchGridBench::kColors_VertexMode); ) |
256 DEF_BENCH( return new PatchGridBench(PatchGridBench::kBig_Size, | 256 DEF_BENCH( return new PatchGridBench(PatchGridBench::kBig_Size, |
257 PatchGridBench::kTexCoords_VertexMode); ) | 257 PatchGridBench::kTexCoords_VertexMode); ) |
258 DEF_BENCH( return new PatchGridBench(PatchGridBench::kBig_Size, | 258 DEF_BENCH( return new PatchGridBench(PatchGridBench::kBig_Size, |
259 PatchGridBench::kBoth_VertexMode); ) | 259 PatchGridBench::kBoth_VertexMode); ) |
OLD | NEW |