summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Yichi Chen <yichichen@android.com> 2018-03-29 21:41:07 +0800
committer Yichi Chen <yichichen@google.com> 2018-09-04 04:05:13 +0000
commit42cf494a6ec8a96b40096c84acf5f15d1fef4417 (patch)
treef4eea82f341669a8302e2460610e1e8b3e5fd77f
parent24d971f469272b59b45490487247f7c4d876c0ab (diff)
Add API to clear BlobCache when cache validation fails
SkSL shader cache requests a method to flush out entire BlobCache when cache validation fails. Add a new API in BlobCache for the action. Bug: b/71800782 Test: hwui_unit_tests Change-Id: Ife4db9a5d0523972133ec1a9744f001de050efeb
-rw-r--r--opengl/libs/EGL/BlobCache.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/opengl/libs/EGL/BlobCache.h b/opengl/libs/EGL/BlobCache.h
index 1f5d5357e6..e5c5e5bc25 100644
--- a/opengl/libs/EGL/BlobCache.h
+++ b/opengl/libs/EGL/BlobCache.h
@@ -97,6 +97,10 @@ public:
//
int unflatten(void const* buffer, size_t size);
+ // clear flushes out all contents of the cache then the BlobCache, leaving
+ // it in an empty state.
+ void clear() { mCacheEntries.clear(); }
+
protected:
// mMaxTotalSize is the maximum size that all cache entries can occupy. This
// includes space for both keys and values. When a call to BlobCache::set