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>
This commit is contained in:
committed by
Jan Holesovsky
parent
f7bc163ca4
commit
055f76b8f1
@@ -29,6 +29,7 @@ $(eval $(call gb_Library_use_libraries,canvasfactory,\
|
|||||||
cppu \
|
cppu \
|
||||||
cppuhelper \
|
cppuhelper \
|
||||||
sal \
|
sal \
|
||||||
|
vcl \
|
||||||
$(gb_UWINAPI) \
|
$(gb_UWINAPI) \
|
||||||
))
|
))
|
||||||
|
|
||||||
|
@@ -31,6 +31,7 @@
|
|||||||
#include <toolkit/helper/vclunohelper.hxx>
|
#include <toolkit/helper/vclunohelper.hxx>
|
||||||
#include <tools/diagnose_ex.h>
|
#include <tools/diagnose_ex.h>
|
||||||
#include <vcl/sysdata.hxx>
|
#include <vcl/sysdata.hxx>
|
||||||
|
#include <vcl/opengl/OpenGLWrapper.hxx>
|
||||||
|
|
||||||
#include <canvas/canvastools.hxx>
|
#include <canvas/canvastools.hxx>
|
||||||
|
|
||||||
@@ -54,6 +55,9 @@ namespace cairocanvas
|
|||||||
if( maArguments.getLength() == 0 )
|
if( maArguments.getLength() == 0 )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
// tdf#93870 - force VCL canvas in OpenGL mode for now.
|
||||||
|
assert( !OpenGLWrapper::isVCLOpenGLEnabled() );
|
||||||
|
|
||||||
/* maArguments:
|
/* maArguments:
|
||||||
0: ptr to creating instance (Window or VirtualDevice)
|
0: ptr to creating instance (Window or VirtualDevice)
|
||||||
1: SystemEnvData as a streamed Any (or empty for VirtualDevice)
|
1: SystemEnvData as a streamed Any (or empty for VirtualDevice)
|
||||||
|
@@ -38,6 +38,7 @@
|
|||||||
#include <toolkit/helper/vclunohelper.hxx>
|
#include <toolkit/helper/vclunohelper.hxx>
|
||||||
#include <tools/diagnose_ex.h>
|
#include <tools/diagnose_ex.h>
|
||||||
#include <vcl/sysdata.hxx>
|
#include <vcl/sysdata.hxx>
|
||||||
|
#include <vcl/opengl/OpenGLWrapper.hxx>
|
||||||
|
|
||||||
#include <canvas/canvastools.hxx>
|
#include <canvas/canvastools.hxx>
|
||||||
|
|
||||||
@@ -78,6 +79,9 @@ namespace dxcanvas
|
|||||||
if( maArguments.getLength() == 0 )
|
if( maArguments.getLength() == 0 )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
// tdf#93870 - force VCL canvas in OpenGL mode for now.
|
||||||
|
assert( !OpenGLWrapper::isVCLOpenGLEnabled() );
|
||||||
|
|
||||||
SAL_INFO("canvas.directx", "Canvas::initialize called" );
|
SAL_INFO("canvas.directx", "Canvas::initialize called" );
|
||||||
|
|
||||||
// At index 1, we expect a HWND handle here, containing a
|
// At index 1, we expect a HWND handle here, containing a
|
||||||
|
@@ -39,6 +39,7 @@
|
|||||||
#include <osl/mutex.hxx>
|
#include <osl/mutex.hxx>
|
||||||
#include <osl/process.h>
|
#include <osl/process.h>
|
||||||
#include <o3tl/functional.hxx>
|
#include <o3tl/functional.hxx>
|
||||||
|
#include <vcl/opengl/OpenGLWrapper.hxx>
|
||||||
|
|
||||||
using namespace ::com::sun::star;
|
using namespace ::com::sun::star;
|
||||||
using namespace ::com::sun::star::uno;
|
using namespace ::com::sun::star::uno;
|
||||||
@@ -308,6 +309,10 @@ Reference<XInterface> CanvasFactory::lookupAndUse(
|
|||||||
m_bCacheHasForcedLastImpl,
|
m_bCacheHasForcedLastImpl,
|
||||||
OUString("ForceSafeServiceImpl") );
|
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)
|
// use anti-aliasing canvas, if config flag set (or not existing)
|
||||||
bool bUseAAEntry(true);
|
bool bUseAAEntry(true);
|
||||||
checkConfigFlag( bUseAAEntry,
|
checkConfigFlag( bUseAAEntry,
|
||||||
|
@@ -48,7 +48,7 @@
|
|||||||
#include <rtl/ustrbuf.hxx>
|
#include <rtl/ustrbuf.hxx>
|
||||||
#include <vcl/bitmap.hxx>
|
#include <vcl/bitmap.hxx>
|
||||||
#include <officecfg/Office/Common.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::uno;
|
||||||
using namespace ::com::sun::star::beans;
|
using namespace ::com::sun::star::beans;
|
||||||
@@ -295,7 +295,7 @@ OUString AboutDialog::GetVersionString()
|
|||||||
sVersion += m_sBuildStr.replaceAll("$BUILDID", sBuildId);
|
sVersion += m_sBuildStr.replaceAll("$BUILDID", sBuildId);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (OpenGLHelper::isVCLOpenGLEnabled())
|
if (OpenGLWrapper::isVCLOpenGLEnabled())
|
||||||
{
|
{
|
||||||
sVersion += "-GL";
|
sVersion += "-GL";
|
||||||
}
|
}
|
||||||
|
@@ -89,6 +89,7 @@
|
|||||||
#include <vcl/svapp.hxx>
|
#include <vcl/svapp.hxx>
|
||||||
#include <vcl/settings.hxx>
|
#include <vcl/settings.hxx>
|
||||||
#include <vcl/IconThemeInfo.hxx>
|
#include <vcl/IconThemeInfo.hxx>
|
||||||
|
#include <vcl/opengl/OpenGLWrapper.hxx>
|
||||||
|
|
||||||
#include "optgdlg.hxx"
|
#include "optgdlg.hxx"
|
||||||
#include <svx/ofaitem.hxx>
|
#include <svx/ofaitem.hxx>
|
||||||
@@ -522,7 +523,10 @@ CanvasSettings::CanvasSettings() :
|
|||||||
|
|
||||||
bool CanvasSettings::IsHardwareAccelerationAvailable() const
|
bool CanvasSettings::IsHardwareAccelerationAvailable() const
|
||||||
{
|
{
|
||||||
if( !mbHWAccelChecked )
|
if( OpenGLWrapper::isVCLOpenGLEnabled() )
|
||||||
|
mbHWAccelAvailable = false;
|
||||||
|
|
||||||
|
else if( !mbHWAccelChecked )
|
||||||
{
|
{
|
||||||
mbHWAccelChecked = true;
|
mbHWAccelChecked = true;
|
||||||
|
|
||||||
|
26
include/vcl/opengl/OpenGLWrapper.hxx
Normal file
26
include/vcl/opengl/OpenGLWrapper.hxx
Normal file
@@ -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
|
@@ -32,6 +32,7 @@
|
|||||||
#include "opengl/zone.hxx"
|
#include "opengl/zone.hxx"
|
||||||
#include "opengl/watchdog.hxx"
|
#include "opengl/watchdog.hxx"
|
||||||
#include <osl/conditn.h>
|
#include <osl/conditn.h>
|
||||||
|
#include <vcl/opengl/OpenGLWrapper.hxx>
|
||||||
#include <vcl/opengl/OpenGLContext.hxx>
|
#include <vcl/opengl/OpenGLContext.hxx>
|
||||||
|
|
||||||
#if defined UNX && !defined MACOSX && !defined IOS && !defined ANDROID
|
#if defined UNX && !defined MACOSX && !defined IOS && !defined ANDROID
|
||||||
@@ -677,6 +678,11 @@ bool OpenGLHelper::isVCLOpenGLEnabled()
|
|||||||
return bRet;
|
return bRet;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool OpenGLWrapper::isVCLOpenGLEnabled()
|
||||||
|
{
|
||||||
|
return OpenGLHelper::isVCLOpenGLEnabled();
|
||||||
|
}
|
||||||
|
|
||||||
void OpenGLHelper::debugMsgStream(const char *pArea, std::ostringstream const &pStream)
|
void OpenGLHelper::debugMsgStream(const char *pArea, std::ostringstream const &pStream)
|
||||||
{
|
{
|
||||||
debugMsgPrint(pArea, "%s", pStream.str().c_str());
|
debugMsgPrint(pArea, "%s", pStream.str().c_str());
|
||||||
|
Reference in New Issue
Block a user