OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 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 "CrashHandler.h" | 8 #include "CrashHandler.h" |
9 // #include "OverwriteLine.h" | 9 // #include "OverwriteLine.h" |
10 #include "Resources.h" | 10 #include "Resources.h" |
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
296 } | 296 } |
297 }; | 297 }; |
298 | 298 |
299 TestRunner::~TestRunner() { | 299 TestRunner::~TestRunner() { |
300 for (int index = 0; index < fRunnables.count(); index++) { | 300 for (int index = 0; index < fRunnables.count(); index++) { |
301 SkDELETE(fRunnables[index]); | 301 SkDELETE(fRunnables[index]); |
302 } | 302 } |
303 } | 303 } |
304 | 304 |
305 void TestRunner::render() { | 305 void TestRunner::render() { |
306 SkTaskGroup tg; | 306 // TODO: this doesn't really need to use SkRunnables any more. |
307 for (int index = 0; index < fRunnables.count(); ++ index) { | 307 // We can just write the code to run in the for-loop directly. |
308 tg.add(fRunnables[index]); | 308 sk_parallel_for(fRunnables.count(), [&](int i) { |
309 } | 309 fRunnables[i]->run(); |
| 310 }); |
310 } | 311 } |
311 | 312 |
312 //////////////////////////////////////////////// | 313 //////////////////////////////////////////////// |
313 | 314 |
314 | 315 |
315 static int similarBits(const SkBitmap& gr, const SkBitmap& sk) { | 316 static int similarBits(const SkBitmap& gr, const SkBitmap& sk) { |
316 const int kRowCount = 3; | 317 const int kRowCount = 3; |
317 const int kThreshold = 3; | 318 const int kThreshold = 3; |
318 int width = SkTMin(gr.width(), sk.width()); | 319 int width = SkTMin(gr.width(), sk.width()); |
319 if (width < kRowCount) { | 320 if (width < kRowCount) { |
(...skipping 784 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1104 } | 1105 } |
1105 SkGraphics::Term(); | 1106 SkGraphics::Term(); |
1106 return 0; | 1107 return 0; |
1107 } | 1108 } |
1108 | 1109 |
1109 #if !defined(SK_BUILD_FOR_IOS) | 1110 #if !defined(SK_BUILD_FOR_IOS) |
1110 int main(int argc, char * const argv[]) { | 1111 int main(int argc, char * const argv[]) { |
1111 return tool_main(argc, (char**) argv); | 1112 return tool_main(argc, (char**) argv); |
1112 } | 1113 } |
1113 #endif | 1114 #endif |
OLD | NEW |