summaryrefslogtreecommitdiff
path: root/libs/hwui/renderthread/RenderThread.cpp
diff options
context:
space:
mode:
authorYiwei Zhang <zzyiwei@google.com>2020-07-27 10:31:11 -0700
committerYiwei Zhang <zzyiwei@google.com>2020-07-28 09:52:14 -0700
commit12259e59c415b6c3c79ef23274e53f246ab2269f (patch)
treeb52e63efc37e523ba59380e3aac3ecbf41e8487e /libs/hwui/renderthread/RenderThread.cpp
parent43f44ad7e339de1c449d621e35be8d2d1ef1d60c (diff)
libhwui: avoid creating GPU context in Zygote
Creating GPU context besides loading the GPU driver would potentially affect graphics driver updatability. Currently, we always preload graphics drivers in Zygote to speed up app startup time. Upon using updatable driver, we'll unload the current driver and load the uploaded one. Although the symbol table is fully protected by the linkerconfig we setup in Android 10, we still have to make sure the driver has a clean state upon unloading and reloading. At this moment, Vulkan driver unloading has not been supported yet. So if we are going to turn on skia Vulkan backend by default, we should avoid preloading the Vulkan driver until the unloading feature is supported for Vulkan. Bug: 162242036 Bug: 135536511 Test: atest CtsUiRenderingTestCases all pass on GL backend Test: atest CtsUiRenderingTestCases no regression on VK backend Change-Id: I9084586315a7593be2cfe17710620aacce568d36
Diffstat (limited to 'libs/hwui/renderthread/RenderThread.cpp')
-rw-r--r--libs/hwui/renderthread/RenderThread.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/libs/hwui/renderthread/RenderThread.cpp b/libs/hwui/renderthread/RenderThread.cpp
index 206b58f62ea7..c34684710efd 100644
--- a/libs/hwui/renderthread/RenderThread.cpp
+++ b/libs/hwui/renderthread/RenderThread.cpp
@@ -162,6 +162,7 @@ void RenderThread::initializeChoreographer() {
}
void RenderThread::initThreadLocals() {
+ HardwareBitmapUploader::initialize();
setupFrameInterval();
initializeChoreographer();
mEglManager = new EglManager();
@@ -390,10 +391,12 @@ void RenderThread::preload() {
if (Properties::getRenderPipelineType() == RenderPipelineType::SkiaGL) {
std::thread eglInitThread([]() { eglGetDisplay(EGL_DEFAULT_DISPLAY); });
eglInitThread.detach();
- } else {
- requireVkContext();
}
- HardwareBitmapUploader::initialize();
+ // TODO: uncomment only after http://b/135536511 is fixed.
+ // else {
+ // uint32_t apiVersion;
+ // vkEnumerateInstanceVersion(&apiVersion);
+ //}
}
} /* namespace renderthread */