summaryrefslogtreecommitdiff
path: root/external
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@collabora.com>2019-12-19 21:39:46 +0100
committerLuboš Luňák <l.lunak@collabora.com>2020-01-06 11:14:39 +0100
commitad88df7e924f2be11187b15085b0764771546abe (patch)
tree2c190fbc63c4fbaa2df6ac3f983fcaf425cb7f7b /external
parentb8c3ca05d04fb0bf3c27c889747bef99abcdf306 (diff)
avoid Skia assert on leaked resources
Change-Id: Ie9d9117c43d19b9391f8e0dee6825076aaa12706 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/85582 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
Diffstat (limited to 'external')
-rw-r--r--external/skia/share-grcontext.patch.122
1 files changed, 13 insertions, 9 deletions
diff --git a/external/skia/share-grcontext.patch.1 b/external/skia/share-grcontext.patch.1
index ea5952eeac1d..96a4fce322e5 100644
--- a/external/skia/share-grcontext.patch.1
+++ b/external/skia/share-grcontext.patch.1
@@ -1,5 +1,5 @@
diff --git a/tools/sk_app/VulkanWindowContext.cpp b/tools/sk_app/VulkanWindowContext.cpp
-index c2b26b4254..ef84f7902a 100644
+index c2b26b4254..e8ddbcc886 100644
--- a/tools/sk_app/VulkanWindowContext.cpp
+++ b/tools/sk_app/VulkanWindowContext.cpp
@@ -24,8 +24,10 @@
@@ -271,7 +271,7 @@ index c2b26b4254..ef84f7902a 100644
fBackbuffers[i].fRenderSemaphore,
nullptr));
}
-@@ -411,41 +429,55 @@ VulkanWindowContext::~VulkanWindowContext() {
+@@ -411,41 +429,59 @@ VulkanWindowContext::~VulkanWindowContext() {
void VulkanWindowContext::destroyContext() {
if (this->isValid()) {
fQueueWaitIdle(fPresentQueue);
@@ -299,18 +299,22 @@ index c2b26b4254..ef84f7902a 100644
+
+ checkDestroyShared();
+}
-
-- if (VK_NULL_HANDLE != fDevice) {
-- fDestroyDevice(fDevice, nullptr);
-- fDevice = VK_NULL_HANDLE;
++
+void VulkanWindowContext::checkDestroyShared()
+{
+ if(!fGlobalShared || !fGlobalShared->unique()) // TODO mutex?
+ return;
++#ifndef SK_TRACE_VK_RESOURCES
++ if(!fGlobalShared->fContext->unique())
++ return;
++#endif
+ SkASSERT(fGlobalShared->fContext->unique());
+ fGlobalShared->fContext.reset();
+ fGlobalShared->fInterface.reset();
-+
+
+- if (VK_NULL_HANDLE != fDevice) {
+- fDestroyDevice(fDevice, nullptr);
+- fDevice = VK_NULL_HANDLE;
+ if (VK_NULL_HANDLE != fGlobalShared->fDevice) {
+ fGlobalShared->fDestroyDevice(fGlobalShared->fDevice, nullptr);
+ fGlobalShared->fDevice = VK_NULL_HANDLE;
@@ -340,7 +344,7 @@ index c2b26b4254..ef84f7902a 100644
}
VulkanWindowContext::BackbufferInfo* VulkanWindowContext::getAvailableBackbuffer() {
-@@ -471,35 +503,35 @@ sk_sp<SkSurface> VulkanWindowContext::getBackbufferSurface() {
+@@ -471,35 +507,35 @@ sk_sp<SkSurface> VulkanWindowContext::getBackbufferSurface() {
semaphoreInfo.pNext = nullptr;
semaphoreInfo.flags = 0;
VkSemaphore semaphore;
@@ -382,7 +386,7 @@ index c2b26b4254..ef84f7902a 100644
return nullptr;
}
}
-@@ -543,4 +575,6 @@ void VulkanWindowContext::swapBuffers() {
+@@ -543,4 +579,6 @@ void VulkanWindowContext::swapBuffers() {
fQueuePresentKHR(fPresentQueue, &presentInfo);
}