configure.ac | 2 +- cui/source/options/optgdlg.cxx | 8 ++++---- vcl/inc/win/saldata.hxx | 4 ---- vcl/skia/SkiaHelper.cxx | 8 ++++---- vcl/win/app/salinst.cxx | 14 ++------------ vcl/win/gdi/salfont.cxx | 9 ++------- vcl/win/gdi/salgdi.cxx | 7 ++----- vcl/win/gdi/salgdi2.cxx | 8 -------- vcl/win/gdi/salnativewidgets-luna.cxx | 13 ++----------- 9 files changed, 17 insertions(+), 56 deletions(-)
New commits: commit 07f480b7c85ccd7492428d5da96d68602c516eb8 Author: Noel Grandin <[email protected]> AuthorDate: Mon Jun 30 11:32:17 2025 +0200 Commit: Noel Grandin <[email protected]> CommitDate: Thu Jul 3 08:40:36 2025 +0200 make skia mandatory on MS-Windows, disable GDI backend This is necessary, since the GDI backend does not work with my upcoming "merged color and alpha" patch Change-Id: I1740730a7c6ee7bddbeca053a3ccac5d58b11f72 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/187176 Tested-by: Jenkins Reviewed-by: Noel Grandin <[email protected]> diff --git a/configure.ac b/configure.ac index 935731405f23..c59fcb215ae7 100644 --- a/configure.ac +++ b/configure.ac @@ -3458,7 +3458,7 @@ if test "$enable_dynamic_loading" = yes; then BUILD_TYPE="$BUILD_TYPE DYNLOADING" else DISABLE_DYNLOADING='TRUE' - if test $_os != iOS -a $_os != Darwin -a $_os != Android; then + if test $_os != iOS -a $_os != Darwin -a $_os != Android -a $_os != WINNT; then enable_database_connectivity=no enable_nss=no enable_odk=no diff --git a/cui/source/options/optgdlg.cxx b/cui/source/options/optgdlg.cxx index 01eac2d2cd46..ad3accd5f1f3 100644 --- a/cui/source/options/optgdlg.cxx +++ b/cui/source/options/optgdlg.cxx @@ -629,8 +629,8 @@ void OfaViewTabPage::UpdateSkiaStatus() m_xSkiaStatusEnabled->set_visible(bEnabled); m_xSkiaStatusDisabled->set_visible(!bEnabled); -#ifdef MACOSX - m_xUseSkia->set_sensitive(false); // macOS can __only__ render via skia +#if defined(MACOSX) || defined(_WIN32) + m_xUseSkia->set_sensitive(false); // macOS/win can __only__ render via skia #else m_xUseSkia->set_sensitive(!officecfg::Office::Common::VCL::UseSkia::isReadOnly()); #endif @@ -824,8 +824,8 @@ void OfaViewTabPage::Reset( const SfxItemSet* ) m_xUseAntiAliase->save_state(); } -#ifdef MACOSX - m_xUseSkia->set_active(true); // macOS can __only__ render via skia +#if defined(MACOSX) || defined(_WIN32) + m_xUseSkia->set_active(true); // macOS/win can __only__ render via skia #else m_xUseSkia->set_active(officecfg::Office::Common::VCL::UseSkia::get()); #endif diff --git a/vcl/inc/win/saldata.hxx b/vcl/inc/win/saldata.hxx index 6a00566cca31..46b94ec22dd5 100644 --- a/vcl/inc/win/saldata.hxx +++ b/vcl/inc/win/saldata.hxx @@ -46,9 +46,7 @@ namespace vcl { class Font; } struct HDCCache; struct TempFontItem; class TextOutRenderer; -#if HAVE_FEATURE_SKIA class SkiaControlsCache; -#endif #define MAX_STOCKPEN 4 #define MAX_STOCKBRUSH 4 @@ -132,9 +130,7 @@ public: std::unique_ptr<TextOutRenderer> m_pD2DWriteTextOutRenderer; // tdf#107205 need 2 instances because D2DWrite can't rotate text std::unique_ptr<TextOutRenderer> m_pExTextOutRenderer; -#if HAVE_FEATURE_SKIA std::unique_ptr<SkiaControlsCache> m_pSkiaControlsCache; -#endif }; struct SalShlData diff --git a/vcl/skia/SkiaHelper.cxx b/vcl/skia/SkiaHelper.cxx index 7dcd5c41bc5a..98b44c722f27 100644 --- a/vcl/skia/SkiaHelper.cxx +++ b/vcl/skia/SkiaHelper.cxx @@ -425,10 +425,10 @@ static bool initVCLSkiaEnabled() */ bool bSalDisableSkia = getenv("SAL_DISABLESKIA") != nullptr; -#ifdef MACOSX +#if defined(MACOSX) || defined(_WIN32) if (bSalDisableSkia) { - SAL_WARN("vcl", "macOS requires Skia, so ignoring SAL_DISABLESKIA"); + SAL_WARN("vcl", "macOS/win requires Skia, so ignoring SAL_DISABLESKIA"); bSalDisableSkia = false; } #endif @@ -443,8 +443,8 @@ static bool initVCLSkiaEnabled() // If not forced, don't enable in safe mode if (!bRet && !Application::IsSafeModeEnabled()) { -#ifdef MACOSX - bRet = true; // macOS can __only__ render via skia +#if defined(MACOSX) || defined(_WIN32) + bRet = true; // macOS/win can __only__ render via skia #else bRet = getenv("SAL_ENABLESKIA") != nullptr || officecfg::Office::Common::VCL::UseSkia::get(); diff --git a/vcl/win/app/salinst.cxx b/vcl/win/app/salinst.cxx index 10607e82daa7..53e60b25c2b0 100644 --- a/vcl/win/app/salinst.cxx +++ b/vcl/win/app/salinst.cxx @@ -54,11 +54,9 @@ #include <config_features.h> #include <vcl/skia/SkiaHelper.hxx> -#if HAVE_FEATURE_SKIA #include <config_skia.h> #include <skia/salbmp.hxx> #include <skia/win/gdiimpl.hxx> -#endif #include <salsys.hxx> @@ -407,22 +405,18 @@ WinSalInstance::WinSalInstance() ImplSVData* pSVData = ImplGetSVData(); pSVData->maAppData.mxToolkitName = OUString("win"); m_bSupportsOpenGL = true; -#if HAVE_FEATURE_SKIA WinSkiaSalGraphicsImpl::prepareSkia(); #if SKIA_USE_BITMAP32 if (SkiaHelper::isVCLSkiaEnabled()) m_bSupportsBitmap32 = true; #endif -#endif } WinSalInstance::~WinSalInstance() { ImplFreeSalGDI(); DestroyWindow( mhComWnd ); -#if HAVE_FEATURE_SKIA SkiaHelper::cleanup(); -#endif } void WinSalInstance::AfterAppInit() @@ -881,12 +875,8 @@ SalTimer* WinSalInstance::CreateSalTimer() std::shared_ptr<SalBitmap> WinSalInstance::CreateSalBitmap() { -#if HAVE_FEATURE_SKIA - if (SkiaHelper::isVCLSkiaEnabled()) - return std::make_shared<SkiaSalBitmap>(); - else -#endif - return std::make_shared<WinSalBitmap>(); + assert(SkiaHelper::isVCLSkiaEnabled() && "Windows requires skia"); + return std::make_shared<SkiaSalBitmap>(); } int WinSalInstance::WorkaroundExceptionHandlingInUSER32Lib(int, LPEXCEPTION_POINTERS pExceptionInfo) diff --git a/vcl/win/gdi/salfont.cxx b/vcl/win/gdi/salfont.cxx index d3c181af17fa..93e027ba4028 100644 --- a/vcl/win/gdi/salfont.cxx +++ b/vcl/win/gdi/salfont.cxx @@ -69,10 +69,8 @@ #include <font/FontMetricData.hxx> #include <impglyphitem.hxx> -#if HAVE_FEATURE_SKIA #include <vcl/skia/SkiaHelper.hxx> #include <skia/win/font.hxx> -#endif using namespace vcl; @@ -527,11 +525,8 @@ sal_IntPtr WinFontFace::GetFontId() const rtl::Reference<LogicalFontInstance> WinFontFace::CreateFontInstance(const vcl::font::FontSelectPattern& rFSD) const { -#if HAVE_FEATURE_SKIA - if (SkiaHelper::isVCLSkiaEnabled()) - return new SkiaWinFontInstance(*this, rFSD); -#endif - return new WinFontInstance(*this, rFSD); + assert(SkiaHelper::isVCLSkiaEnabled() && "Windows requires skia"); + return new SkiaWinFontInstance(*this, rFSD); } const std::vector<hb_variation_t>& diff --git a/vcl/win/gdi/salgdi.cxx b/vcl/win/gdi/salgdi.cxx index 3bd595699f1b..592bf110b50a 100644 --- a/vcl/win/gdi/salgdi.cxx +++ b/vcl/win/gdi/salgdi.cxx @@ -38,9 +38,7 @@ #include <config_features.h> #include <vcl/skia/SkiaHelper.hxx> -#if HAVE_FEATURE_SKIA #include <skia/win/gdiimpl.hxx> -#endif // we must create pens with 1-pixel width; otherwise the S3-graphics card @@ -257,15 +255,14 @@ WinSalGraphics::WinSalGraphics(WinSalGraphics::Type eType, bool bScreen, HWND hW mpStdClipRgnData(nullptr), mnPenWidth(GSL_PEN_WIDTH) { -#if HAVE_FEATURE_SKIA - if (SkiaHelper::isVCLSkiaEnabled() && !mbPrinter) + assert(SkiaHelper::isVCLSkiaEnabled() && "Windows requires skia"); + if (!mbPrinter) { auto const impl = new WinSkiaSalGraphicsImpl(*this, pProvider); mpImpl.reset(impl); mWinSalGraphicsImplBase = impl; } else -#endif { auto const impl = new WinSalGraphicsImpl(*this); mpImpl.reset(impl); diff --git a/vcl/win/gdi/salgdi2.cxx b/vcl/win/gdi/salgdi2.cxx index ba4afc157bc3..4dca93550041 100644 --- a/vcl/win/gdi/salgdi2.cxx +++ b/vcl/win/gdi/salgdi2.cxx @@ -38,10 +38,8 @@ #include <salgdiimpl.hxx> #include <config_features.h> -#if HAVE_FEATURE_SKIA #include <skia/win/gdiimpl.hxx> #include <skia/salbmp.hxx> -#endif bool WinSalGraphics::supportsOperation( OutDevSupportType eType ) const @@ -106,10 +104,8 @@ public: void convertToWinSalBitmap(SalBitmap& rSalBitmap, WinSalBitmap& rWinSalBitmap) { BitmapPalette aBitmapPalette; -#if HAVE_FEATURE_SKIA if(SkiaSalBitmap* pSkiaSalBitmap = dynamic_cast<SkiaSalBitmap*>(&rSalBitmap)) aBitmapPalette = pSkiaSalBitmap->Palette(); -#endif BitmapBuffer* pRead = rSalBitmap.AcquireBuffer(BitmapAccessMode::Read); @@ -164,9 +160,7 @@ void WinSalGraphics::drawBitmap(const SalTwoRect& rPosAry, const SalBitmap& rSal { assert(&rSalBitmap && "msvc -analyze gets confused here"); if (dynamic_cast<const WinSalBitmap*>(&rSalBitmap) == nullptr -#if HAVE_FEATURE_SKIA && dynamic_cast<WinSkiaSalGraphicsImpl*>(mpImpl.get()) == nullptr -#endif ) { WinSalBitmap aWinSalBitmap; @@ -186,9 +180,7 @@ void WinSalGraphics::drawBitmap( const SalTwoRect& rPosAry, { assert(&rSSalBitmap && "msvc -analyze gets confused here"); if (dynamic_cast<const WinSalBitmap*>(&rSSalBitmap) == nullptr -#if HAVE_FEATURE_SKIA && dynamic_cast<WinSkiaSalGraphicsImpl*>(mpImpl.get()) == nullptr -#endif ) { WinSalBitmap aWinSalBitmap; diff --git a/vcl/win/gdi/salnativewidgets-luna.cxx b/vcl/win/gdi/salnativewidgets-luna.cxx index d39f57041e75..76d7cf4fee28 100644 --- a/vcl/win/gdi/salnativewidgets-luna.cxx +++ b/vcl/win/gdi/salnativewidgets-luna.cxx @@ -54,9 +54,7 @@ #include <win/salinst.h> #include <win/scoped_gdi.hxx> #include <win/wingdiimpl.hxx> -#if HAVE_FEATURE_SKIA #include <skia/win/gdiimpl.hxx> -#endif #include <uxtheme.h> #include <vssym32.h> @@ -1657,9 +1655,9 @@ bool WinSalGraphics::drawNativeControl( ControlType nType, // restore alignment SetTextAlign(getHDC(), ta); } -#if HAVE_FEATURE_SKIA - else if (SkiaHelper::isVCLSkiaEnabled()) + else { + assert(SkiaHelper::isVCLSkiaEnabled() && "Windows requires skia"); // We can do Skia SkiaCompatibleDC aBlackDC( *this, cacheRect.Left(), cacheRect.Top(), cacheRect.GetWidth()+1, cacheRect.GetHeight()+1 ); SetTextAlign(aBlackDC.getCompatibleHDC(), TA_LEFT|TA_TOP|TA_NOUPDATECP); @@ -1675,13 +1673,6 @@ bool WinSalGraphics::drawNativeControl( ControlType nType, bOk = pImpl->RenderAndCacheNativeControl(aWhiteDC, aBlackDC, cacheRect.Left(), cacheRect.Top(), aControlCacheKey); } } -#endif - else - { - // Use normal GDI - SetTextAlign(getHDC(), TA_LEFT|TA_TOP|TA_NOUPDATECP); - ImplDrawNativeControl(getHDC(), hTheme, rc, nType, nPart, nState, aValue, aCaptionStr, bUseDarkMode); - } if (bUseDarkMode) SetWindowTheme(mhWnd, nullptr, nullptr);
