[Libreoffice-commits] core.git: Branch 'feature/skia' - vcl/Library_vcl.mk vcl/Library_vclplug_gen.mk vcl/Library_vclplug_win.mk vcl/skia vcl/unx vcl/win

Luboš Luňák (via logerrit) logerrit at kemper.freedesktop.org
Mon Oct 14 11:55:37 UTC 2019


 vcl/Library_vcl.mk             |    7 ++++---
 vcl/Library_vclplug_gen.mk     |   17 +++++++++--------
 vcl/Library_vclplug_win.mk     |    5 +++--
 vcl/skia/SkiaHelper.cxx        |    9 +++++++++
 vcl/unx/generic/gdi/salbmp.cxx |   11 +++++++++--
 vcl/unx/generic/gdi/salgdi.cxx |   13 ++++++++++---
 vcl/unx/generic/gdi/salvd.cxx  |   11 +++++++++--
 vcl/win/app/salinst.cxx        |   13 ++++++++++---
 vcl/win/gdi/salgdi.cxx         |   11 +++++++++--
 vcl/win/gdi/salgdi2.cxx        |    8 ++++++++
 10 files changed, 80 insertions(+), 25 deletions(-)

New commits:
commit ee5dac3fa00c48eed481ceb701e3d6728bc1a5fa
Author:     Luboš Luňák <l.lunak at collabora.com>
AuthorDate: Mon Oct 14 12:54:13 2019 +0200
Commit:     Luboš Luňák <l.lunak at collabora.com>
CommitDate: Mon Oct 14 13:54:31 2019 +0200

    build properly with or without Skia enabled
    
    Change-Id: I5106f13682963b81753f79c3203d4ef7387664fe

diff --git a/vcl/Library_vcl.mk b/vcl/Library_vcl.mk
index a5486cd56c83..c33c4e90db43 100644
--- a/vcl/Library_vcl.mk
+++ b/vcl/Library_vcl.mk
@@ -106,7 +106,7 @@ $(eval $(call gb_Library_use_externals,vcl,\
     icuuc \
     lcms2 \
     mdds_headers \
-    skia \
+    $(if $(filter SKIA,$(BUILD_TYPE)),skia) \
 ))
 
 ifeq ($(DISABLE_GUI),)
@@ -577,8 +577,9 @@ $(eval $(call gb_Library_add_exception_objects,vcl,\
     vcl/source/opengl/OpenGLContext \
     vcl/source/opengl/OpenGLHelper \
     vcl/skia/SkiaHelper \
-    vcl/skia/salbmp \
-    vcl/skia/gdiimpl \
+    $(if $(filter SKIA,$(BUILD_TYPE)), \
+        vcl/skia/salbmp \
+        vcl/skia/gdiimpl) \
  ))
 
 # runtime dependency
diff --git a/vcl/Library_vclplug_gen.mk b/vcl/Library_vclplug_gen.mk
index 0b941bf326ef..9088d3a01a6a 100644
--- a/vcl/Library_vclplug_gen.mk
+++ b/vcl/Library_vclplug_gen.mk
@@ -58,7 +58,7 @@ $(eval $(call gb_Library_use_externals,vclplug_gen,\
 	icuuc \
 	valgrind \
 	Xrender \
-	skia \
+	$(if $(filter SKIA,$(BUILD_TYPE)),skia) \
 ))
 
 $(eval $(call gb_Library_add_libs,vclplug_gen,\
@@ -92,7 +92,7 @@ $(eval $(call gb_Library_add_exception_objects,vclplug_gen,\
     vcl/unx/generic/dtrans/X11_transferable \
     vcl/unx/generic/gdi/cairo_xlib_cairo \
     vcl/unx/generic/gdi/x11cairotextrender \
-	vcl/unx/generic/gdi/gdiimpl \
+    vcl/unx/generic/gdi/gdiimpl \
     vcl/unx/generic/gdi/salbmp \
     vcl/unx/generic/gdi/salgdi2 \
     vcl/unx/generic/gdi/font \
@@ -103,12 +103,13 @@ $(eval $(call gb_Library_add_exception_objects,vclplug_gen,\
     vcl/unx/generic/window/salobj \
     vcl/unx/x11/x11sys \
     vcl/unx/x11/xlimits \
-	vcl/opengl/x11/cairotextrender \
-	vcl/opengl/x11/gdiimpl \
-	vcl/opengl/x11/salvd \
-	vcl/skia/x11/cairotextrender \
-	vcl/skia/x11/gdiimpl \
-	vcl/skia/x11/salvd \
+    vcl/opengl/x11/cairotextrender \
+    vcl/opengl/x11/gdiimpl \
+    vcl/opengl/x11/salvd \
+    $(if $(filter SKIA,$(BUILD_TYPE)), \
+        vcl/skia/x11/cairotextrender \
+        vcl/skia/x11/gdiimpl \
+        vcl/skia/x11/salvd) \
 ))
 
 # ultimately we want to split the x11 dependencies out
diff --git a/vcl/Library_vclplug_win.mk b/vcl/Library_vclplug_win.mk
index a2979674d00a..19b7a2d6f87f 100644
--- a/vcl/Library_vclplug_win.mk
+++ b/vcl/Library_vclplug_win.mk
@@ -55,12 +55,11 @@ $(eval $(call gb_Library_use_externals,vclplug_win,\
     epoxy \
     glm_headers \
     harfbuzz \
-    skia \
+    $(if $(filter SKIA,$(BUILD_TYPE)),skia) \
 ))
 
 $(eval $(call gb_Library_add_exception_objects,vclplug_win,\
     vcl/opengl/win/gdiimpl \
-    vcl/skia/win/gdiimpl \
     vcl/win/app/saldata \
     vcl/win/app/salinfo \
     vcl/win/app/salinst \
@@ -81,6 +80,8 @@ $(eval $(call gb_Library_add_exception_objects,vclplug_win,\
     vcl/win/window/keynames \
     vcl/win/window/salmenu \
     vcl/win/window/salobj \
+    $(if $(filter SKIA,$(BUILD_TYPE)), \
+        vcl/skia/win/gdiimpl) \
 ))
 
 $(eval $(call gb_Library_use_system_win32_libs,vclplug_win,\
diff --git a/vcl/skia/SkiaHelper.cxx b/vcl/skia/SkiaHelper.cxx
index 37a34522295e..84291a3d1899 100644
--- a/vcl/skia/SkiaHelper.cxx
+++ b/vcl/skia/SkiaHelper.cxx
@@ -11,6 +11,13 @@
 
 #include <vcl/svapp.hxx>
 
+#include <config_features.h>
+
+#if !HAVE_FEATURE_SKIA
+bool SkiaHelper::isVCLSkiaEnabled() { return false; }
+
+#else
+
 bool SkiaHelper::isVCLSkiaEnabled()
 {
     /**
@@ -70,4 +77,6 @@ bool SkiaHelper::isVCLSkiaEnabled()
     return bRet;
 }
 
+#endif // HAVE_FEATURE_SKIA
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/unx/generic/gdi/salbmp.cxx b/vcl/unx/generic/gdi/salbmp.cxx
index 9891447935e7..b34b1a80e0e0 100644
--- a/vcl/unx/generic/gdi/salbmp.cxx
+++ b/vcl/unx/generic/gdi/salbmp.cxx
@@ -42,8 +42,12 @@
 #include <o3tl/safeint.hxx>
 #include <opengl/salbmp.hxx>
 #include <vcl/opengl/OpenGLHelper.hxx>
-#include <skia/salbmp.hxx>
+
+#include <config_features.h>
+#if HAVE_FEATURE_SKIA
 #include <vcl/skia/SkiaHelper.hxx>
+#include <skia/salbmp.hxx>
+#endif
 
 #if defined HAVE_VALGRIND_HEADERS
 #include <valgrind/valgrind.h>
@@ -54,9 +58,12 @@
 
 std::shared_ptr<SalBitmap> X11SalInstance::CreateSalBitmap()
 {
+#if HAVE_FEATURE_SKIA
     if (SkiaHelper::isVCLSkiaEnabled())
         return std::make_shared<SkiaSalBitmap>();
-    else if (OpenGLHelper::isVCLOpenGLEnabled())
+    else
+#endif
+    if (OpenGLHelper::isVCLOpenGLEnabled())
         return std::make_shared<OpenGLSalBitmap>();
     else
         return std::make_shared<X11SalBitmap>();
diff --git a/vcl/unx/generic/gdi/salgdi.cxx b/vcl/unx/generic/gdi/salgdi.cxx
index 8ce8680c1556..e2b1fc54c0b2 100644
--- a/vcl/unx/generic/gdi/salgdi.cxx
+++ b/vcl/unx/generic/gdi/salgdi.cxx
@@ -45,17 +45,21 @@
 #include <salvd.hxx>
 #include "gdiimpl.hxx"
 #include <opengl/x11/gdiimpl.hxx>
-#include <skia/x11/gdiimpl.hxx>
 #include <unx/x11/x11cairotextrender.hxx>
 #include <opengl/x11/cairotextrender.hxx>
-#include <skia/x11/cairotextrender.hxx>
 
 #include <unx/x11/xrender_peer.hxx>
 #include "cairo_xlib_cairo.hxx"
 #include <cairo-xlib.h>
 
 #include <vcl/opengl/OpenGLHelper.hxx>
+
+#include <config_features.h>
 #include <vcl/skia/SkiaHelper.hxx>
+#if HAVE_FEATURE_SKIA
+#include <skia/x11/gdiimpl.hxx>
+#include <skia/x11/cairotextrender.hxx>
+#endif
 
 X11SalGraphics::X11SalGraphics():
     m_pFrame(nullptr),
@@ -80,12 +84,15 @@ X11SalGraphics::X11SalGraphics():
     m_bOpenGL(OpenGLHelper::isVCLOpenGLEnabled()),
     m_bSkia(SkiaHelper::isVCLSkiaEnabled())
 {
+#if HAVE_FEATURE_SKIA
     if (m_bSkia)
     {
         mxImpl.reset(new X11SkiaSalGraphicsImpl(*this));
         mxTextRenderImpl.reset(new SkiaX11CairoTextRender(*this));
     }
-    else if (m_bOpenGL)
+    else
+#endif
+    if (m_bOpenGL)
     {
         mxImpl.reset(new X11OpenGLSalGraphicsImpl(*this));
         mxTextRenderImpl.reset(new OpenGLX11CairoTextRender(*this));
diff --git a/vcl/unx/generic/gdi/salvd.cxx b/vcl/unx/generic/gdi/salvd.cxx
index 780fdde4453a..74de1baded79 100644
--- a/vcl/unx/generic/gdi/salvd.cxx
+++ b/vcl/unx/generic/gdi/salvd.cxx
@@ -29,18 +29,25 @@
 #include <unx/x11/xlimits.hxx>
 
 #include <vcl/opengl/OpenGLHelper.hxx>
-#include <vcl/skia/SkiaHelper.hxx>
 #include <opengl/x11/salvd.hxx>
+
+#include <config_features.h>
+#include <vcl/skia/SkiaHelper.hxx>
+#if HAVE_FEATURE_SKIA
 #include <skia/x11/salvd.hxx>
+#endif
 
 std::unique_ptr<SalVirtualDevice> X11SalInstance::CreateX11VirtualDevice(SalGraphics const * pGraphics,
         long &nDX, long &nDY, DeviceFormat eFormat, const SystemGraphicsData *pData,
         std::unique_ptr<X11SalGraphics> pNewGraphics)
 {
     assert(pNewGraphics);
+#if HAVE_FEATURE_SKIA
     if (SkiaHelper::isVCLSkiaEnabled())
         return std::unique_ptr<SalVirtualDevice>(new X11SkiaSalVirtualDevice( pGraphics, nDX, nDY, pData, std::move(pNewGraphics) ));
-    else if (OpenGLHelper::isVCLOpenGLEnabled())
+    else
+#endif
+    if (OpenGLHelper::isVCLOpenGLEnabled())
         return std::unique_ptr<SalVirtualDevice>(new X11OpenGLSalVirtualDevice( pGraphics, nDX, nDY, pData, std::move(pNewGraphics) ));
     else
         return std::unique_ptr<SalVirtualDevice>(new X11SalVirtualDevice(pGraphics, nDX, nDY, eFormat, pData, std::move(pNewGraphics)));
diff --git a/vcl/win/app/salinst.cxx b/vcl/win/app/salinst.cxx
index 09e96e49abe2..f904be4c6eb7 100644
--- a/vcl/win/app/salinst.cxx
+++ b/vcl/win/app/salinst.cxx
@@ -32,13 +32,11 @@
 #include <vcl/inputtypes.hxx>
 #include <vcl/opengl/OpenGLHelper.hxx>
 #include <vcl/opengl/OpenGLContext.hxx>
-#include <vcl/skia/SkiaHelper.hxx>
 #include <vcl/timer.hxx>
 #include <vclpluginapi.h>
 
 #include <opengl/salbmp.hxx>
 #include <opengl/win/gdiimpl.hxx>
-#include <skia/salbmp.hxx>
 #include <win/wincomp.hxx>
 #include <win/salids.hrc>
 #include <win/saldata.hxx>
@@ -49,6 +47,12 @@
 #include <win/salbmp.h>
 #include <win/winlayout.hxx>
 
+#include <config_features.h>
+#include <vcl/skia/SkiaHelper.hxx>
+#if HAVE_FEATURE_SKIA
+#include <skia/salbmp.hxx>
+#endif
+
 #include <salsys.hxx>
 
 #include <desktop/crashreport.hxx>
@@ -968,9 +972,12 @@ SalTimer* WinSalInstance::CreateSalTimer()
 
 std::shared_ptr<SalBitmap> WinSalInstance::CreateSalBitmap()
 {
+#if HAVE_FEATURE_SKIA
     if (SkiaHelper::isVCLSkiaEnabled())
         return std::make_shared<SkiaSalBitmap>();
-    else if (OpenGLHelper::isVCLOpenGLEnabled())
+    else
+#endif
+    if (OpenGLHelper::isVCLOpenGLEnabled())
         return std::make_shared<OpenGLSalBitmap>();
     else
         return std::make_shared<WinSalBitmap>();
diff --git a/vcl/win/gdi/salgdi.cxx b/vcl/win/gdi/salgdi.cxx
index 19553f415eee..a20c7b27b59e 100644
--- a/vcl/win/gdi/salgdi.cxx
+++ b/vcl/win/gdi/salgdi.cxx
@@ -35,10 +35,14 @@
 #include <salgdiimpl.hxx>
 #include "gdiimpl.hxx"
 #include <opengl/win/gdiimpl.hxx>
-#include <skia/win/gdiimpl.hxx>
 
 #include <vcl/opengl/OpenGLHelper.hxx>
+
+#include <config_features.h>
 #include <vcl/skia/SkiaHelper.hxx>
+#if HAVE_FEATURE_SKIA
+#include <skia/win/gdiimpl.hxx>
+#endif
 
 
 #define DITHER_PAL_DELTA                51
@@ -621,9 +625,12 @@ WinSalGraphics::WinSalGraphics(WinSalGraphics::Type eType, bool bScreen, HWND hW
     mpStdClipRgnData(nullptr),
     mnPenWidth(GSL_PEN_WIDTH)
 {
+#if HAVE_FEATURE_SKIA
     if (SkiaHelper::isVCLSkiaEnabled() && !mbPrinter)
         mpImpl.reset(new WinSkiaSalGraphicsImpl(*this, pProvider));
-    else if (OpenGLHelper::isVCLOpenGLEnabled() && !mbPrinter)
+    else
+#endif
+    if (OpenGLHelper::isVCLOpenGLEnabled() && !mbPrinter)
         mpImpl.reset(new WinOpenGLSalGraphicsImpl(*this, pProvider));
     else
         mpImpl.reset(new WinSalGraphicsImpl(*this));
diff --git a/vcl/win/gdi/salgdi2.cxx b/vcl/win/gdi/salgdi2.cxx
index 795cc4d08284..5c086cbdc14c 100644
--- a/vcl/win/gdi/salgdi2.cxx
+++ b/vcl/win/gdi/salgdi2.cxx
@@ -39,7 +39,11 @@
 #include <outdata.hxx>
 #include <salgdiimpl.hxx>
 #include <opengl/win/gdiimpl.hxx>
+
+#include <config_features.h>
+#if HAVE_FEATURE_SKIA
 #include <skia/win/gdiimpl.hxx>
+#endif
 
 
 bool WinSalGraphics::supportsOperation( OutDevSupportType eType ) const
@@ -169,7 +173,9 @@ void convertToWinSalBitmap(SalBitmap& rSalBitmap, WinSalBitmap& rWinSalBitmap)
 void WinSalGraphics::drawBitmap(const SalTwoRect& rPosAry, const SalBitmap& rSalBitmap)
 {
     if (dynamic_cast<WinOpenGLSalGraphicsImpl*>(mpImpl.get()) == nullptr &&
+#if HAVE_FEATURE_SKIA
         dynamic_cast<WinSkiaSalGraphicsImpl*>(mpImpl.get()) == nullptr &&
+#endif
         dynamic_cast<const WinSalBitmap*>(&rSalBitmap) == nullptr)
     {
         std::unique_ptr<WinSalBitmap> pWinSalBitmap(new WinSalBitmap());
@@ -188,7 +194,9 @@ void WinSalGraphics::drawBitmap( const SalTwoRect& rPosAry,
                               const SalBitmap& rSTransparentBitmap )
 {
     if (dynamic_cast<WinOpenGLSalGraphicsImpl*>(mpImpl.get()) == nullptr &&
+#if HAVE_FEATURE_SKIA
         dynamic_cast<WinSkiaSalGraphicsImpl*>(mpImpl.get()) == nullptr &&
+#endif
         dynamic_cast<const WinSalBitmap*>(&rSSalBitmap) == nullptr)
     {
         std::unique_ptr<WinSalBitmap> pWinSalBitmap(new WinSalBitmap());


More information about the Libreoffice-commits mailing list