summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2016-05-19 11:14:18 +0100
committerCaolán McNamara <caolanm@redhat.com>2016-05-19 11:15:03 +0100
commit9ae808c190ddf94856cdfa16acef8cdd5d8f91a4 (patch)
tree83e88dd3e92d7be5434f0f2386a72d4755694009
parente9af29ba8328cad918c5146e3cb1be0a72ebd791 (diff)
merge duplicate code
Change-Id: Iac8f5e9596300bbaaa4b2ce6c6fc4d11793745a5
-rw-r--r--include/vcl/opengl/OpenGLContext.hxx1
-rw-r--r--vcl/source/opengl/OpenGLContext.cxx34
2 files changed, 14 insertions, 21 deletions
diff --git a/include/vcl/opengl/OpenGLContext.hxx b/include/vcl/opengl/OpenGLContext.hxx
index 723a99404ef8..1ca86c7acb61 100644
--- a/include/vcl/opengl/OpenGLContext.hxx
+++ b/include/vcl/opengl/OpenGLContext.hxx
@@ -220,6 +220,7 @@ private:
SAL_DLLPRIVATE void InitGLEWDebugging();
SAL_DLLPRIVATE bool initWindow();
SAL_DLLPRIVATE bool ImplInit();
+ SAL_DLLPRIVATE void InitChildWindow(SystemChildWindow *pChildWindow);
#if defined( UNX ) && !defined MACOSX && !defined IOS && !defined ANDROID && !defined(LIBO_HEADLESS)
SAL_DLLPRIVATE void initGLWindow(Visual* pVisual);
#endif
diff --git a/vcl/source/opengl/OpenGLContext.cxx b/vcl/source/opengl/OpenGLContext.cxx
index de8c7099ca97..f254974727c9 100644
--- a/vcl/source/opengl/OpenGLContext.cxx
+++ b/vcl/source/opengl/OpenGLContext.cxx
@@ -1092,6 +1092,14 @@ void OpenGLContext::setWinSize(const Size& rSize)
m_aGLWin.Height = rSize.Height();
}
+void OpenGLContext::InitChildWindow(SystemChildWindow *pChildWindow)
+{
+ pChildWindow->SetMouseTransparent(true);
+ pChildWindow->SetParentClipMode(ParentClipMode::Clip);
+ pChildWindow->EnableEraseBackground(false);
+ pChildWindow->SetControlForeground();
+ pChildWindow->SetControlBackground();
+}
#if defined(_WIN32)
@@ -1103,15 +1111,9 @@ bool OpenGLContext::initWindow()
m_pChildWindow = VclPtr<SystemChildWindow>::Create(mpWindow, 0, &winData, false);
}
- if( m_pChildWindow )
+ if (m_pChildWindow)
{
- m_pChildWindow->SetMouseTransparent( true );
- m_pChildWindow->SetParentClipMode(ParentClipMode::Clip);
- m_pChildWindow->EnableEraseBackground( false );
- m_pChildWindow->SetControlForeground();
- m_pChildWindow->SetControlBackground();
- //m_pChildWindow->EnablePaint(false);
-
+ InitChildWindow(m_pChildWindow.get());
const SystemEnvData* sysData(m_pChildWindow->GetSystemData());
m_aGLWin.hWnd = sysData->hWnd;
}
@@ -1130,15 +1132,9 @@ bool OpenGLContext::initWindow()
m_pChildWindow = VclPtr<SystemChildWindow>::Create(mpWindow, 0, &winData, false);
}
- if( m_pChildWindow )
+ if (m_pChildWindow)
{
- m_pChildWindow->SetMouseTransparent( true );
- m_pChildWindow->SetParentClipMode(ParentClipMode::Clip);
- m_pChildWindow->EnableEraseBackground( false );
- m_pChildWindow->SetControlForeground();
- m_pChildWindow->SetControlBackground();
- //m_pChildWindow->EnablePaint(false);
-
+ InitChildWindow(m_pChildWindow.get());
}
return true;
@@ -1169,11 +1165,7 @@ bool OpenGLContext::initWindow()
if (!m_pChildWindow || !pChildSysData)
return false;
- m_pChildWindow->SetMouseTransparent( true );
- m_pChildWindow->SetParentClipMode( ParentClipMode::NoClip );
- m_pChildWindow->EnableEraseBackground( false );
- m_pChildWindow->SetControlForeground();
- m_pChildWindow->SetControlBackground();
+ InitChildWindow(m_pChildWindow.get());
m_aGLWin.dpy = static_cast<Display*>(pChildSysData->pDisplay);
m_aGLWin.win = pChildSysData->aWindow;