[Libreoffice-commits] core.git: include/vcl vcl/source

Caolán McNamara caolanm at redhat.com
Thu May 19 10:15:24 UTC 2016


 include/vcl/opengl/OpenGLContext.hxx |    1 +
 vcl/source/opengl/OpenGLContext.cxx  |   34 +++++++++++++---------------------
 2 files changed, 14 insertions(+), 21 deletions(-)

New commits:
commit 9ae808c190ddf94856cdfa16acef8cdd5d8f91a4
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu May 19 11:14:18 2016 +0100

    merge duplicate code
    
    Change-Id: Iac8f5e9596300bbaaa4b2ce6c6fc4d11793745a5

diff --git a/include/vcl/opengl/OpenGLContext.hxx b/include/vcl/opengl/OpenGLContext.hxx
index 723a994..1ca86c7 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 de8c709..f254974 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;


More information about the Libreoffice-commits mailing list