summaryrefslogtreecommitdiff
path: root/vcl/win/source/gdi/salgdi.cxx
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2014-11-02 03:50:57 +0100
committerMarkus Mohrhard <markus.mohrhard@collabora.co.uk>2014-11-10 07:58:46 +0100
commit2fbb95cc634f7d8d52649461e3abffd46a10f7b6 (patch)
treeda31ae95cb191c4a9e1924ac96823b8ceac0a87f /vcl/win/source/gdi/salgdi.cxx
parent5368923b47e908caf7112eb23629cc76cc7e6249 (diff)
improve OpenGL rendering engine selection for Windows backend
Change-Id: Ibcf520aac1441e5ce86b83372061550f8957ab17
Diffstat (limited to 'vcl/win/source/gdi/salgdi.cxx')
-rw-r--r--vcl/win/source/gdi/salgdi.cxx11
1 files changed, 11 insertions, 0 deletions
diff --git a/vcl/win/source/gdi/salgdi.cxx b/vcl/win/source/gdi/salgdi.cxx
index 4022d2d75a7c..b1a164e16718 100644
--- a/vcl/win/source/gdi/salgdi.cxx
+++ b/vcl/win/source/gdi/salgdi.cxx
@@ -36,6 +36,10 @@
#include "gdiimpl.hxx"
#include "openglgdiimpl.hxx"
+#include <vcl/opengl/OpenGLHelper.hxx>
+
+#include <officecfg/Office/Common.hxx>
+
#define DITHER_PAL_DELTA 51
#define DITHER_PAL_STEPS 6
#define DITHER_PAL_COUNT (DITHER_PAL_STEPS*DITHER_PAL_STEPS*DITHER_PAL_STEPS)
@@ -578,6 +582,13 @@ WinSalGraphics::WinSalGraphics(WinSalGraphics::Type eType, bool bScreen, HWND hW
mbFontKernInit(false),
mnPenWidth(GSL_PEN_WIDTH)
{
+ static bool bOpenGLPossible = OpenGLHelper::supportsVCLOpenGL();
+ bool bUseOpenGL = bOpenGLPossible ? officecfg::Office::Common::VCL::UseOpenGL::get() : false;
+ if (bUseOpenGL)
+ mpImpl.reset(new OpenGLSalGraphicsImpl());
+ else
+ mpImpl.reset(new WinSalGraphicsImpl(*this));
+
for( int i = 0; i < MAX_FALLBACK; ++i )
{
mhFonts[ i ] = 0;