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 #include "GrLayerCache.h" | 8 #include "GrLayerCache.h" |
9 #include "GrLayerHoister.h" | 9 #include "GrLayerHoister.h" |
10 #include "GrRecordReplaceDraw.h" | 10 #include "GrRecordReplaceDraw.h" |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 SkTDArray<GrHoistedLayer>* recycled, | 123 SkTDArray<GrHoistedLayer>* recycled, |
124 int numSamples) { | 124 int numSamples) { |
125 if (0 != numSamples) { | 125 if (0 != numSamples) { |
126 // MSAA layers are currently never atlased | 126 // MSAA layers are currently never atlased |
127 return; | 127 return; |
128 } | 128 } |
129 | 129 |
130 GrLayerCache* layerCache = context->getLayerCache(); | 130 GrLayerCache* layerCache = context->getLayerCache(); |
131 layerCache->processDeletedPictures(); | 131 layerCache->processDeletedPictures(); |
132 | 132 |
133 const SkBigPicture::AccelData* topLevelData = NULL; | 133 const SkBigPicture::AccelData* topLevelData = nullptr; |
134 if (const SkBigPicture* bp = topLevelPicture->asSkBigPicture()) { | 134 if (const SkBigPicture* bp = topLevelPicture->asSkBigPicture()) { |
135 topLevelData = bp->accelData(); | 135 topLevelData = bp->accelData(); |
136 } | 136 } |
137 if (!topLevelData) { | 137 if (!topLevelData) { |
138 return; | 138 return; |
139 } | 139 } |
140 | 140 |
141 const SkLayerInfo *topLevelGPUData = static_cast<const SkLayerInfo*>(topLeve
lData); | 141 const SkLayerInfo *topLevelGPUData = static_cast<const SkLayerInfo*>(topLeve
lData); |
142 if (0 == topLevelGPUData->numBlocks()) { | 142 if (0 == topLevelGPUData->numBlocks()) { |
143 return; | 143 return; |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
181 const SkPicture* topLevelPicture, | 181 const SkPicture* topLevelPicture, |
182 const SkMatrix& initialMat, | 182 const SkMatrix& initialMat, |
183 const SkRect& query, | 183 const SkRect& query, |
184 SkTDArray<GrHoistedLayer>* needRendering, | 184 SkTDArray<GrHoistedLayer>* needRendering, |
185 SkTDArray<GrHoistedLayer>* recycled, | 185 SkTDArray<GrHoistedLayer>* recycled, |
186 int numSamples) { | 186 int numSamples) { |
187 GrLayerCache* layerCache = context->getLayerCache(); | 187 GrLayerCache* layerCache = context->getLayerCache(); |
188 | 188 |
189 layerCache->processDeletedPictures(); | 189 layerCache->processDeletedPictures(); |
190 | 190 |
191 const SkBigPicture::AccelData* topLevelData = NULL; | 191 const SkBigPicture::AccelData* topLevelData = nullptr; |
192 if (const SkBigPicture* bp = topLevelPicture->asSkBigPicture()) { | 192 if (const SkBigPicture* bp = topLevelPicture->asSkBigPicture()) { |
193 topLevelData = bp->accelData(); | 193 topLevelData = bp->accelData(); |
194 } | 194 } |
195 if (!topLevelData) { | 195 if (!topLevelData) { |
196 return; | 196 return; |
197 } | 197 } |
198 | 198 |
199 const SkLayerInfo *topLevelGPUData = static_cast<const SkLayerInfo*>(topLeve
lData); | 199 const SkLayerInfo *topLevelGPUData = static_cast<const SkLayerInfo*>(topLeve
lData); |
200 if (0 == topLevelGPUData->numBlocks()) { | 200 if (0 == topLevelGPUData->numBlocks()) { |
201 return; | 201 return; |
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
383 void GrLayerHoister::PurgeCache(GrContext* context) { | 383 void GrLayerHoister::PurgeCache(GrContext* context) { |
384 #if !GR_CACHE_HOISTED_LAYERS | 384 #if !GR_CACHE_HOISTED_LAYERS |
385 GrLayerCache* layerCache = context->getLayerCache(); | 385 GrLayerCache* layerCache = context->getLayerCache(); |
386 | 386 |
387 // This code completely clears out the atlas. It is required when | 387 // This code completely clears out the atlas. It is required when |
388 // caching is disabled so the atlas doesn't fill up and force more | 388 // caching is disabled so the atlas doesn't fill up and force more |
389 // free floating layers | 389 // free floating layers |
390 layerCache->purgeAll(); | 390 layerCache->purgeAll(); |
391 #endif | 391 #endif |
392 } | 392 } |
OLD | NEW |