external/skia/share-grcontext.patch.1 |   17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)

New commits:
commit f052c18cee0a0245b4d26008b3d1cd7290ce64a4
Author:     Mike Kaganski <mike.kagan...@collabora.com>
AuthorDate: Fri Oct 11 11:35:22 2024 +0500
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Fri Oct 11 09:30:34 2024 +0200

    Restore an accidentally dropped line in the Skia patch
    
    Regression since commit 4e9a21bb0e4981e834de22c1d666f7a83a2771c5
    (Update to skia m116, 2024-10-07) - actually it was about m117.
    The dropped line initialized fImageCount; and without it, that
    uninitialized variable held whatever garbage was there. E.g., I
    saw a value of 3452816845, meaning that it allocated 3.5 billion
    of VkImage, clearing the memory took about 10 seconds per each
    window initialization (main window creation, menu popup, dialog
    and so on), and crashes.
    
    Change-Id: I1d5fc9c6f29e302c46aa0380e528cac64f58c85b
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174803
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>
    Tested-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/external/skia/share-grcontext.patch.1 
b/external/skia/share-grcontext.patch.1
index e19503a9a1aa..248caab8eeb6 100644
--- a/external/skia/share-grcontext.patch.1
+++ b/external/skia/share-grcontext.patch.1
@@ -481,11 +481,12 @@ diff -ur skia.org/tools/window/VulkanWindowContext.cpp 
skia/tools/window/VulkanW
      }
 
      return true;
-@@ -344,10 +365,9 @@
+@@ -344,10 +365,10 @@
                                          VkImageUsageFlags usageFlags,
                                          SkColorType colorType,
                                          VkSharingMode sharingMode) {
 -    fGetSwapchainImagesKHR(fDevice, fSwapchain, &fImageCount, nullptr);
++    fGetSwapchainImagesKHR(fShared->fDevice, fSwapchain, &fImageCount, 
nullptr);
      SkASSERT(fImageCount);
      fImages = new VkImage[fImageCount];
 -    fGetSwapchainImagesKHR(fDevice, fSwapchain, &fImageCount, fImages);
@@ -493,7 +494,7 @@ diff -ur skia.org/tools/window/VulkanWindowContext.cpp 
skia/tools/window/VulkanW
 
      // set up initial image layouts and create surfaces
      fImageLayouts = new VkImageLayout[fImageCount];
-@@ -363,7 +383,7 @@
+@@ -363,7 +384,7 @@
          info.fFormat = format;
          info.fImageUsageFlags = usageFlags;
          info.fLevelCount = 1;
@@ -502,7 +503,7 @@ diff -ur skia.org/tools/window/VulkanWindowContext.cpp 
skia/tools/window/VulkanW
          info.fProtected = 
skgpu::Protected(fDisplayParams.fCreateProtectedNativeBackend);
          info.fSharingMode = sharingMode;
 
-@@ -406,8 +426,8 @@
+@@ -406,8 +427,8 @@
      fBackbuffers = new BackbufferInfo[fImageCount + 1];
      for (uint32_t i = 0; i < fImageCount + 1; ++i) {
          fBackbuffers[i].fImageIndex = -1;
@@ -513,7 +514,7 @@ diff -ur skia.org/tools/window/VulkanWindowContext.cpp 
skia/tools/window/VulkanW
                                  &fBackbuffers[i].fRenderSemaphore));
          SkASSERT(result == VK_SUCCESS);
      }
-@@ -420,8 +440,8 @@
+@@ -420,8 +441,8 @@
      if (fBackbuffers) {
          for (uint32_t i = 0; i < fImageCount + 1; ++i) {
              fBackbuffers[i].fImageIndex = -1;
@@ -524,7 +525,7 @@ diff -ur skia.org/tools/window/VulkanWindowContext.cpp 
skia/tools/window/VulkanW
                                          fBackbuffers[i].fRenderSemaphore,
                                          nullptr));
          }
-@@ -446,42 +466,59 @@
+@@ -446,42 +467,59 @@
  void VulkanWindowContext::destroyContext() {
      if (this->isValid()) {
          fQueueWaitIdle(fPresentQueue);
@@ -598,7 +599,7 @@ diff -ur skia.org/tools/window/VulkanWindowContext.cpp 
skia/tools/window/VulkanW
  }
 
  VulkanWindowContext::BackbufferInfo* 
VulkanWindowContext::getAvailableBackbuffer() {
-@@ -507,35 +544,35 @@
+@@ -507,35 +545,35 @@
      semaphoreInfo.pNext = nullptr;
      semaphoreInfo.flags = 0;
      VkSemaphore semaphore;
@@ -640,7 +641,7 @@ diff -ur skia.org/tools/window/VulkanWindowContext.cpp 
skia/tools/window/VulkanW
              return nullptr;
          }
      }
-@@ -560,7 +597,7 @@
+@@ -560,7 +598,7 @@
      info.fNumSemaphores = 1;
      info.fSignalSemaphores = &beSemaphore;
      skgpu::MutableTextureState presentState = 
skgpu::MutableTextureStates::MakeVulkan(
@@ -649,7 +650,7 @@ diff -ur skia.org/tools/window/VulkanWindowContext.cpp 
skia/tools/window/VulkanW
      auto dContext = surface->recordingContext()->asDirectContext();
      dContext->flush(surface, info, &presentState);
      dContext->submit();
-@@ -581,4 +618,6 @@
+@@ -581,4 +619,6 @@
      fQueuePresentKHR(fPresentQueue, &presentInfo);
  }
 

Reply via email to