Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(48)

Side by Side Diff: tests/PathOpsSkpClipTest.cpp

Issue 1552093002: If we swap its arguments, SkTaskGroup::batch() _is_ sk_parallel_for. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « tests/OnceTest.cpp ('k') | tests/PathOpsThreadedCommon.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 289 matching lines...) Expand 10 before | Expand all | Expand 10 after
300 300
301 TestRunner::~TestRunner() { 301 TestRunner::~TestRunner() {
302 for (int index = 0; index < fRunnables.count(); index++) { 302 for (int index = 0; index < fRunnables.count(); index++) {
303 delete fRunnables[index]; 303 delete fRunnables[index];
304 } 304 }
305 } 305 }
306 306
307 void TestRunner::render() { 307 void TestRunner::render() {
308 // TODO: this doesn't really need to use SkRunnables any more. 308 // TODO: this doesn't really need to use SkRunnables any more.
309 // We can just write the code to run in the for-loop directly. 309 // We can just write the code to run in the for-loop directly.
310 sk_parallel_for(fRunnables.count(), [&](int i) { 310 SkTaskGroup().batch(fRunnables.count(), [&](int i) {
311 fRunnables[i]->run(); 311 fRunnables[i]->run();
312 }); 312 });
313 } 313 }
314 314
315 //////////////////////////////////////////////// 315 ////////////////////////////////////////////////
316 316
317 317
318 static int similarBits(const SkBitmap& gr, const SkBitmap& sk) { 318 static int similarBits(const SkBitmap& gr, const SkBitmap& sk) {
319 const int kRowCount = 3; 319 const int kRowCount = 3;
320 const int kThreshold = 3; 320 const int kThreshold = 3;
(...skipping 782 matching lines...) Expand 10 before | Expand all | Expand 10 after
1103 } 1103 }
1104 } 1104 }
1105 return 0; 1105 return 0;
1106 } 1106 }
1107 1107
1108 #if !defined(SK_BUILD_FOR_IOS) 1108 #if !defined(SK_BUILD_FOR_IOS)
1109 int main(int argc, char * const argv[]) { 1109 int main(int argc, char * const argv[]) {
1110 return tool_main(argc, (char**) argv); 1110 return tool_main(argc, (char**) argv);
1111 } 1111 }
1112 #endif 1112 #endif
OLDNEW
« no previous file with comments | « tests/OnceTest.cpp ('k') | tests/PathOpsThreadedCommon.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698