Implement SkiaGLRenderEngine::primeCache
Bug: 178661709
Test: perfetto/systrace
SkiaGLRenderEngine is unable to write to disk, so it cannot have a
persistent cache for shaders. Instead, warm up the cache by calling
drawLayers in the ways we expect to see it called during actual use.
Currently, this just uses parameters seen when opening the dialer, which
required compiling several shaders. Future CLs will expand this to cover
other cases.
Remove the const modifier from primeCache. Conceptually, it is not
const, since we want to change some state (what's in the cache). More
practically, it is now calling drawLayers, which is not const.
Change-Id: I4bad4ff6cf79d4cd81eef1a5bee6530b3bdc0e84
diff --git a/libs/renderengine/skia/SkiaGLRenderEngine.cpp b/libs/renderengine/skia/SkiaGLRenderEngine.cpp
index cbb02a3..f504a9a 100644
--- a/libs/renderengine/skia/SkiaGLRenderEngine.cpp
+++ b/libs/renderengine/skia/SkiaGLRenderEngine.cpp
@@ -40,6 +40,7 @@
#include <ui/DebugUtils.h>
#include <ui/GraphicBuffer.h>
#include <utils/Trace.h>
+#include "Cache.h"
#include <cmath>
#include <cstdint>
@@ -224,6 +225,10 @@
return engine;
}
+void SkiaGLRenderEngine::primeCache() {
+ Cache::primeShaderCache(this);
+}
+
EGLConfig SkiaGLRenderEngine::chooseEglConfig(EGLDisplay display, int format, bool logConfig) {
status_t err;
EGLConfig config;