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/threaded/RenderEngineThreaded.cpp b/libs/renderengine/threaded/RenderEngineThreaded.cpp
index 08f2949..3b97f56 100644
--- a/libs/renderengine/threaded/RenderEngineThreaded.cpp
+++ b/libs/renderengine/threaded/RenderEngineThreaded.cpp
@@ -147,33 +147,29 @@
 }
 
 void RenderEngineThreaded::cacheExternalTextureBuffer(const sp<GraphicBuffer>& buffer) {
-    std::promise<void> resultPromise;
-    std::future<void> resultFuture = resultPromise.get_future();
+    // This function is designed so it can run asynchronously, so we do not need to wait
+    // for the futures.
     {
         std::lock_guard lock(mThreadMutex);
-        mFunctionCalls.push([&resultPromise, &buffer](renderengine::RenderEngine& instance) {
+        mFunctionCalls.push([=](renderengine::RenderEngine& instance) {
             ATRACE_NAME("REThreaded::cacheExternalTextureBuffer");
             instance.cacheExternalTextureBuffer(buffer);
-            resultPromise.set_value();
         });
     }
     mCondition.notify_one();
-    resultFuture.wait();
 }
 
 void RenderEngineThreaded::unbindExternalTextureBuffer(uint64_t bufferId) {
-    std::promise<void> resultPromise;
-    std::future<void> resultFuture = resultPromise.get_future();
+    // This function is designed so it can run asynchronously, so we do not need to wait
+    // for the futures.
     {
         std::lock_guard lock(mThreadMutex);
-        mFunctionCalls.push([&resultPromise, &bufferId](renderengine::RenderEngine& instance) {
+        mFunctionCalls.push([=](renderengine::RenderEngine& instance) {
             ATRACE_NAME("REThreaded::unbindExternalTextureBuffer");
             instance.unbindExternalTextureBuffer(bufferId);
-            resultPromise.set_value();
         });
     }
     mCondition.notify_one();
-    resultFuture.wait();
 }
 
 size_t RenderEngineThreaded::getMaxTextureSize() const {