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

Side by Side Diff: samplecode/SamplePathFuzz.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 | « dm/DM.cpp ('k') | src/core/SkMultiPictureDraw.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 2015 Google Inc. 2 * Copyright 2015 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 "SampleCode.h" 8 #include "SampleCode.h"
9 #include "SkView.h" 9 #include "SkView.h"
10 #include "SkCanvas.h" 10 #include "SkCanvas.h"
(...skipping 601 matching lines...) Expand 10 before | Expand all | Expand 10 after
612 } 612 }
613 return true; 613 return true;
614 } 614 }
615 615
616 #include "SkGraphics.h" 616 #include "SkGraphics.h"
617 #include "SkSurface.h" 617 #include "SkSurface.h"
618 #include "SkTaskGroup.h" 618 #include "SkTaskGroup.h"
619 #include "SkTDArray.h" 619 #include "SkTDArray.h"
620 620
621 static void path_fuzz_stroker(SkBitmap* bitmap, int seed) { 621 static void path_fuzz_stroker(SkBitmap* bitmap, int seed) {
622 sk_parallel_for(100, [&](int i) { 622 SkTaskGroup().batch(100, [&](int i) {
623 int localSeed = seed + i; 623 int localSeed = seed + i;
624 624
625 FuzzPath fuzzPath; 625 FuzzPath fuzzPath;
626 fuzzPath.setStrokeOnly(); 626 fuzzPath.setStrokeOnly();
627 fuzzPath.setSeed(localSeed); 627 fuzzPath.setSeed(localSeed);
628 fuzzPath.randomize(); 628 fuzzPath.randomize();
629 const SkPath& path = fuzzPath.getPath(); 629 const SkPath& path = fuzzPath.getPath();
630 const SkPaint& paint = fuzzPath.getPaint(); 630 const SkPaint& paint = fuzzPath.getPaint();
631 const SkImageInfo& info = bitmap->info(); 631 const SkImageInfo& info = bitmap->info();
632 SkCanvas* canvas( 632 SkCanvas* canvas(
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
693 SkBitmap offscreen; 693 SkBitmap offscreen;
694 FuzzPath fuzzPath; 694 FuzzPath fuzzPath;
695 bool fOneDraw; 695 bool fOneDraw;
696 typedef SkView INHERITED; 696 typedef SkView INHERITED;
697 }; 697 };
698 698
699 static SkView* MyFactory() { return new PathFuzzView; } 699 static SkView* MyFactory() { return new PathFuzzView; }
700 static SkViewRegister reg(MyFactory); 700 static SkViewRegister reg(MyFactory);
701 701
702 702
OLDNEW
« no previous file with comments | « dm/DM.cpp ('k') | src/core/SkMultiPictureDraw.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698