From 99bff8cf8f199cd5899134f12b499ce4ee9a4e82 Mon Sep 17 00:00:00 2001 From: Luboš Luňák Date: Tue, 22 Oct 2019 11:48:08 +0200 Subject: add GUI and configuration options for Skia Pretty much a copy&paste of OpenGL. There are no settings for choosing which backend Skia should use, as the plan is that simply the "best" one will be selected. Change-Id: I44fa876ab85de98de482a6ed9f814024334686ce --- vcl/inc/strings.hrc | 1 + vcl/skia/SkiaHelper.cxx | 10 ++++++---- vcl/source/app/svapp.cxx | 5 ++++- 3 files changed, 11 insertions(+), 5 deletions(-) (limited to 'vcl') diff --git a/vcl/inc/strings.hrc b/vcl/inc/strings.hrc index 7e936fc711a2..d8f73a587722 100644 --- a/vcl/inc/strings.hrc +++ b/vcl/inc/strings.hrc @@ -125,6 +125,7 @@ #define SV_APP_OSVERSION NC_("SV_APP_OSVERSION", "OS: ") #define SV_APP_UIRENDER NC_("SV_APP_UIRENDER", "UI render: ") #define SV_APP_GL NC_("SV_APP_GL", "GL") +#define SV_APP_SKIA NC_("SV_APP_SKIA", "Skia") #define SV_APP_DEFAULT NC_("SV_APP_DEFAULT", "default") #define SV_MSGBOX_INFO NC_("SV_MSGBOX_INFO", "Information") diff --git a/vcl/skia/SkiaHelper.cxx b/vcl/skia/SkiaHelper.cxx index 278d19bd8d52..bc643bd546b1 100644 --- a/vcl/skia/SkiaHelper.cxx +++ b/vcl/skia/SkiaHelper.cxx @@ -10,6 +10,8 @@ #include #include +#include +#include #include @@ -54,8 +56,7 @@ bool SkiaHelper::isVCLSkiaEnabled() */ bSet = true; - bForceSkia = !!getenv( - "SAL_FORCESKIA"); // TODO SKIA || officecfg::Office::Common::VCL::ForceOpenGL::get(); + bForceSkia = !!getenv("SAL_FORCESKIA") || officecfg::Office::Common::VCL::ForceSkia::get(); bool bRet = false; bool bSupportsVCLSkia = supportsVCLSkia(); @@ -70,7 +71,8 @@ bool SkiaHelper::isVCLSkiaEnabled() bEnable = bEnableSkiaEnv; - // TODO SKIA if (officecfg::Office::Common::VCL::UseOpenGL::get()) + if (officecfg::Office::Common::VCL::UseSkia::get()) + bEnable = false; // Force disable in safe mode if (Application::IsSafeModeEnabled()) @@ -79,7 +81,7 @@ bool SkiaHelper::isVCLSkiaEnabled() bRet = bEnable; } - // TODO SKIA CrashReporter::AddKeyValue("UseOpenGL", OUString::boolean(bRet)); + CrashReporter::addKeyValue("UseSkia", OUString::boolean(bRet), CrashReporter::Write); return bRet; } diff --git a/vcl/source/app/svapp.cxx b/vcl/source/app/svapp.cxx index 3dcfc82ec00a..4b97754bebbe 100644 --- a/vcl/source/app/svapp.cxx +++ b/vcl/source/app/svapp.cxx @@ -49,6 +49,7 @@ #if HAVE_FEATURE_OPENGL #include #endif +#include #include #include @@ -1147,12 +1148,14 @@ OUString Application::GetHWOSConfInfo() aDetails.append( "; " ); aDetails.append( VclResId(SV_APP_UIRENDER) ); -// TODO SKIA #if HAVE_FEATURE_OPENGL if ( OpenGLWrapper::isVCLOpenGLEnabled() ) aDetails.append( VclResId(SV_APP_GL) ); else #endif + if ( SkiaHelper::isVCLSkiaEnabled() ) + aDetails.append( VclResId(SV_APP_SKIA) ); + else aDetails.append( VclResId(SV_APP_DEFAULT) ); aDetails.append( "; " ); -- cgit