Add support for dummy draws for Vulkan webview and texture views.
Test: manual testing
Change-Id: Iaec8c3a34367673c281665ff6c6e97d1ce532265
diff --git a/libs/hwui/renderthread/VulkanManager.cpp b/libs/hwui/renderthread/VulkanManager.cpp
index 68c04af..2b90744 100644
--- a/libs/hwui/renderthread/VulkanManager.cpp
+++ b/libs/hwui/renderthread/VulkanManager.cpp
@@ -19,6 +19,7 @@
#include "DeviceInfo.h"
#include "Properties.h"
#include "RenderThread.h"
+#include "renderstate/RenderState.h"
#include <GrContext.h>
#include <GrTypes.h>
@@ -37,10 +38,14 @@
void VulkanManager::destroy() {
if (!hasVkContext()) return;
+ mRenderThread.renderState().onVkContextDestroyed();
+ mRenderThread.setGrContext(nullptr);
+
if (VK_NULL_HANDLE != mCommandPool) {
mDestroyCommandPool(mBackendContext->fDevice, mCommandPool, nullptr);
mCommandPool = VK_NULL_HANDLE;
}
+ mBackendContext.reset();
}
void VulkanManager::initialize() {
@@ -105,6 +110,8 @@
if (Properties::enablePartialUpdates && Properties::useBufferAge) {
mSwapBehavior = SwapBehavior::BufferAge;
}
+
+ mRenderThread.renderState().onVkContextCreated();
}
// Returns the next BackbufferInfo to use for the next draw. The function will make sure all
@@ -156,6 +163,9 @@
if (!createSwapchain(surface)) {
return nullptr;
}
+ backbuffer = getAvailableBackbuffer(surface);
+ res = mResetFences(mBackendContext->fDevice, 2, backbuffer->mUsageFences);
+ SkASSERT(VK_SUCCESS == res);
// acquire the image
res = mAcquireNextImageKHR(mBackendContext->fDevice, surface->mSwapchain, UINT64_MAX,