diff options
author | Luboš Luňák <l.lunak@collabora.com> | 2019-10-14 12:54:13 +0200 |
---|---|---|
committer | Luboš Luňák <l.lunak@collabora.com> | 2019-11-27 09:55:08 +0100 |
commit | 5c4f872a77b9b0cd5f061c06c5b771c1aeff4c59 (patch) | |
tree | 5423bbe184c1978393d1944237f4c7b4a2583f5d /vcl | |
parent | 8f5c2a559ac4190db36a1fa85ba965f3cceab5ed (diff) |
build properly with or without Skia enabled
Change-Id: I5106f13682963b81753f79c3203d4ef7387664fe
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/Library_vcl.mk | 7 | ||||
-rw-r--r-- | vcl/Library_vclplug_gen.mk | 17 | ||||
-rw-r--r-- | vcl/Library_vclplug_win.mk | 5 | ||||
-rw-r--r-- | vcl/skia/SkiaHelper.cxx | 9 | ||||
-rw-r--r-- | vcl/unx/generic/gdi/salbmp.cxx | 11 | ||||
-rw-r--r-- | vcl/unx/generic/gdi/salgdi.cxx | 13 | ||||
-rw-r--r-- | vcl/unx/generic/gdi/salvd.cxx | 11 | ||||
-rw-r--r-- | vcl/win/app/salinst.cxx | 13 | ||||
-rw-r--r-- | vcl/win/gdi/salgdi.cxx | 11 | ||||
-rw-r--r-- | vcl/win/gdi/salgdi2.cxx | 8 |
10 files changed, 80 insertions, 25 deletions
diff --git a/vcl/Library_vcl.mk b/vcl/Library_vcl.mk index 325db8b088bf..c054a2767a3c 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),) @@ -584,8 +584,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 a4dd1ae75373..500783ed67e1 100644 --- a/vcl/Library_vclplug_gen.mk +++ b/vcl/Library_vclplug_gen.mk @@ -60,7 +60,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,\ @@ -94,7 +94,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 \ @@ -105,12 +105,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 a062ebcafabd..1b73c2458629 100644 --- a/vcl/Library_vclplug_win.mk +++ b/vcl/Library_vclplug_win.mk @@ -57,12 +57,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 \ @@ -83,6 +82,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 1d2cf20d9c0b..787946ecfb20 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() { /** @@ -69,4 +76,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 4f7be8f147b6..83c09d6a5ec2 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), @@ -78,12 +82,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 20c6d3c8a9f7..b490b34917b7 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> @@ -967,9 +971,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 8503af1c04ad..6da451de36aa 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()); |