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 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
307 } | 307 } |
308 | 308 |
309 void GrLayerHoister::UnlockLayers(GrContext* context, | 309 void GrLayerHoister::UnlockLayers(GrContext* context, |
310 const SkTDArray<GrHoistedLayer>& layers) { | 310 const SkTDArray<GrHoistedLayer>& layers) { |
311 GrLayerCache* layerCache = context->getLayerCache(); | 311 GrLayerCache* layerCache = context->getLayerCache(); |
312 | 312 |
313 for (int i = 0; i < layers.count(); ++i) { | 313 for (int i = 0; i < layers.count(); ++i) { |
314 layerCache->removeUse(layers[i].fLayer); | 314 layerCache->removeUse(layers[i].fLayer); |
315 } | 315 } |
316 | 316 |
317 SkDEBUGCODE(layerCache->validate();) | 317 #if DISABLE_CACHING |
318 } | |
319 | |
320 void GrLayerHoister::PurgeCache(GrContext* context) { | |
321 #if !GR_CACHE_HOISTED_LAYERS | |
322 GrLayerCache* layerCache = context->getLayerCache(); | |
323 | |
324 // This code completely clears out the atlas. It is required when | 318 // This code completely clears out the atlas. It is required when |
325 // caching is disabled so the atlas doesn't fill up and force more | 319 // caching is disabled so the atlas doesn't fill up and force more |
326 // free floating layers | 320 // free floating layers |
327 layerCache->purgeAll(); | 321 layerCache->purgeAll(); |
328 #endif | 322 #endif |
| 323 |
| 324 SkDEBUGCODE(layerCache->validate();) |
329 } | 325 } |
| 326 |
OLD | NEW |