summaryrefslogtreecommitdiff
path: root/vcl/source/opengl
diff options
context:
space:
mode:
authorJan-Marek Glogowski <glogow@fbihome.de>2018-11-23 08:43:04 +0100
committerJan-Marek Glogowski <glogow@fbihome.de>2018-12-05 14:39:37 +0100
commita6dc9f3fd18ad69aa041662628f4f923ab3a82f8 (patch)
tree4c70b5b29c28a70157bdbad3a7163b38a094240e /vcl/source/opengl
parent329db5d412cc0d5e0f97cb939b94259679396ead (diff)
Add interface for software-only bitmap rendering
When SAL_USE_VCLPLUGIN=svp is used, LO is expected to render output only to bitmaps, without real GUI windows. This adds an enabler and a getter function to the Application class, so one can query this information easy as (Enable|Is)BitmapRendering. This can be used by all VCL plugins, which can't fall back to the Cairo based SVP plugin, primary OSX and Win. A working implementation should allow to run all test via SSH. All window-requiring tests already have to set this requirement using gb_CppunitTest_use_vcl_non_headless(_with_windows)? and should be moved to a different make target, or we need some test harness to handle this correctly, before VCL fails the test. Change-Id: I4bd4c81122a6686b090fdd93256d4712ac5f05dd Reviewed-on: https://gerrit.libreoffice.org/64051 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
Diffstat (limited to 'vcl/source/opengl')
-rw-r--r--vcl/source/opengl/OpenGLHelper.cxx13
1 files changed, 4 insertions, 9 deletions
diff --git a/vcl/source/opengl/OpenGLHelper.cxx b/vcl/source/opengl/OpenGLHelper.cxx
index 588ae70cabe0..882f35d424af 100644
--- a/vcl/source/opengl/OpenGLHelper.cxx
+++ b/vcl/source/opengl/OpenGLHelper.cxx
@@ -956,8 +956,8 @@ bool OpenGLHelper::isVCLOpenGLEnabled()
static bool bEnable = false;
static bool bForceOpenGL = false;
- // If we are a console app, then we don't use OpenGL
- if ( Application::IsConsoleOnly() )
+ // No hardware rendering, so no OpenGL
+ if (Application::IsBitmapRendering())
return false;
//tdf#106155, disable GL while loading certain bitmaps needed for the initial toplevel windows
@@ -988,19 +988,14 @@ bool OpenGLHelper::isVCLOpenGLEnabled()
else if (bSupportsVCLOpenGL)
{
static bool bEnableGLEnv = !!getenv("SAL_ENABLEGL");
- static bool bHeadlessPlugin = []{
- OUString plugin;
- rtl::Bootstrap::get("SAL_USE_VCLPLUGIN", plugin);
- return plugin == "svp";
- }();
bEnable = bEnableGLEnv;
if (officecfg::Office::Common::VCL::UseOpenGL::get())
bEnable = true;
- // Force disable in safe mode or when running with headless plugin
- if (bHeadlessPlugin || Application::IsSafeModeEnabled())
+ // Force disable in safe mode
+ if (Application::IsSafeModeEnabled())
bEnable = false;
bRet = bEnable;