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
diff --git a/src/gpu/GrLayerHoister.h b/src/gpu/GrLayerHoister.h
index 82dd967..c3a451d 100644
--- a/src/gpu/GrLayerHoister.h
+++ b/src/gpu/GrLayerHoister.h
@@ -87,6 +87,12 @@
@param layers Unneeded layers in the atlas
*/
static void UnlockLayers(GrContext* context, const SkTDArray<GrHoistedLayer>& layers);
+
+ /** Forceably remove all cached layers and release the atlas. Useful for debugging and timing.
+ This is only functional when GR_CACHE_HOISTED_LAYERS is set to 1 in GrLayerCache.h
+ @param context Owner of the layer cache (and thus the layers)
+ */
+ static void PurgeCache(GrContext* context);
};
#endif