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/Cache.h b/libs/renderengine/skia/Cache.h
new file mode 100644
index 0000000..437571e
--- /dev/null
+++ b/libs/renderengine/skia/Cache.h
@@ -0,0 +1,31 @@
+/*
+ * Copyright 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#pragma once
+
+namespace android::renderengine::skia {
+
+class SkiaRenderEngine;
+
+class Cache {
+public:
+    static void primeShaderCache(SkiaRenderEngine*);
+
+private:
+    Cache() = default;
+};
+
+} // namespace android::renderengine::skia