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

Tor Lillqvist tml at collabora.com
Tue Jan 26 02:50:29 PST 2016


 include/vcl/opengl/OpenGLContext.hxx |    5 -----
 include/vcl/openglwin.hxx            |    6 ++++++
 toolkit/source/awt/vclxtoolkit.cxx   |   11 ++---------
 vcl/source/opengl/OpenGLContext.cxx  |    9 +++++----
 4 files changed, 13 insertions(+), 18 deletions(-)

New commits:
commit 32d98b2551644dea50e58f99ae921a82a0f69753
Author: Tor Lillqvist <tml at collabora.com>
Date:   Tue Jan 26 12:31:04 2016 +0200

    Put getBufferSwapCounter() in OpenGLWindow instead
    
    <vcl/openglwin.hxx> is a more light-weight include file and including
    that causes less trouble on the various platforms.
    
    Change-Id: I5c9baa171278d291468ef45a47d9fdbc64326957

diff --git a/include/vcl/opengl/OpenGLContext.hxx b/include/vcl/opengl/OpenGLContext.hxx
index 2b4af08..d5a9e31 100644
--- a/include/vcl/opengl/OpenGLContext.hxx
+++ b/include/vcl/opengl/OpenGLContext.hxx
@@ -186,9 +186,6 @@ public:
     /// reset the GL context so this context is not implicit in subsequent GL calls.
     void resetCurrent();
     void swapBuffers();
-
-    static sal_Int64 getBufferSwapCounter();
-
     void sync();
     void show();
 
@@ -252,8 +249,6 @@ private:
     ProgramCollection maPrograms;
     OpenGLProgram* mpCurrentProgram;
 
-    static sal_Int64 mnBufferSwapCounter;
-
 public:
     vcl::Region maClipRegion;
     int mnPainting;
diff --git a/include/vcl/openglwin.hxx b/include/vcl/openglwin.hxx
index 6b2e58d..9ae5d14 100644
--- a/include/vcl/openglwin.hxx
+++ b/include/vcl/openglwin.hxx
@@ -48,6 +48,12 @@ public:
     virtual void MouseMove( const MouseEvent& rMEvt ) override;
     virtual void Command( const CommandEvent& rCEvt ) override;
 
+    /**
+     * Returns the number of times OpenGL buffers have been swapped.
+     * Not really any good reason why this is in this class, but...
+     */
+    static sal_Int64 getBufferSwapCounter();
+
 private:
     std::unique_ptr<OpenGLWindowImpl> mxImpl;
     IRenderer* mpRenderer;
diff --git a/toolkit/source/awt/vclxtoolkit.cxx b/toolkit/source/awt/vclxtoolkit.cxx
index 7fe5032..0053928 100644
--- a/toolkit/source/awt/vclxtoolkit.cxx
+++ b/toolkit/source/awt/vclxtoolkit.cxx
@@ -22,13 +22,6 @@
 #include <prewin.h>
 #include <postwin.h>
 #endif
-#if defined UNX && !defined MACOSX
-#include <prex.h>
-#include "GL/glxew.h"
-#include <postx.h>
-#undef None // Avoid clash with the one in <toolkit/awt/scrollabledialog.hxx>
-#undef Status // Sigh... used for instance as parameter name in css::awt::XImageConsumer
-#endif
 #include <com/sun/star/awt/WindowAttribute.hpp>
 #include <com/sun/star/awt/VclWindowPeerAttribute.hpp>
 #include <com/sun/star/awt/WindowClass.hpp>
@@ -105,6 +98,7 @@
 #include <vcl/menubtn.hxx>
 #include <vcl/morebtn.hxx>
 #include <vcl/msgbox.hxx>
+#include <vcl/openglwin.hxx>
 #include <vcl/scrbar.hxx>
 #include <vcl/spin.hxx>
 #include <vcl/split.hxx>
@@ -120,7 +114,6 @@
 #include <vcl/window.hxx>
 #include <vcl/wrkwin.hxx>
 #include <vcl/throbber.hxx>
-#include <vcl/opengl/OpenGLContext.hxx>
 #include "toolkit/awt/vclxspinbutton.hxx"
 #include <tools/debug.hxx>
 #include <comphelper/processfactory.hxx>
@@ -1929,7 +1922,7 @@ void SAL_CALL VCLXToolkit::processEventsToIdle()
 sal_Int64 SAL_CALL VCLXToolkit::getOpenGLBufferSwapCounter()
     throw (css::uno::RuntimeException, std::exception)
 {
-     return OpenGLContext::getBufferSwapCounter();
+     return OpenGLWindow::getBufferSwapCounter();
 }
 
 // css:awt:XToolkitRobot
diff --git a/vcl/source/opengl/OpenGLContext.cxx b/vcl/source/opengl/OpenGLContext.cxx
index a1296a9..d6458c8 100644
--- a/vcl/source/opengl/OpenGLContext.cxx
+++ b/vcl/source/opengl/OpenGLContext.cxx
@@ -11,6 +11,7 @@
 
 #include <vcl/opengl/OpenGLContext.hxx>
 #include <vcl/opengl/OpenGLHelper.hxx>
+#include <vcl/openglwin.hxx>
 #include <vcl/syschild.hxx>
 #include <vcl/sysdata.hxx>
 
@@ -50,7 +51,7 @@ static std::vector<GLXContext> g_vShareList;
 static std::vector<HGLRC> g_vShareList;
 #endif
 
-sal_Int64 OpenGLContext::mnBufferSwapCounter = 0;
+static sal_Int64 nBufferSwapCounter = 0;
 
 GLWindow::~GLWindow()
 {
@@ -1537,7 +1538,7 @@ void OpenGLContext::swapBuffers()
     glXSwapBuffers(m_aGLWin.dpy, m_aGLWin.win);
 #endif
 
-    mnBufferSwapCounter++;
+    nBufferSwapCounter++;
 
     static bool bSleep = getenv("SAL_GL_SLEEP_ON_SWAP");
     if (bSleep)
@@ -1548,9 +1549,9 @@ void OpenGLContext::swapBuffers()
     }
 }
 
-sal_Int64 OpenGLContext::getBufferSwapCounter()
+sal_Int64 OpenGLWindow::getBufferSwapCounter()
 {
-    return mnBufferSwapCounter;
+    return nBufferSwapCounter;
 }
 
 void OpenGLContext::sync()


More information about the Libreoffice-commits mailing list