download.lst                                                             |    
4 
 external/skia/0004-loong64-Fix-the-remaining-implicit-vector-casts.patch |    
2 
 external/skia/Library_skia.mk                                            |   
66 ++---
 external/skia/fontconfig-get-typeface.patch.1                            |   
17 -
 external/skia/share-grcontext.patch.1                                    |  
121 ++++------
 external/skia/swap-buffers-rect.patch.1                                  |    
7 
 vcl/skia/gdiimpl.cxx                                                     |   
16 -
 7 files changed, 108 insertions(+), 125 deletions(-)

New commits:
commit 027c65e72e49c1c5dae9d6b5f8151cd2d27442a7
Author:     Xisco Fauli <[email protected]>
AuthorDate: Wed Jul 2 14:31:20 2025 +0200
Commit:     Xisco Fauli <[email protected]>
CommitDate: Fri Jul 4 08:16:53 2025 +0200

    skia: upgrade to m139
    
    File created following the steps in external/skia/README
    
    Change-Id: I562687354075ab7d19afbe108bfd575db034b7c7
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/187288
    Reviewed-by: Xisco Fauli <[email protected]>
    Tested-by: Jenkins

diff --git a/download.lst b/download.lst
index 4a68922cf36b..975835b808fa 100644
--- a/download.lst
+++ b/download.lst
@@ -642,8 +642,8 @@ RHINO_TARBALL := rhino-1.7.15.zip
 # three static lines
 # so that git cherry-pick
 # will not run into conflicts
-SKIA_SHA256SUM := 
60a804b93a37aff459742262f965ed7643b587c2e9f657d230a75a556e1baf56
-SKIA_TARBALL := skia-m138-a46d5732d9fca93eaec23e502e2eef814b707e6b.tar.xz
+SKIA_SHA256SUM := 
4502006581d41f4ca4c6fd1cf6426f764fdc2530d4994f3ab0aed95c92be6245
+SKIA_TARBALL := skia-m139-0f94c19331c51259e23bee547b2657b5ad7dff26.tar.xz
 # three static lines
 # so that git cherry-pick
 # will not run into conflicts
diff --git 
a/external/skia/0004-loong64-Fix-the-remaining-implicit-vector-casts.patch 
b/external/skia/0004-loong64-Fix-the-remaining-implicit-vector-casts.patch
index 85d227bad2db..722b9f3e3bff 100644
--- a/external/skia/0004-loong64-Fix-the-remaining-implicit-vector-casts.patch
+++ b/external/skia/0004-loong64-Fix-the-remaining-implicit-vector-casts.patch
@@ -35,7 +35,7 @@ diff --git a/src/core/SkBlurEngine.cpp 
b/src/core/SkBlurEngine.cpp
 index 2c18eb0fb2e7..1c8e9bdb7945 100644
 --- a/src/core/SkBlurEngine.cpp
 +++ b/src/core/SkBlurEngine.cpp
-@@ -330,61 +330,61 @@ private:
+@@ -556,33 +556,33 @@
          skvx::Vec<4, uint32_t>* buffer0Cursor = fBuffer0Cursor;
          skvx::Vec<4, uint32_t>* buffer1Cursor = fBuffer1Cursor;
          skvx::Vec<4, uint32_t>* buffer2Cursor = fBuffer2Cursor;
diff --git a/external/skia/Library_skia.mk b/external/skia/Library_skia.mk
index b1146f746478..c79fb9957abe 100644
--- a/external/skia/Library_skia.mk
+++ b/external/skia/Library_skia.mk
@@ -163,6 +163,7 @@ endif
 ifneq ($(filter-out WNT MACOSX,$(OS)),)
 $(eval $(call gb_Library_add_generated_exception_objects,skia,\
     UnpackedTarball/skia/src/ports/SkFontMgr_fontconfig \
+    UnpackedTarball/skia/src/ports/SkFontMgr_fontconfig_freetype \
 ))
 endif
 
@@ -590,38 +591,38 @@ $(eval $(call 
gb_Library_add_generated_exception_objects,skia,\
 # from file skia/gn/core.gni:667, target "skia_pathops_sources"
 #
 $(eval $(call gb_Library_add_generated_exception_objects,skia,\
-    UnpackedTarball/skia/src/pathops/SkAddIntersections \
-    UnpackedTarball/skia/src/pathops/SkDConicLineIntersection \
-    UnpackedTarball/skia/src/pathops/SkDCubicLineIntersection \
-    UnpackedTarball/skia/src/pathops/SkDCubicToQuads \
-    UnpackedTarball/skia/src/pathops/SkDLineIntersection \
-    UnpackedTarball/skia/src/pathops/SkDQuadLineIntersection \
-    UnpackedTarball/skia/src/pathops/SkIntersections \
-    UnpackedTarball/skia/src/pathops/SkOpAngle \
-    UnpackedTarball/skia/src/pathops/SkOpBuilder \
-    UnpackedTarball/skia/src/pathops/SkOpCoincidence \
-    UnpackedTarball/skia/src/pathops/SkOpContour \
-    UnpackedTarball/skia/src/pathops/SkOpCubicHull \
-    UnpackedTarball/skia/src/pathops/SkOpEdgeBuilder \
-    UnpackedTarball/skia/src/pathops/SkOpSegment \
-    UnpackedTarball/skia/src/pathops/SkOpSpan \
-    UnpackedTarball/skia/src/pathops/SkPathOpsAsWinding \
-    UnpackedTarball/skia/src/pathops/SkPathOpsCommon \
-    UnpackedTarball/skia/src/pathops/SkPathOpsConic \
-    UnpackedTarball/skia/src/pathops/SkPathOpsCubic \
-    UnpackedTarball/skia/src/pathops/SkPathOpsCurve \
-    UnpackedTarball/skia/src/pathops/SkPathOpsDebug \
-    UnpackedTarball/skia/src/pathops/SkPathOpsLine \
-    UnpackedTarball/skia/src/pathops/SkPathOpsOp \
-    UnpackedTarball/skia/src/pathops/SkPathOpsQuad \
-    UnpackedTarball/skia/src/pathops/SkPathOpsRect \
-    UnpackedTarball/skia/src/pathops/SkPathOpsSimplify \
-    UnpackedTarball/skia/src/pathops/SkPathOpsTSect \
-    UnpackedTarball/skia/src/pathops/SkPathOpsTightBounds \
-    UnpackedTarball/skia/src/pathops/SkPathOpsTypes \
-    UnpackedTarball/skia/src/pathops/SkPathOpsWinding \
-    UnpackedTarball/skia/src/pathops/SkPathWriter \
-    UnpackedTarball/skia/src/pathops/SkReduceOrder \
+    UnpackedTarball/skia/modules/pathops/src/SkAddIntersections \
+    UnpackedTarball/skia/modules/pathops/src/SkDConicLineIntersection \
+    UnpackedTarball/skia/modules/pathops/src/SkDCubicLineIntersection \
+    UnpackedTarball/skia/modules/pathops/src/SkDCubicToQuads \
+    UnpackedTarball/skia/modules/pathops/src/SkDLineIntersection \
+    UnpackedTarball/skia/modules/pathops/src/SkDQuadLineIntersection \
+    UnpackedTarball/skia/modules/pathops/src/SkIntersections \
+    UnpackedTarball/skia/modules/pathops/src/SkOpAngle \
+    UnpackedTarball/skia/modules/pathops/src/SkOpBuilder \
+    UnpackedTarball/skia/modules/pathops/src/SkOpCoincidence \
+    UnpackedTarball/skia/modules/pathops/src/SkOpContour \
+    UnpackedTarball/skia/modules/pathops/src/SkOpCubicHull \
+    UnpackedTarball/skia/modules/pathops/src/SkOpEdgeBuilder \
+    UnpackedTarball/skia/modules/pathops/src/SkOpSegment \
+    UnpackedTarball/skia/modules/pathops/src/SkOpSpan \
+    UnpackedTarball/skia/modules/pathops/src/SkPathOpsAsWinding \
+    UnpackedTarball/skia/modules/pathops/src/SkPathOpsCommon \
+    UnpackedTarball/skia/modules/pathops/src/SkPathOpsConic \
+    UnpackedTarball/skia/modules/pathops/src/SkPathOpsCubic \
+    UnpackedTarball/skia/modules/pathops/src/SkPathOpsCurve \
+    UnpackedTarball/skia/modules/pathops/src/SkPathOpsDebug \
+    UnpackedTarball/skia/modules/pathops/src/SkPathOpsLine \
+    UnpackedTarball/skia/modules/pathops/src/SkPathOpsOp \
+    UnpackedTarball/skia/modules/pathops/src/SkPathOpsQuad \
+    UnpackedTarball/skia/modules/pathops/src/SkPathOpsRect \
+    UnpackedTarball/skia/modules/pathops/src/SkPathOpsSimplify \
+    UnpackedTarball/skia/modules/pathops/src/SkPathOpsTSect \
+    UnpackedTarball/skia/modules/pathops/src/SkPathOpsTightBounds \
+    UnpackedTarball/skia/modules/pathops/src/SkPathOpsTypes \
+    UnpackedTarball/skia/modules/pathops/src/SkPathOpsWinding \
+    UnpackedTarball/skia/modules/pathops/src/SkPathWriter \
+    UnpackedTarball/skia/modules/pathops/src/SkReduceOrder \
 ))
 
 # from file skia/gn/core.gni:736, target "skia_skpicture_sources"
@@ -1249,6 +1250,7 @@ $(eval $(call 
gb_Library_add_generated_exception_objects,skia,\
     UnpackedTarball/skia/src/gpu/vk/VulkanInterface \
     UnpackedTarball/skia/src/gpu/vk/VulkanMemory \
     UnpackedTarball/skia/src/gpu/vk/VulkanMutableTextureState \
+    UnpackedTarball/skia/src/gpu/vk/VulkanPreferredFeatures \
     UnpackedTarball/skia/src/gpu/vk/VulkanUtilsPriv \
 ))
 endif
diff --git a/external/skia/fontconfig-get-typeface.patch.1 
b/external/skia/fontconfig-get-typeface.patch.1
index 6653b50255b5..47c857d57405 100644
--- a/external/skia/fontconfig-get-typeface.patch.1
+++ b/external/skia/fontconfig-get-typeface.patch.1
@@ -1,16 +1,18 @@
 diff -ur skia.org/include/ports/SkFontMgr_fontconfig.h 
skia/include/ports/SkFontMgr_fontconfig.h
 --- skia.org/include/ports/SkFontMgr_fontconfig.h      2024-10-09 
10:25:16.421928663 +0200
 +++ skia/include/ports/SkFontMgr_fontconfig.h  2024-10-09 10:27:17.914640682 
+0200
-@@ -21,4 +21,9 @@
+@@ -21,6 +21,11 @@
  class SkFontScanner;
  SK_API sk_sp<SkFontMgr> SkFontMgr_New_FontConfig(FcConfig* fc, 
std::unique_ptr<SkFontScanner> scanner);
- SK_API sk_sp<SkFontMgr> SkFontMgr_New_FontConfig(FcConfig* fc);
+ 
 +struct _FcPattern;
 +typedef struct _FcPattern FcPattern;
 +class SkTypeface;
 +SK_API sk_sp<SkTypeface> SkFontMgr_createTypefaceFromFcPattern(const 
sk_sp<SkFontMgr>& mgr, FcPattern* pattern);
 +
- #endif // #ifndef SkFontMgr_fontconfig_DEFINED
+ #if !defined(SK_DISABLE_LEGACY_FONTCONFIG_FACTORY)
+ SK_API sk_sp<SkFontMgr> SkFontMgr_New_FontConfig(FcConfig* fc);
+ #endif
 diff -ur skia.org/src/ports/SkFontMgr_fontconfig.cpp 
skia/src/ports/SkFontMgr_fontconfig.cpp
 --- skia.org/src/ports/SkFontMgr_fontconfig.cpp        2024-10-09 
10:25:16.460928891 +0200
 +++ skia/src/ports/SkFontMgr_fontconfig.cpp    2024-10-09 10:27:30.405714112 
+0200
@@ -22,14 +24,10 @@ diff -ur skia.org/src/ports/SkFontMgr_fontconfig.cpp 
skia/src/ports/SkFontMgr_fo
      sk_sp<SkTypeface> createTypefaceFromFcPattern(SkAutoFcPattern pattern) 
const {
          if (!pattern) {
              return nullptr;
-@@ -1043,6 +1044,16 @@
+@@ -994,3 +994,13 @@
+ sk_sp<SkFontMgr> SkFontMgr_New_FontConfig(FcConfig* fc, 
std::unique_ptr<SkFontScanner> scanner) {
      return sk_make_sp<SkFontMgr_fontconfig>(fc, std::move(scanner));
  }
-
--sk_sp<SkFontMgr> SkFontMgr_New_FontConfig(FcConfig* fc) {
-+SK_API sk_sp<SkFontMgr> SkFontMgr_New_FontConfig(FcConfig* fc) {
-     return sk_make_sp<SkFontMgr_fontconfig>(fc, 
SkFontScanner_Make_FreeType());
- }
 +
 +SK_API sk_sp<SkTypeface> SkFontMgr_createTypefaceFromFcPattern(const 
sk_sp<SkFontMgr>& mgr, FcPattern* pattern)
 +{
@@ -40,4 +38,3 @@ diff -ur skia.org/src/ports/SkFontMgr_fontconfig.cpp 
skia/src/ports/SkFontMgr_fo
 +    }());
 +    return 
static_cast<SkFontMgr_fontconfig*>(mgr.get())->createTypefaceFromFcPattern(std::move(p));
 +}
-Only in skia/src/ports: SkFontMgr_fontconfig.cpp.orig
diff --git a/external/skia/share-grcontext.patch.1 
b/external/skia/share-grcontext.patch.1
index 2526b12a1223..c3a984cb48d2 100644
--- a/external/skia/share-grcontext.patch.1
+++ b/external/skia/share-grcontext.patch.1
@@ -253,9 +253,9 @@ diff -ur skia.org/tools/window/VulkanWindowContext.cpp 
skia/tools/window/VulkanW
 
  namespace skwindow::internal {
 
-@@ -55,36 +59,47 @@
+@@ -59,34 +55,44 @@
  }
-
+ 
  void VulkanWindowContext::initializeContext() {
 +    fShared = fGlobalShared;
 +    if( !fShared )
@@ -267,37 +267,33 @@ diff -ur skia.org/tools/window/VulkanWindowContext.cpp 
skia/tools/window/VulkanW
 +
      SkASSERT(!fContext);
      // any config code here (particularly for msaa)?
-
+ 
      PFN_vkGetInstanceProcAddr getInstanceProc = fGetInstanceProcAddr;
 -    skgpu::VulkanBackendContext backendContext;
 +    skgpu::VulkanBackendContext& backendContext = 
fGlobalShared->backendContext;
      skgpu::VulkanExtensions extensions;
-     VkPhysicalDeviceFeatures2 features;
+     sk_gpu_test::TestVkFeatures features;
      if (!sk_gpu_test::CreateVkBackendContext(getInstanceProc,
                                               &backendContext,
                                               &extensions,
 -                                             &features,
--                                             &fDebugCallback,
+-                                             &fDebugMessenger,
 -                                             &fPresentQueueIndex,
 +                                             &d->features,
-+                                             &d->fDebugCallback,
++                                             &d->fDebugMessenger,
 +                                             &d->fPresentQueueIndex,
                                               fCanPresentFn,
                                               
fDisplayParams->createProtectedNativeBackend())) {
-+        sk_gpu_test::FreeVulkanFeaturesStructs(&d->features);
 +        fGlobalShared.reset();
-         sk_gpu_test::FreeVulkanFeaturesStructs(&features);
          return;
      }
-
+ 
      if (!extensions.hasExtension(VK_KHR_SURFACE_EXTENSION_NAME, 25) ||
          !extensions.hasExtension(VK_KHR_SWAPCHAIN_EXTENSION_NAME, 68)) {
--        sk_gpu_test::FreeVulkanFeaturesStructs(&features);
-+        sk_gpu_test::FreeVulkanFeaturesStructs(&d->features);
 +        fGlobalShared.reset();
          return;
      }
-
+ 
 -    fInstance = backendContext.fInstance;
 -    fPhysicalDevice = backendContext.fPhysicalDevice;
 -    fDevice = backendContext.fDevice;
@@ -308,15 +304,13 @@ diff -ur skia.org/tools/window/VulkanWindowContext.cpp 
skia/tools/window/VulkanW
 +    d->fDevice = backendContext.fDevice;
 +    d->fGraphicsQueueIndex = backendContext.fGraphicsQueueIndex;
 +    d->fGraphicsQueue = backendContext.fQueue;
-
+ 
      PFN_vkGetPhysicalDeviceProperties localGetPhysicalDeviceProperties =
              reinterpret_cast<PFN_vkGetPhysicalDeviceProperties>(
-@@ -88,24 +103,43 @@
+@@ -104,23 +104,42 @@
                                              backendContext.fInstance,
                                              VK_NULL_HANDLE));
      if (!localGetPhysicalDeviceProperties) {
--        sk_gpu_test::FreeVulkanFeaturesStructs(&features);
-+        sk_gpu_test::FreeVulkanFeaturesStructs(&d->features);
 +        fGlobalShared.reset();
          return;
      }
@@ -336,15 +330,15 @@ diff -ur skia.org/tools/window/VulkanWindowContext.cpp 
skia/tools/window/VulkanW
                                                  backendContext.fMaxAPIVersion,
                                                  physDevVersion,
                                                  &extensions));
-
+ 
 -    GET_PROC(DestroyInstance);
--    if (fDebugCallback != VK_NULL_HANDLE) {
--        GET_PROC(DestroyDebugReportCallbackEXT);
+-    if (fDebugMessenger != VK_NULL_HANDLE) {
+-        GET_PROC(DestroyDebugUtilsMessengerEXT);
 +    d->fContext = GrDirectContexts::MakeVulkan(backendContext, 
fDisplayParams->grContextOptions());
 +
 +    GET_PROC_GLOBAL(DestroyInstance);
 +    GET_DEV_PROC_GLOBAL(DestroyDevice);
-+    if (fGlobalShared->fDebugCallback != VK_NULL_HANDLE) {
++    if (fGlobalShared->fDebugMessenger != VK_NULL_HANDLE) {
 +        GET_PROC_GLOBAL(DestroyDebugReportCallbackEXT);
      }
 +
@@ -374,10 +368,10 @@ diff -ur skia.org/tools/window/VulkanWindowContext.cpp 
skia/tools/window/VulkanW
      GET_DEV_PROC(CreateSwapchainKHR);
      GET_DEV_PROC(DestroySwapchainKHR);
      GET_DEV_PROC(GetSwapchainImagesKHR);
-@@ -121,55 +154,43 @@
+@@ -135,26 +154,21 @@
      GET_DEV_PROC(QueuePresentKHR);
      GET_DEV_PROC(GetDeviceQueue);
-
+ 
 -    backendContext.fMemoryAllocator =
 -            skgpu::VulkanAMDMemoryAllocator::Make(fInstance,
 -                                                  
backendContext.fPhysicalDevice,
@@ -392,15 +386,14 @@ diff -ur skia.org/tools/window/VulkanWindowContext.cpp 
skia/tools/window/VulkanW
 +    // No actual window, used just to create the shared GrContext.
 +    if(fCreateVkSurfaceFn == nullptr)
 +        return;
-
+ 
 -    fSurface = fCreateVkSurfaceFn(fInstance);
 +    fSurface = fCreateVkSurfaceFn(fShared->fInstance);
      if (VK_NULL_HANDLE == fSurface) {
          this->destroyContext();
--        sk_gpu_test::FreeVulkanFeaturesStructs(&features);
          return;
      }
-
+ 
 +    // create presentQueue
 +    fGetDeviceQueue(fShared->fDevice, fShared->fPresentQueueIndex, 0, 
&fPresentQueue);
 +
@@ -410,21 +403,15 @@ diff -ur skia.org/tools/window/VulkanWindowContext.cpp 
skia/tools/window/VulkanW
                                                         fSurface, &supported);
      if (VK_SUCCESS != res) {
          this->destroyContext();
--        sk_gpu_test::FreeVulkanFeaturesStructs(&features);
-         return;
-     }
-
-     if (!this->createSwapchain(-1, -1)) {
+@@ -165,21 +179,18 @@
          this->destroyContext();
--        sk_gpu_test::FreeVulkanFeaturesStructs(&features);
          return;
      }
 -
 -    // create presentQueue
 -    fGetDeviceQueue(fDevice, fPresentQueueIndex, 0, &fPresentQueue);
--    sk_gpu_test::FreeVulkanFeaturesStructs(&features);
  }
-
+ 
  bool VulkanWindowContext::createSwapchain(int width, int height) {
      // check for capabilities
      VkSurfaceCapabilitiesKHR caps;
@@ -433,7 +420,7 @@ diff -ur skia.org/tools/window/VulkanWindowContext.cpp 
skia/tools/window/VulkanW
      if (VK_SUCCESS != res) {
          return false;
      }
-
+ 
      uint32_t surfaceFormatCount;
 -    res = fGetPhysicalDeviceSurfaceFormatsKHR(fPhysicalDevice, fSurface, 
&surfaceFormatCount,
 +    res = fGetPhysicalDeviceSurfaceFormatsKHR(fShared->fPhysicalDevice, 
fSurface, &surfaceFormatCount,
@@ -554,36 +541,36 @@ diff -ur skia.org/tools/window/VulkanWindowContext.cpp 
skia/tools/window/VulkanW
                                          fBackbuffers[i].fRenderSemaphore,
                                          nullptr));
          }
-@@ -458,42 +478,59 @@
+@@ -466,42 +477,58 @@
  void VulkanWindowContext::destroyContext() {
      if (this->isValid()) {
          fQueueWaitIdle(fPresentQueue);
 -        fDeviceWaitIdle(fDevice);
 +        fDeviceWaitIdle(fShared->fDevice);
-
+ 
          this->destroyBuffers();
-
+ 
          if (VK_NULL_HANDLE != fSwapchain) {
 -            fDestroySwapchainKHR(fDevice, fSwapchain, nullptr);
 +            fDestroySwapchainKHR(fShared->fDevice, fSwapchain, nullptr);
              fSwapchain = VK_NULL_HANDLE;
          }
-
+ 
          if (VK_NULL_HANDLE != fSurface) {
 -            fDestroySurfaceKHR(fInstance, fSurface, nullptr);
 +            fDestroySurfaceKHR(fShared->fInstance, fSurface, nullptr);
              fSurface = VK_NULL_HANDLE;
          }
      }
-
+ 
 -    SkASSERT(fContext->unique());
      fContext.reset();
 -    fInterface.reset();
 +    fShared.reset();
-+
++    
 +    checkDestroyShared();
 +}
-
+ 
 -    if (VK_NULL_HANDLE != fDevice) {
 -        fDestroyDevice(fDevice, nullptr);
 -        fDevice = VK_NULL_HANDLE;
@@ -603,18 +590,18 @@ diff -ur skia.org/tools/window/VulkanWindowContext.cpp 
skia/tools/window/VulkanW
 +        fGlobalShared->fDestroyDevice(fGlobalShared->fDevice, nullptr);
 +        fGlobalShared->fDevice = VK_NULL_HANDLE;
      }
-
+ 
  #ifdef SK_ENABLE_VK_LAYERS
--    if (fDebugCallback != VK_NULL_HANDLE) {
--        fDestroyDebugReportCallbackEXT(fInstance, fDebugCallback, nullptr);
-+    if (fGlobalShared->fDebugCallback != VK_NULL_HANDLE) {
-+        
fGlobalShared->fDestroyDebugReportCallbackEXT(fGlobalShared->fInstance, 
fGlobalShared->fDebugCallback, nullptr);
+-    if (fDebugMessenger != VK_NULL_HANDLE) {
+-        fDestroyDebugUtilsMessengerEXT(fInstance, fDebugMessenger, nullptr);
++    if (fGlobalShared->fDebugMessenger != VK_NULL_HANDLE) {
++        
fGlobalShared->fDestroyDebugUtilsMessengerEXT(fGlobalShared->fInstance, 
fGlobalShared->fDebugMessenger, nullptr);
      }
  #endif
-
+ 
 -    fPhysicalDevice = VK_NULL_HANDLE;
 +    fGlobalShared->fPhysicalDevice = VK_NULL_HANDLE;
-
+ 
 -    if (VK_NULL_HANDLE != fInstance) {
 -        fDestroyInstance(fInstance, nullptr);
 -        fInstance = VK_NULL_HANDLE;
@@ -622,11 +609,10 @@ diff -ur skia.org/tools/window/VulkanWindowContext.cpp 
skia/tools/window/VulkanW
 +        fGlobalShared->fDestroyInstance(fGlobalShared->fInstance, nullptr);
 +        fGlobalShared->fInstance = VK_NULL_HANDLE;
      }
-+
-+    sk_gpu_test::FreeVulkanFeaturesStructs(&fGlobalShared->features);
++    
 +    fGlobalShared.reset();
  }
-
+ 
  VulkanWindowContext::BackbufferInfo* 
VulkanWindowContext::getAvailableBackbuffer() {
 @@ -519,35 +556,35 @@
      semaphoreInfo.pNext = nullptr;
@@ -731,29 +717,28 @@ diff -ur skia.org/tools/window/VulkanWindowContext.h 
skia/tools/window/VulkanWin
 
      struct BackbufferInfo {
          uint32_t        fImageIndex;          // image this is associated with
-@@ -60,11 +70,6 @@
+@@ -70,10 +70,6 @@
      void destroyBuffers();
      void onSwapBuffers() override;
-
+ 
 -    VkInstance fInstance = VK_NULL_HANDLE;
 -    VkPhysicalDevice fPhysicalDevice = VK_NULL_HANDLE;
 -    VkDevice fDevice = VK_NULL_HANDLE;
--    VkDebugReportCallbackEXT fDebugCallback = VK_NULL_HANDLE;
--
+-    VkDebugUtilsMessengerEXT fDebugMessenger = VK_NULL_HANDLE;
+ 
      // Create functions
      CreateVkSurfaceFn fCreateVkSurfaceFn;
-     CanPresentFn      fCanPresentFn;
-@@ -84,20 +89,46 @@
+@@ -94,20 +90,46 @@
      PFN_vkAcquireNextImageKHR fAcquireNextImageKHR = nullptr;
      PFN_vkQueuePresentKHR fQueuePresentKHR = nullptr;
-
+ 
 -    PFN_vkDestroyInstance fDestroyInstance = nullptr;
      PFN_vkDeviceWaitIdle fDeviceWaitIdle = nullptr;
--    PFN_vkDestroyDebugReportCallbackEXT fDestroyDebugReportCallbackEXT = 
nullptr;
+-    PFN_vkDestroyDebugUtilsMessengerEXT fDestroyDebugUtilsMessengerEXT = 
nullptr;
      PFN_vkQueueWaitIdle fQueueWaitIdle = nullptr;
 -    PFN_vkDestroyDevice fDestroyDevice = nullptr;
      PFN_vkGetDeviceQueue fGetDeviceQueue = nullptr;
-
++    
 +    // We need to use just one GrDirectContext, so share all the relevant 
data.
 +    struct Shared : public SkRefCnt
 +    {
@@ -764,21 +749,21 @@ diff -ur skia.org/tools/window/VulkanWindowContext.h 
skia/tools/window/VulkanWin
 +    VkInstance fInstance = VK_NULL_HANDLE;
 +    VkPhysicalDevice fPhysicalDevice = VK_NULL_HANDLE;
 +    VkDevice fDevice = VK_NULL_HANDLE;
-+    VkDebugReportCallbackEXT fDebugCallback = VK_NULL_HANDLE;
-+
++    VkDebugUtilsMessengerEXT fDebugMessenger = VK_NULL_HANDLE;
+ 
      sk_sp<const skgpu::VulkanInterface> fInterface;
-
--    VkSurfaceKHR      fSurface;
--    VkSwapchainKHR    fSwapchain;
++    
 +    // Original code had this as a function-local variable, but that seems 
wrong.
 +    // It should exist as long as the context exists.
-+    VkPhysicalDeviceFeatures2 features;
++    sk_gpu_test::TestVkFeatures features;
 +
 +    // Store this to make it accessible.
 +    VkPhysicalDeviceProperties physDeviceProperties;
 +
 +    skgpu::VulkanBackendContext backendContext;
-+
+ 
+-    VkSurfaceKHR      fSurface;
+-    VkSwapchainKHR    fSwapchain;
      uint32_t          fGraphicsQueueIndex;
      VkQueue           fGraphicsQueue;
      uint32_t          fPresentQueueIndex;
@@ -793,7 +778,7 @@ diff -ur skia.org/tools/window/VulkanWindowContext.h 
skia/tools/window/VulkanWin
 +    VkSurfaceKHR      fSurface;
 +    VkSwapchainKHR    fSwapchain;
      VkQueue           fPresentQueue;
-
+ 
      uint32_t               fImageCount;
 diff -ur skia.org/tools/window/win/VulkanWindowContext_win.cpp 
skia/tools/window/win/VulkanWindowContext_win.cpp
 --- skia.org/tools/window/win/VulkanWindowContext_win.cpp      2024-10-10 
14:11:32.362258108 +0200
diff --git a/external/skia/swap-buffers-rect.patch.1 
b/external/skia/swap-buffers-rect.patch.1
index 292adc70836b..9cfde0955d37 100644
--- a/external/skia/swap-buffers-rect.patch.1
+++ b/external/skia/swap-buffers-rect.patch.1
@@ -69,16 +69,15 @@ diff -ur skia.org/tools/window/VulkanWindowContext.cpp 
skia/tools/window/VulkanW
 diff -ur skia.org/tools/window/VulkanWindowContext.h 
skia/tools/window/VulkanWindowContext.h
 --- skia.org/tools/window/VulkanWindowContext.h        2024-10-05 
18:16:04.521814026 +0200
 +++ skia/tools/window/VulkanWindowContext.h    2024-10-05 18:19:54.713202674 
+0200
-@@ -70,7 +70,7 @@
+@@ -68,7 +68,7 @@
      bool createSwapchain(int width, int height);
      bool createBuffers(VkFormat format, VkImageUsageFlags, SkColorType 
colorType, VkSharingMode);
      void destroyBuffers();
 -    void onSwapBuffers() override;
 +    void onSwapBuffers(const SkIRect* rect = nullptr) override;
-
+ 
+ 
      // Create functions
-     CreateVkSurfaceFn fCreateVkSurfaceFn;
-     CanPresentFn      fCanPresentFn;
 diff -ur skia.org/tools/window/win/RasterWindowContext_win.cpp 
skia/tools/window/win/RasterWindowContext_win.cpp
 --- skia.org/tools/window/win/RasterWindowContext_win.cpp      2024-10-05 
18:16:04.521814026 +0200
 +++ skia/tools/window/win/RasterWindowContext_win.cpp  2024-10-05 
18:20:58.138561375 +0200
diff --git a/vcl/skia/gdiimpl.cxx b/vcl/skia/gdiimpl.cxx
index 10368a347d64..f02077af9a23 100644
--- a/vcl/skia/gdiimpl.cxx
+++ b/vcl/skia/gdiimpl.cxx
@@ -1185,7 +1185,7 @@ bool SkiaSalGraphicsImpl::drawPolyLine(const 
basegfx::B2DHomMatrix& rObjectToDev
         // Transform size by the matrix.
         for (double stroke : *pStroke)
             intervals.push_back((rObjectToDevice * basegfx::B2DVector(stroke, 
0)).getLength());
-        aPaint.setPathEffect(SkDashPathEffect::Make(intervals.data(), 
intervals.size(), 0));
+        aPaint.setPathEffect(SkDashPathEffect::Make(intervals, 0));
     }
 
     // Skia does not support basegfx::B2DLineJoin::NONE, so in that case batch 
only if lines
@@ -1535,7 +1535,7 @@ void SkiaSalGraphicsImpl::invert(basegfx::B2DPolygon 
const& rPoly, SalInvert eFl
             aPaint.setStrokeWidth(2);
             static constexpr float intervals[] = { 4.0f, 4.0f };
             aPaint.setStyle(SkPaint::kStroke_Style);
-            aPaint.setPathEffect(SkDashPathEffect::Make(intervals, 
std::size(intervals), 0));
+            aPaint.setPathEffect(SkDashPathEffect::Make(intervals, 0));
         }
         else
         {
@@ -1923,12 +1923,12 @@ void SkiaSalGraphicsImpl::drawShader(const SalTwoRect& 
rPosAry, const sk_sp<SkSh
             return rtl::math::round(p1.x(), 2) == p2.x() && 
rtl::math::round(p1.y(), 2) == p2.y();
         };
 #endif
-        assert(compareRounded(matrix.mapXY(rPosAry.mnSrcX, rPosAry.mnSrcY),
+        assert(compareRounded(matrix.mapPoint(SkPoint::Make(rPosAry.mnSrcX, 
rPosAry.mnSrcY)),
                               SkPoint::Make(rPosAry.mnDestX, 
rPosAry.mnDestY)));
-        assert(compareRounded(
-            matrix.mapXY(rPosAry.mnSrcX + rPosAry.mnSrcWidth, rPosAry.mnSrcY + 
rPosAry.mnSrcHeight),
-            SkPoint::Make(rPosAry.mnDestX + rPosAry.mnDestWidth,
-                          rPosAry.mnDestY + rPosAry.mnDestHeight)));
+        assert(compareRounded(matrix.mapPoint(SkPoint::Make(rPosAry.mnSrcX + 
rPosAry.mnSrcWidth,
+                                                            rPosAry.mnSrcY + 
rPosAry.mnSrcHeight)),
+                              SkPoint::Make(rPosAry.mnDestX + 
rPosAry.mnDestWidth,
+                                            rPosAry.mnDestY + 
rPosAry.mnDestHeight)));
         canvas->concat(matrix);
         SkRect sourceRect = SkRect::MakeXYWH(rPosAry.mnSrcX, rPosAry.mnSrcY, 
rPosAry.mnSrcWidth,
                                              rPosAry.mnSrcHeight);
@@ -2266,7 +2266,7 @@ void SkiaSalGraphicsImpl::drawGenericLayout(const 
GenericSalLayout& layout, Colo
         size_t index = pos - verticals.cbegin();
         size_t count = rangeEnd - pos;
         sk_sp<SkTextBlob> textBlob = SkTextBlob::MakeFromRSXform(
-            glyphIds.data() + index, count * sizeof(SkGlyphID), 
glyphForms.data() + index,
+            glyphIds.data() + index, count * sizeof(SkGlyphID), glyphForms,
             verticalRun ? verticalFont : font, SkTextEncoding::kGlyphID);
         addUpdateRegion(textBlob->bounds());
         SkPaint paint = makeTextPaint(textColor);

Reply via email to