diff options
author | Jan Holesovsky <kendy@collabora.com> | 2015-05-23 15:31:51 +0200 |
---|---|---|
committer | Jan Holesovsky <kendy@collabora.com> | 2015-05-24 02:12:00 +0200 |
commit | b0cd381de11340de8e72020f774a64d3ade6bbd9 (patch) | |
tree | 1aa5f1a69d40373a4b59171e0dddb42481d6cd01 /vcl | |
parent | 943e2040a7e3dce7c49acafeff7a0e2125c355c8 (diff) |
rendercontext: Initialize X11SalVirtualDevice with appropriate SalGraphics.
Change-Id: I4230412ccc389b8ba6768229b569d7075e7ac466
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/inc/opengl/x11/salvd.hxx | 1 | ||||
-rw-r--r-- | vcl/inc/unx/gtk/gtkgdi.hxx | 3 | ||||
-rw-r--r-- | vcl/inc/unx/salinst.h | 6 | ||||
-rw-r--r-- | vcl/inc/unx/salvd.h | 7 | ||||
-rw-r--r-- | vcl/unx/generic/gdi/salvd.cxx | 27 | ||||
-rw-r--r-- | vcl/unx/gtk/app/gtkinst.cxx | 6 |
6 files changed, 33 insertions, 17 deletions
diff --git a/vcl/inc/opengl/x11/salvd.hxx b/vcl/inc/opengl/x11/salvd.hxx index 2d6089849031..e4e6ecda0860 100644 --- a/vcl/inc/opengl/x11/salvd.hxx +++ b/vcl/inc/opengl/x11/salvd.hxx @@ -18,6 +18,7 @@ class SalDisplay; class X11OpenGLSalGraphics; +class X11SalGraphics; class X11OpenGLSalVirtualDevice : public SalVirtualDevice { diff --git a/vcl/inc/unx/gtk/gtkgdi.hxx b/vcl/inc/unx/gtk/gtkgdi.hxx index e0d088178974..60b1513cc1a1 100644 --- a/vcl/inc/unx/gtk/gtkgdi.hxx +++ b/vcl/inc/unx/gtk/gtkgdi.hxx @@ -26,12 +26,13 @@ #include <gdk/gdkkeysyms.h> #include <postx.h> +#include <unx/gtk/gtkframe.hxx> + #if GTK_CHECK_VERSION(3,0,0) #include <headless/svpgdi.hxx> #include "textrender.hxx" -class GtkSalFrame; class GtkSalGraphics : public SvpSalGraphics { GtkSalFrame *mpFrame; diff --git a/vcl/inc/unx/salinst.h b/vcl/inc/unx/salinst.h index b8feb71b33ae..381ddda2e35f 100644 --- a/vcl/inc/unx/salinst.h +++ b/vcl/inc/unx/salinst.h @@ -34,6 +34,8 @@ namespace com { namespace sun { namespace star { namespace datatransfer { } } } } class SalXLib; +class X11SalGraphics; + class VCLPLUG_GEN_PUBLIC X11SalInstance : public SalGenericInstance { private: @@ -53,6 +55,10 @@ public: virtual SalObject* CreateObject( SalFrame* pParent, SystemWindowData* pWindowData, bool bShow = true ) SAL_OVERRIDE; virtual void DestroyObject( SalObject* pObject ) SAL_OVERRIDE; + /// Gtk vclplug needs to pass GtkSalGraphics to X11SalVirtualDevice, so create it, and pass as pNewGraphics. + virtual SalVirtualDevice* CreateX11VirtualDevice(SalGraphics* pGraphics, long &nDX, long &nDY, + sal_uInt16 nBitCount, const SystemGraphicsData* pData, X11SalGraphics* pNewGraphics); + virtual SalVirtualDevice* CreateVirtualDevice( SalGraphics* pGraphics, long &nDX, long &nDY, sal_uInt16 nBitCount, const SystemGraphicsData *pData = NULL ) SAL_OVERRIDE; diff --git a/vcl/inc/unx/salvd.h b/vcl/inc/unx/salvd.h index 4f98c0c68ad7..14ad97e9008b 100644 --- a/vcl/inc/unx/salvd.h +++ b/vcl/inc/unx/salvd.h @@ -44,10 +44,9 @@ class X11SalVirtualDevice : public SalVirtualDevice bool bExternPixmap_; public: - X11SalVirtualDevice( SalGraphics *pGraphics, - long &nDX, long &nDY, - sal_uInt16 nBitCount, - const SystemGraphicsData *pData ); + X11SalVirtualDevice(SalGraphics *pGraphics, long &nDX, long &nDY, + sal_uInt16 nBitCount, const SystemGraphicsData *pData, X11SalGraphics* pNewGraphics); + virtual ~X11SalVirtualDevice(); Display *GetXDisplay() const diff --git a/vcl/unx/generic/gdi/salvd.cxx b/vcl/unx/generic/gdi/salvd.cxx index f64612bd5197..847ea9d09509 100644 --- a/vcl/unx/generic/gdi/salvd.cxx +++ b/vcl/unx/generic/gdi/salvd.cxx @@ -35,14 +35,20 @@ #include <vcl/opengl/OpenGLHelper.hxx> #include <opengl/x11/salvd.hxx> -SalVirtualDevice* X11SalInstance::CreateVirtualDevice( SalGraphics* pGraphics, - long &nDX, long &nDY, - sal_uInt16 nBitCount, const SystemGraphicsData *pData ) +SalVirtualDevice* X11SalInstance::CreateX11VirtualDevice(SalGraphics* pGraphics, + long &nDX, long &nDY, sal_uInt16 nBitCount, const SystemGraphicsData *pData, + X11SalGraphics* pNewGraphics) { if (OpenGLHelper::isVCLOpenGLEnabled()) return new X11OpenGLSalVirtualDevice( pGraphics, nDX, nDY, nBitCount, pData ); else - return new X11SalVirtualDevice( pGraphics, nDX, nDY, nBitCount, pData ); + return new X11SalVirtualDevice(pGraphics, nDX, nDY, nBitCount, pData, pNewGraphics); +} + +SalVirtualDevice* X11SalInstance::CreateVirtualDevice(SalGraphics* pGraphics, + long &nDX, long &nDY, sal_uInt16 nBitCount, const SystemGraphicsData *pData) +{ + return CreateX11VirtualDevice(pGraphics, nDX, nDY, nBitCount, pData, new X11SalGraphics()); } void X11SalGraphics::Init( X11SalVirtualDevice *pDevice, SalColormap* pColormap, @@ -81,12 +87,12 @@ void X11SalGraphics::Init( X11SalVirtualDevice *pDevice, SalColormap* pColormap, mxImpl->Init(); } -X11SalVirtualDevice::X11SalVirtualDevice( SalGraphics* pGraphics, - long &nDX, long &nDY, - sal_uInt16 nBitCount, - const SystemGraphicsData *pData ) : - m_nXScreen( 0 ), - bGraphics_( false ) +X11SalVirtualDevice::X11SalVirtualDevice(SalGraphics* pGraphics, long &nDX, long &nDY, + sal_uInt16 nBitCount, const SystemGraphicsData *pData, + X11SalGraphics* pNewGraphics) : + pGraphics_(pNewGraphics), + m_nXScreen(0), + bGraphics_(false) { SalColormap* pColormap = NULL; bool bDeleteColormap = false; @@ -95,7 +101,6 @@ X11SalVirtualDevice::X11SalVirtualDevice( SalGraphics* pGraphics, nBitCount = pGraphics->GetBitCount(); pDisplay_ = vcl_sal::getSalDisplay(GetGenericData()); - pGraphics_ = new X11SalGraphics(); nDepth_ = nBitCount; if( pData && pData->hDrawable != None ) diff --git a/vcl/unx/gtk/app/gtkinst.cxx b/vcl/unx/gtk/app/gtkinst.cxx index f9883c871be8..11a18e5e90e0 100644 --- a/vcl/unx/gtk/app/gtkinst.cxx +++ b/vcl/unx/gtk/app/gtkinst.cxx @@ -23,6 +23,7 @@ #include <unx/gtk/gtkdata.hxx> #include <unx/gtk/gtkinst.hxx> #include <unx/salobj.h> +#include <unx/gtk/gtkgdi.hxx> #include <unx/gtk/gtkframe.hxx> #include <unx/gtk/gtkobject.hxx> #include <unx/gtk/atkbridge.hxx> @@ -320,7 +321,10 @@ SalVirtualDevice* GtkInstance::CreateVirtualDevice( SalGraphics *pG, pNew->SetSize( nDX, nDY ); return pNew; #else - return X11SalInstance::CreateVirtualDevice( pG, nDX, nDY, nBitCount, pGd ); + GtkSalGraphics *pGtkSalGraphics = dynamic_cast<GtkSalGraphics*>(pG); + assert(pGtkSalGraphics); + return CreateX11VirtualDevice(pG, nDX, nDY, nBitCount, pGd, + new GtkSalGraphics(pGtkSalGraphics->GetGtkFrame(), pGtkSalGraphics->GetGtkWidget())); #endif } |