Index: src/gpu/GrLayerHoister.cpp |
diff --git a/src/gpu/GrLayerHoister.cpp b/src/gpu/GrLayerHoister.cpp |
index 1f7ce419ae8100ae22e4d81563f14f7021d50774..00576710cdaaf7ec466e6c99a3160701139996a7 100644 |
--- a/src/gpu/GrLayerHoister.cpp |
+++ b/src/gpu/GrLayerHoister.cpp |
@@ -314,13 +314,16 @@ void GrLayerHoister::UnlockLayers(GrContext* context, |
layerCache->removeUse(layers[i].fLayer); |
} |
-#if DISABLE_CACHING |
+ SkDEBUGCODE(layerCache->validate();) |
+} |
+ |
+void GrLayerHoister::PurgeCache(GrContext* context) { |
+#if !GR_CACHE_HOISTED_LAYERS |
+ GrLayerCache* layerCache = context->getLayerCache(); |
+ |
// This code completely clears out the atlas. It is required when |
// caching is disabled so the atlas doesn't fill up and force more |
// free floating layers |
layerCache->purgeAll(); |
#endif |
- |
- SkDEBUGCODE(layerCache->validate();) |
} |
- |