From 4ab5a9048cf327adfc9ef9757ea956d7003ba047 Mon Sep 17 00:00:00 2001 From: robertphillips Date: Wed, 29 Oct 2014 13:56:02 -0700 Subject: Discard atlas after every MultiPictureDraw::draw This is intended to prevent ghosting on tiled architectures. This CL also defers creation of the atlas (and its texture) until it is actually needed. Committed: https://skia.googlesource.com/skia/+/6d5b5455743414ddb11d2b8c1fe9d7959f2b853d Review URL: https://codereview.chromium.org/678403002 --- src/gpu/GrLayerHoister.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'src/gpu/GrLayerHoister.cpp') diff --git a/src/gpu/GrLayerHoister.cpp b/src/gpu/GrLayerHoister.cpp index 1f7ce419ae..00576710cd 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();) } - -- cgit v1.2.3