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 // 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 Loading... |
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 Loading... |
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 |
OLD | NEW |