diff options
author | Tor Lillqvist <tml@collabora.com> | 2016-01-26 11:17:57 +0200 |
---|---|---|
committer | Tor Lillqvist <tml@collabora.com> | 2016-01-26 11:43:50 +0200 |
commit | 2c55288357c9d5410afae58c1fbb97cdfabf0360 (patch) | |
tree | 5cd0ab352add75f31bb5d7eadf05e5257ed3d424 /vcl/source/opengl | |
parent | 7c151f39144b7401a99c7b736a41e5dce4ac4db1 (diff) |
Add API to get the number of OpenGL buffer swaps, including through UNO
Change-Id: Iff29ac615ad4b6516790b1cbbde0215a3cd0efe6
Diffstat (limited to 'vcl/source/opengl')
-rw-r--r-- | vcl/source/opengl/OpenGLContext.cxx | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/vcl/source/opengl/OpenGLContext.cxx b/vcl/source/opengl/OpenGLContext.cxx index f409bec72d01..a1296a99ae97 100644 --- a/vcl/source/opengl/OpenGLContext.cxx +++ b/vcl/source/opengl/OpenGLContext.cxx @@ -50,6 +50,8 @@ static std::vector<GLXContext> g_vShareList; static std::vector<HGLRC> g_vShareList; #endif +sal_Int64 OpenGLContext::mnBufferSwapCounter = 0; + GLWindow::~GLWindow() { #if defined( UNX ) && !defined MACOSX && !defined IOS && !defined ANDROID && !defined(LIBO_HEADLESS) @@ -1535,6 +1537,8 @@ void OpenGLContext::swapBuffers() glXSwapBuffers(m_aGLWin.dpy, m_aGLWin.win); #endif + mnBufferSwapCounter++; + static bool bSleep = getenv("SAL_GL_SLEEP_ON_SWAP"); if (bSleep) { @@ -1544,6 +1548,11 @@ void OpenGLContext::swapBuffers() } } +sal_Int64 OpenGLContext::getBufferSwapCounter() +{ + return mnBufferSwapCounter; +} + void OpenGLContext::sync() { OpenGLZone aZone; |