Caching images and textures for threaded Skia RE

Skia also performs texture generation and deletion when
we create an image. This needs to happen on the same thread.
Running Skia on it's own thread, will allow async caching
of images, and hopefully increasing the start up/transition
of application.

Screenshot of the parallel caching:
https://screenshot.googleplex.com/BUnne3urcoavykk

Test results for DisplayOrientationMicrobench test for
SFSTATS_GLOBAL_RENDER_ENGINE_DURATION_AVG metric:
skiathreaded 1st run: 5.750296 ms
skia threaded 2nd run: 5.530306 ms
gles: 4.974821 ms
skia: 6.374791 ms

Test: Set renderengine backend to 'skiathreaded'.
      - run libsurfaceflinger_test, SurfaceFlinger_test
      - open apps
      - switch between apps
Bug: 175312877
Change-Id: I6521f9ddfadff8c839bdd7071c2bd6cfadebb663
diff --git a/libs/renderengine/skia/SkiaGLRenderEngine.h b/libs/renderengine/skia/SkiaGLRenderEngine.h
index ed62a2a..e344f41 100644
--- a/libs/renderengine/skia/SkiaGLRenderEngine.h
+++ b/libs/renderengine/skia/SkiaGLRenderEngine.h
@@ -50,6 +50,7 @@
                        EGLSurface protectedPlaceholder);
     ~SkiaGLRenderEngine() override EXCLUDES(mRenderingMutex);
 
+    void cacheExternalTextureBuffer(const sp<GraphicBuffer>& buffer) override;
     void unbindExternalTextureBuffer(uint64_t bufferId) override;
     status_t drawLayers(const DisplaySettings& display,
                         const std::vector<const LayerSettings*>& layers,
@@ -128,6 +129,10 @@
     bool mInProtectedContext = false;
     // Object to capture commands send to Skia.
     std::unique_ptr<SkiaCapture> mCapture;
+
+    // Keep this information as a local variable to determine whether the access of the GL
+    // operations is working on the same threads.
+    const RenderEngineType mRenderEngineType = RenderEngineType::SKIA_GL;
 };
 
 } // namespace skia