Enable Skia shader cache
Enable Skia shader cache after fix for image and text drawing
issues were landed in Skia.
Test: Ran Hangouts, Settings, CNN, Drive, GMail, Calendar, Clock
Test: Maps, Docs, Play store, YouTube apps.
Change-Id: I94cd07e95b704bc164894aa8b8c63f49ded198f5
diff --git a/libs/hwui/renderthread/CacheManager.cpp b/libs/hwui/renderthread/CacheManager.cpp
index a33b287..5e89fae 100644
--- a/libs/hwui/renderthread/CacheManager.cpp
+++ b/libs/hwui/renderthread/CacheManager.cpp
@@ -17,7 +17,9 @@
#include "CacheManager.h"
#include "Layer.h"
+#include "Properties.h"
#include "RenderThread.h"
+#include "pipeline/skia/ShaderCache.h"
#include "renderstate/RenderState.h"
#include <GrContextOptions.h>
@@ -46,6 +48,9 @@
mVectorDrawableAtlas = new skiapipeline::VectorDrawableAtlas(
mMaxSurfaceArea / 2,
skiapipeline::VectorDrawableAtlas::StorageMode::disallowSharedSurface);
+ if (Properties::isSkiaEnabled()) {
+ skiapipeline::ShaderCache::get().initShaderDiskCache();
+ }
}
void CacheManager::reset(GrContext* context) {
@@ -127,6 +132,8 @@
}
contextOptions->fExecutor = mTaskProcessor.get();
}
+
+ contextOptions->fPersistentCache = &skiapipeline::ShaderCache::get();
}
void CacheManager::trimMemory(TrimMemoryMode mode) {