summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2015-06-12 02:22:39 +0200
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2015-06-12 13:20:04 +0000
commit12b73697ed5787a621910623d76a6e241b04bd1a (patch)
tree0d969e96c6df2534fd0b132a46a92383424759de /vcl
parent7dee641f675e7f472f5bec39cb92a1422fd1ffee (diff)
in general this seems to make more sense
Change-Id: I00dfbaa9971e3ee589672e51bca07e8eddfdc167 Reviewed-on: https://gerrit.libreoffice.org/16238 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com> Tested-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/inc/opengl/x11/salvd.hxx3
-rw-r--r--vcl/opengl/x11/salvd.cxx11
-rw-r--r--vcl/unx/generic/gdi/salvd.cxx6
3 files changed, 12 insertions, 8 deletions
diff --git a/vcl/inc/opengl/x11/salvd.hxx b/vcl/inc/opengl/x11/salvd.hxx
index e4e6ecda0860..f74bbb523ac3 100644
--- a/vcl/inc/opengl/x11/salvd.hxx
+++ b/vcl/inc/opengl/x11/salvd.hxx
@@ -34,7 +34,8 @@ public:
X11OpenGLSalVirtualDevice( SalGraphics *pGraphics,
long &nDX, long &nDY,
sal_uInt16 nBitCount,
- const SystemGraphicsData *pData );
+ const SystemGraphicsData *pData,
+ X11SalGraphics* pNewGraphics);
virtual ~X11OpenGLSalVirtualDevice();
// SalGeometryProvider
diff --git a/vcl/opengl/x11/salvd.cxx b/vcl/opengl/x11/salvd.cxx
index a613ce5f84fc..9e9986f9f3b1 100644
--- a/vcl/opengl/x11/salvd.cxx
+++ b/vcl/opengl/x11/salvd.cxx
@@ -36,7 +36,9 @@ void X11SalGraphics::Init( X11OpenGLSalVirtualDevice *pDevice )
X11OpenGLSalVirtualDevice::X11OpenGLSalVirtualDevice( SalGraphics* pGraphics,
long &nDX, long &nDY,
sal_uInt16 nBitCount,
- const SystemGraphicsData *pData ) :
+ const SystemGraphicsData *pData,
+ X11SalGraphics* pNewGraphics) :
+ mpGraphics(pNewGraphics),
mbGraphics( false ),
mnXScreen( 0 )
{
@@ -53,8 +55,11 @@ X11OpenGLSalVirtualDevice::X11OpenGLSalVirtualDevice( SalGraphics* pGraphics,
vcl_sal::getSalDisplay(GetGenericData())->GetDefaultXScreen();
mnWidth = nDX;
mnHeight = nDY;
- mpGraphics = new X11SalGraphics();
- mpGraphics->SetLayout( SalLayoutFlags::NONE );
+ if (!mpGraphics)
+ {
+ mpGraphics = new X11SalGraphics();
+ mpGraphics->SetLayout( SalLayoutFlags::NONE );
+ }
mpGraphics->Init( this );
}
diff --git a/vcl/unx/generic/gdi/salvd.cxx b/vcl/unx/generic/gdi/salvd.cxx
index 0a5414638338..b0caab71ae5d 100644
--- a/vcl/unx/generic/gdi/salvd.cxx
+++ b/vcl/unx/generic/gdi/salvd.cxx
@@ -39,13 +39,11 @@ SalVirtualDevice* X11SalInstance::CreateX11VirtualDevice(SalGraphics* pGraphics,
long &nDX, long &nDY, sal_uInt16 nBitCount, const SystemGraphicsData *pData,
X11SalGraphics* pNewGraphics)
{
+ assert(pNewGraphics);
if (OpenGLHelper::isVCLOpenGLEnabled())
- return new X11OpenGLSalVirtualDevice( pGraphics, nDX, nDY, nBitCount, pData );
+ return new X11OpenGLSalVirtualDevice( pGraphics, nDX, nDY, nBitCount, pData, pNewGraphics );
else
- {
- assert(pNewGraphics);
return new X11SalVirtualDevice(pGraphics, nDX, nDY, nBitCount, pData, pNewGraphics);
- }
}
SalVirtualDevice* X11SalInstance::CreateVirtualDevice(SalGraphics* pGraphics,