summaryrefslogtreecommitdiff
path: root/libs/hwui/renderthread/RenderThread.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libs/hwui/renderthread/RenderThread.cpp')
-rw-r--r--libs/hwui/renderthread/RenderThread.cpp15
1 files changed, 12 insertions, 3 deletions
diff --git a/libs/hwui/renderthread/RenderThread.cpp b/libs/hwui/renderthread/RenderThread.cpp
index bfae80f4698a..08edd20c0a0d 100644
--- a/libs/hwui/renderthread/RenderThread.cpp
+++ b/libs/hwui/renderthread/RenderThread.cpp
@@ -41,6 +41,7 @@
#include <utils/Condition.h>
#include <utils/Log.h>
#include <utils/Mutex.h>
+#include <thread>
namespace android {
namespace uirenderer {
@@ -175,9 +176,6 @@ void RenderThread::initThreadLocals() {
mRenderState = new RenderState(*this);
mVkManager = new VulkanManager();
mCacheManager = new CacheManager(mDisplayInfo);
- if (Properties::getRenderPipelineType() == RenderPipelineType::SkiaVulkan) {
- requireVkContext();
- }
}
void RenderThread::requireGlContext() {
@@ -409,6 +407,17 @@ bool RenderThread::isCurrent() {
return gettid() == getInstance().getTid();
}
+void RenderThread::preload() {
+ std::thread eglInitThread([]() {
+ //TODO: don't load EGL drivers for Vulkan, when HW bitmap uploader is refactored.
+ eglGetDisplay(EGL_DEFAULT_DISPLAY);
+ });
+ eglInitThread.detach();
+ if (Properties::getRenderPipelineType() == RenderPipelineType::SkiaVulkan) {
+ requireVkContext();
+ }
+}
+
} /* namespace renderthread */
} /* namespace uirenderer */
} /* namespace android */