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

Side by Side Diff: src/core/SkMultiPictureDraw.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 | « samplecode/SamplePathFuzz.cpp ('k') | src/core/SkTaskGroup.h » ('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 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 // Need to include something before #if SK_SUPPORT_GPU so that the Android 8 // Need to include something before #if SK_SUPPORT_GPU so that the Android
9 // framework build, which gets its defines from SkTypes rather than a makefile, 9 // framework build, which gets its defines from SkTypes rather than a makefile,
10 // has the definition before checking it. 10 // has the definition before checking it.
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 //#define FORCE_SINGLE_THREAD_DRAWING_FOR_TESTING 87 //#define FORCE_SINGLE_THREAD_DRAWING_FOR_TESTING
88 88
89 void SkMultiPictureDraw::draw(bool flush) { 89 void SkMultiPictureDraw::draw(bool flush) {
90 AutoMPDReset mpdreset(this); 90 AutoMPDReset mpdreset(this);
91 91
92 #ifdef FORCE_SINGLE_THREAD_DRAWING_FOR_TESTING 92 #ifdef FORCE_SINGLE_THREAD_DRAWING_FOR_TESTING
93 for (int i = 0; i < fThreadSafeDrawData.count(); ++i) { 93 for (int i = 0; i < fThreadSafeDrawData.count(); ++i) {
94 fThreadSafeDrawData[i].draw(); 94 fThreadSafeDrawData[i].draw();
95 } 95 }
96 #else 96 #else
97 sk_parallel_for(fThreadSafeDrawData.count(), [&](int i) { 97 SkTaskGroup().batch(fThreadSafeDrawData.count(), [&](int i) {
98 fThreadSafeDrawData[i].draw(); 98 fThreadSafeDrawData[i].draw();
99 }); 99 });
100 #endif 100 #endif
101 101
102 // N.B. we could get going on any GPU work from this main thread while the C PU work runs. 102 // N.B. we could get going on any GPU work from this main thread while the C PU work runs.
103 // But in practice, we've either got GPU work or CPU work, not both. 103 // But in practice, we've either got GPU work or CPU work, not both.
104 104
105 const int count = fGPUDrawData.count(); 105 const int count = fGPUDrawData.count();
106 if (0 == count) { 106 if (0 == count) {
107 return; 107 return;
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
198 } 198 }
199 } 199 }
200 200
201 #if !defined(SK_IGNORE_GPU_LAYER_HOISTING) && SK_SUPPORT_GPU 201 #if !defined(SK_IGNORE_GPU_LAYER_HOISTING) && SK_SUPPORT_GPU
202 GrLayerHoister::UnlockLayers(context, atlasedNeedRendering); 202 GrLayerHoister::UnlockLayers(context, atlasedNeedRendering);
203 GrLayerHoister::UnlockLayers(context, atlasedRecycled); 203 GrLayerHoister::UnlockLayers(context, atlasedRecycled);
204 GrLayerHoister::End(context); 204 GrLayerHoister::End(context);
205 #endif 205 #endif
206 } 206 }
207 207
OLDNEW
« no previous file with comments | « samplecode/SamplePathFuzz.cpp ('k') | src/core/SkTaskGroup.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698