diff options
author | Michael Meeks <michael.meeks@collabora.com> | 2015-09-03 00:30:28 +0100 |
---|---|---|
committer | Jan Holesovsky <kendy@collabora.com> | 2015-09-03 11:21:58 +0000 |
commit | d75600ef299b2a8c7b269936acebe646a16e62a5 (patch) | |
tree | 0440ddd0f54858403ebd84c9f73f109c152be43a | |
parent | adf39dbade8652ceca9007484bfa20f04c5ebec0 (diff) |
tdf#93870 - GL accel. via VCL canvas for presentations when GL enabled.
Change-Id: Ia31a88cb3d9e6baa987b22f77f407a3f592031f1
Reviewed-on: https://gerrit.libreoffice.org/18285
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Michael Meeks <michael.meeks@collabora.com>
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/18295
-rw-r--r-- | canvas/Library_canvasfactory.mk | 1 | ||||
-rw-r--r-- | canvas/source/cairo/cairo_canvas.cxx | 4 | ||||
-rw-r--r-- | canvas/source/directx/dx_canvas.cxx | 4 | ||||
-rw-r--r-- | canvas/source/factory/cf_service.cxx | 5 | ||||
-rw-r--r-- | cui/source/dialogs/about.cxx | 4 | ||||
-rw-r--r-- | cui/source/options/optgdlg.cxx | 6 | ||||
-rw-r--r-- | include/vcl/opengl/OpenGLWrapper.hxx | 26 | ||||
-rw-r--r-- | vcl/source/opengl/OpenGLHelper.cxx | 6 |
8 files changed, 53 insertions, 3 deletions
diff --git a/canvas/Library_canvasfactory.mk b/canvas/Library_canvasfactory.mk index dec3175f0bbf..d3992fcc84d5 100644 --- a/canvas/Library_canvasfactory.mk +++ b/canvas/Library_canvasfactory.mk @@ -29,6 +29,7 @@ $(eval $(call gb_Library_use_libraries,canvasfactory,\ cppu \ cppuhelper \ sal \ + vcl \ $(gb_UWINAPI) \ )) diff --git a/canvas/source/cairo/cairo_canvas.cxx b/canvas/source/cairo/cairo_canvas.cxx index e27daa2384eb..4d429df24d0b 100644 --- a/canvas/source/cairo/cairo_canvas.cxx +++ b/canvas/source/cairo/cairo_canvas.cxx @@ -30,6 +30,7 @@ #include <com/sun/star/lang/NoSupportException.hpp> #include <toolkit/helper/vclunohelper.hxx> +#include <vcl/opengl/OpenGLWrapper.hxx> #include <basegfx/matrix/b2dhommatrix.hxx> #include <basegfx/point/b2dpoint.hxx> @@ -58,6 +59,9 @@ namespace cairocanvas if( maArguments.getLength() == 0 ) return; + // tdf#93870 - force VCL canvas in OpenGL mode for now. + assert( !OpenGLWrapper::isVCLOpenGLEnabled() ); + /* maArguments: 0: ptr to creating instance (Window or VirtualDevice) 1: SystemEnvData as a streamed Any (or empty for VirtualDevice) diff --git a/canvas/source/directx/dx_canvas.cxx b/canvas/source/directx/dx_canvas.cxx index 0cfb5420d0cb..d1aa77d2263c 100644 --- a/canvas/source/directx/dx_canvas.cxx +++ b/canvas/source/directx/dx_canvas.cxx @@ -37,6 +37,7 @@ #include <cppuhelper/factory.hxx> #include <cppuhelper/implementationentry.hxx> #include <comphelper/servicedecl.hxx> +#include <vcl/opengl/OpenGLWrapper.hxx> #include <basegfx/matrix/b2dhommatrix.hxx> #include <basegfx/point/b2dpoint.hxx> @@ -82,6 +83,9 @@ namespace dxcanvas if( maArguments.getLength() == 0 ) return; + // tdf#93870 - force VCL canvas in OpenGL mode for now. + assert( !OpenGLWrapper::isVCLOpenGLEnabled() ); + VERBOSE_TRACE( "Canvas::initialize called" ); // At index 1, we expect a HWND handle here, containing a diff --git a/canvas/source/factory/cf_service.cxx b/canvas/source/factory/cf_service.cxx index 427acb7948c4..64451299f437 100644 --- a/canvas/source/factory/cf_service.cxx +++ b/canvas/source/factory/cf_service.cxx @@ -40,6 +40,7 @@ #include <utility> #include <o3tl/compat_functional.hxx> #include <algorithm> +#include <vcl/opengl/OpenGLWrapper.hxx> using namespace ::com::sun::star; @@ -310,6 +311,10 @@ Reference<XInterface> CanvasFactory::lookupAndUse( m_bCacheHasForcedLastImpl, OUString("ForceSafeServiceImpl") ); + // tdf#93870 - force VCL canvas in OpenGL mode for now. + if( OpenGLWrapper::isVCLOpenGLEnabled() ) + bForceLastEntry = true; + // use anti-aliasing canvas, if config flag set (or not existing) bool bUseAAEntry(true); checkConfigFlag( bUseAAEntry, diff --git a/cui/source/dialogs/about.cxx b/cui/source/dialogs/about.cxx index e5732b226690..4121887933ff 100644 --- a/cui/source/dialogs/about.cxx +++ b/cui/source/dialogs/about.cxx @@ -48,7 +48,7 @@ #include <rtl/ustrbuf.hxx> #include <vcl/bitmap.hxx> #include <officecfg/Office/Common.hxx> -#include <vcl/opengl/OpenGLHelper.hxx> +#include <vcl/opengl/OpenGLWrapper.hxx> using namespace ::com::sun::star::uno; using namespace ::com::sun::star::beans; @@ -297,7 +297,7 @@ OUString AboutDialog::GetVersionString() sVersion += m_sBuildStr.replaceAll("$BUILDID", sBuildId); } - if (OpenGLHelper::isVCLOpenGLEnabled()) + if (OpenGLWrapper::isVCLOpenGLEnabled()) { sVersion += "-GL"; } diff --git a/cui/source/options/optgdlg.cxx b/cui/source/options/optgdlg.cxx index c0ed6d50fc03..f2761e52005a 100644 --- a/cui/source/options/optgdlg.cxx +++ b/cui/source/options/optgdlg.cxx @@ -90,6 +90,7 @@ #include <vcl/svapp.hxx> #include <vcl/settings.hxx> #include <vcl/IconThemeInfo.hxx> +#include <vcl/opengl/OpenGLWrapper.hxx> #include "optgdlg.hxx" #include <svx/ofaitem.hxx> @@ -548,7 +549,10 @@ CanvasSettings::CanvasSettings() : bool CanvasSettings::IsHardwareAccelerationAvailable() const { - if( !mbHWAccelChecked ) + if( OpenGLWrapper::isVCLOpenGLEnabled() ) + mbHWAccelAvailable = false; + + else if( !mbHWAccelChecked ) { mbHWAccelChecked = true; diff --git a/include/vcl/opengl/OpenGLWrapper.hxx b/include/vcl/opengl/OpenGLWrapper.hxx new file mode 100644 index 000000000000..c2f44c0c6b6b --- /dev/null +++ b/include/vcl/opengl/OpenGLWrapper.hxx @@ -0,0 +1,26 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +// Fully wrapped methods that have no exotic GL / GLEW header deps. + +#ifndef INCLUDED_VCL_OPENGL_OPENGLWRAPPER_HXX +#define INCLUDED_VCL_OPENGL_OPENGLWRAPPER_HXX + +#include <vcl/dllapi.h> + +class VCL_DLLPUBLIC OpenGLWrapper +{ +public: + /** + * Returns true if VCL has OpenGL rendering enabled + */ + static bool isVCLOpenGLEnabled(); +}; + +#endif // INCLUDED_VCL_OPENGL_OPENGLWRAPPER_HXX diff --git a/vcl/source/opengl/OpenGLHelper.cxx b/vcl/source/opengl/OpenGLHelper.cxx index c4302eb52659..1b48fec9216a 100644 --- a/vcl/source/opengl/OpenGLHelper.cxx +++ b/vcl/source/opengl/OpenGLHelper.cxx @@ -32,6 +32,7 @@ #include "opengl/zone.hxx" #include "opengl/watchdog.hxx" #include <osl/conditn.h> +#include <vcl/opengl/OpenGLWrapper.hxx> #include <vcl/opengl/OpenGLContext.hxx> #if defined UNX && !defined MACOSX && !defined IOS && !defined ANDROID @@ -681,6 +682,11 @@ bool OpenGLHelper::isVCLOpenGLEnabled() return bRet; } +bool OpenGLWrapper::isVCLOpenGLEnabled() +{ + return OpenGLHelper::isVCLOpenGLEnabled(); +} + void OpenGLHelper::debugMsgStream(const char *pArea, std::ostringstream const &pStream) { debugMsgPrint(pArea, "%s", pStream.str().c_str()); |