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 #if SK_SUPPORT_GPU | 8 #if SK_SUPPORT_GPU |
9 #include "GrLayerHoister.h" | 9 #include "GrLayerHoister.h" |
10 #include "GrRecordReplaceDraw.h" | 10 #include "GrRecordReplaceDraw.h" |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 public: | 79 public: |
80 AutoMPDReset(SkMultiPictureDraw* mpd) : fMPD(mpd) {} | 80 AutoMPDReset(SkMultiPictureDraw* mpd) : fMPD(mpd) {} |
81 ~AutoMPDReset() { fMPD->reset(); } | 81 ~AutoMPDReset() { fMPD->reset(); } |
82 }; | 82 }; |
83 | 83 |
84 void SkMultiPictureDraw::draw() { | 84 void SkMultiPictureDraw::draw() { |
85 AutoMPDReset mpdreset(this); | 85 AutoMPDReset mpdreset(this); |
86 // we place the taskgroup after the MPDReset, to ensure that we don't delete
the DrawData | 86 // we place the taskgroup after the MPDReset, to ensure that we don't delete
the DrawData |
87 // objects until after we're finished the tasks (which have pointers to the
data). | 87 // objects until after we're finished the tasks (which have pointers to the
data). |
88 | 88 |
89 #if 0 | |
90 SkTaskGroup group; | 89 SkTaskGroup group; |
91 group.batch(DrawData::Draw, fThreadSafeDrawData.begin(), fThreadSafeDrawData
.count()); | 90 group.batch(DrawData::Draw, fThreadSafeDrawData.begin(), fThreadSafeDrawData
.count()); |
92 // we deliberately don't call wait() here, since the destructor will do that
, this allows us | 91 // we deliberately don't call wait() here, since the destructor will do that
, this allows us |
93 // to continue processing gpu-data without having to wait on the cpu tasks. | 92 // to continue processing gpu-data without having to wait on the cpu tasks. |
94 #else | |
95 for (int i = 0; i < fThreadSafeDrawData.count(); i++) { | |
96 DrawData::Draw(&fThreadSafeDrawData[i]); | |
97 } | |
98 #endif | |
99 | 93 |
100 const int count = fGPUDrawData.count(); | 94 const int count = fGPUDrawData.count(); |
101 if (0 == count) { | 95 if (0 == count) { |
102 return; | 96 return; |
103 } | 97 } |
104 | 98 |
105 #ifndef SK_IGNORE_GPU_LAYER_HOISTING | 99 #ifndef SK_IGNORE_GPU_LAYER_HOISTING |
106 GrContext* context = fGPUDrawData[0].fCanvas->getGrContext(); | 100 GrContext* context = fGPUDrawData[0].fCanvas->getGrContext(); |
107 SkASSERT(context); | 101 SkASSERT(context); |
108 | 102 |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 | 179 |
186 #ifndef SK_IGNORE_GPU_LAYER_HOISTING | 180 #ifndef SK_IGNORE_GPU_LAYER_HOISTING |
187 GrLayerHoister::UnlockLayers(context, atlasedNeedRendering); | 181 GrLayerHoister::UnlockLayers(context, atlasedNeedRendering); |
188 GrLayerHoister::UnlockLayers(context, atlasedRecycled); | 182 GrLayerHoister::UnlockLayers(context, atlasedRecycled); |
189 #if !GR_CACHE_HOISTED_LAYERS | 183 #if !GR_CACHE_HOISTED_LAYERS |
190 GrLayerHoister::PurgeCache(context); | 184 GrLayerHoister::PurgeCache(context); |
191 #endif | 185 #endif |
192 #endif | 186 #endif |
193 } | 187 } |
194 | 188 |
OLD | NEW |