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.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/libs/hwui/renderthread/RenderThread.cpp b/libs/hwui/renderthread/RenderThread.cpp
index a101d46f6da0..7750a31b817f 100644
--- a/libs/hwui/renderthread/RenderThread.cpp
+++ b/libs/hwui/renderthread/RenderThread.cpp
@@ -199,7 +199,10 @@ void RenderThread::requireGlContext() {
void RenderThread::requireVkContext() {
// the getter creates the context in the event it had been destroyed by destroyRenderingContext
- if (vulkanManager().hasVkContext()) {
+ // Also check if we have a GrContext before returning fast. VulkanManager may be shared with
+ // the HardwareBitmapUploader which initializes the Vk context without persisting the GrContext
+ // in the rendering thread.
+ if (vulkanManager().hasVkContext() && mGrContext) {
return;
}
mVkManager->initialize();