vcl/skia/SkiaHelper.cxx |   15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

New commits:
commit 6c58b01c791ec4939523147d5d075611bbbfe314
Author:     Luboš Luňák <l.lu...@collabora.com>
AuthorDate: Wed Jul 13 12:54:20 2022 +0200
Commit:     Luboš Luňák <l.lu...@collabora.com>
CommitDate: Wed Jul 13 16:23:26 2022 +0200

    move Skia setup code to a shared function
    
    Change-Id: Ifcd434512854b5fedb0baf4ce1251a05f659b006
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137017
    Tested-by: Jenkins
    Reviewed-by: Luboš Luňák <l.lu...@collabora.com>

diff --git a/vcl/skia/SkiaHelper.cxx b/vcl/skia/SkiaHelper.cxx
index 84c40baffae4..f4346b74f73a 100644
--- a/vcl/skia/SkiaHelper.cxx
+++ b/vcl/skia/SkiaHelper.cxx
@@ -273,6 +273,8 @@ static bool supportsVCLSkia()
     return getenv("SAL_DISABLESKIA") == nullptr;
 }
 
+static void initInternal();
+
 bool isVCLSkiaEnabled()
 {
     /**
@@ -308,8 +310,7 @@ bool isVCLSkiaEnabled()
     if (bForceSkia && bSupportsVCLSkia)
     {
         bRet = true;
-        SkGraphics::Init();
-        SkLoOpts::Init();
+        initInternal();
         // don't actually block if denylisted, but log it if enabled, and also 
get the vendor id
         checkDeviceDenylisted(true);
     }
@@ -334,8 +335,7 @@ bool isVCLSkiaEnabled()
 
         if (bEnable)
         {
-            SkGraphics::Init();
-            SkLoOpts::Init();
+            initInternal();
             checkDeviceDenylisted(); // switch to raster if driver is 
denylisted
         }
 
@@ -754,6 +754,13 @@ void setBlenderXor(SkPaint* paint)
     paint->setBlender(xorBlender);
 }
 
+static void initInternal()
+{
+    // Set up all things needed for using Skia.
+    SkGraphics::Init();
+    SkLoOpts::Init();
+}
+
 void cleanup()
 {
     sharedWindowContext.reset();

Reply via email to