[Libreoffice-commits] core.git: include/vcl vcl/osx vcl/source vcl/unx vcl/win
Michael Meeks
michael.meeks at collabora.com
Wed Aug 26 14:10:48 PDT 2015
include/vcl/opengl/OpenGLHelper.hxx | 3 +++
vcl/osx/salframe.cxx | 5 +++++
vcl/source/opengl/OpenGLHelper.cxx | 9 +++++++++
vcl/unx/generic/window/salframe.cxx | 3 +++
vcl/unx/gtk/window/gtksalframe.cxx | 3 +++
vcl/win/source/window/salframe.cxx | 3 +++
6 files changed, 26 insertions(+)
New commits:
commit e16e64dd862c8f386f80de43ad68e831e169d49d
Author: Michael Meeks <michael.meeks at collabora.com>
Date: Wed Aug 26 17:17:19 2015 +0100
tdf#93530 - the VCL GDI flushing abstraction should glFlush too.
Change-Id: I45cb0e62278d8c3154ae8ad54ca4c93b3e177969
Reviewed-on: https://gerrit.libreoffice.org/18030
Reviewed-by: Michael Meeks <michael.meeks at collabora.com>
Tested-by: Michael Meeks <michael.meeks at collabora.com>
diff --git a/include/vcl/opengl/OpenGLHelper.hxx b/include/vcl/opengl/OpenGLHelper.hxx
index 95c23c8..d14df0d 100644
--- a/include/vcl/opengl/OpenGLHelper.hxx
+++ b/include/vcl/opengl/OpenGLHelper.hxx
@@ -67,6 +67,9 @@ public:
*/
static bool isVCLOpenGLEnabled();
+ /// flush the OpenGL command queue - if OpenGL is enabled.
+ static void flush();
+
#if defined UNX && !defined MACOSX && !defined IOS && !defined ANDROID && !defined(LIBO_HEADLESS)
static bool GetVisualInfo(Display* pDisplay, int nScreen, XVisualInfo& rVI);
static GLXFBConfig GetPixmapFBConfig( Display* pDisplay, bool& bInverted );
diff --git a/vcl/osx/salframe.cxx b/vcl/osx/salframe.cxx
index 3882c40..8f5fbfd 100644
--- a/vcl/osx/salframe.cxx
+++ b/vcl/osx/salframe.cxx
@@ -28,6 +28,7 @@
#include "vcl/window.hxx"
#include "vcl/syswin.hxx"
#include <vcl/settings.hxx>
+#include <vcl/opengl/OpenGLHelper.hxx>
#include "osx/saldata.hxx"
#include "quartz/salgdi.h"
@@ -38,6 +39,7 @@
#include "osx/a11yfactory.h"
#include "quartz/utils.h"
+
#include "salwtype.hxx"
#include "premac.h"
@@ -881,6 +883,7 @@ void AquaSalFrame::Flush()
{
[mpNSView display];
}
+ OpenGLHelper::flush();
}
void AquaSalFrame::Flush( const Rectangle& rRect )
@@ -902,6 +905,7 @@ void AquaSalFrame::Flush( const Rectangle& rRect )
{
[mpNSView display];
}
+ OpenGLHelper::flush();
}
void AquaSalFrame::Sync()
@@ -914,6 +918,7 @@ void AquaSalFrame::Sync()
[mpNSView setNeedsDisplay: YES];
[mpNSView display];
}
+ OpenGLHelper::flush();
}
void AquaSalFrame::SetInputContext( SalInputContext* pContext )
diff --git a/vcl/source/opengl/OpenGLHelper.cxx b/vcl/source/opengl/OpenGLHelper.cxx
index 2e68bdc..717a7ba 100644
--- a/vcl/source/opengl/OpenGLHelper.cxx
+++ b/vcl/source/opengl/OpenGLHelper.cxx
@@ -705,4 +705,13 @@ GLXFBConfig OpenGLHelper::GetPixmapFBConfig( Display* pDisplay, bool& bInverted
#endif
+void OpenGLHelper::flush()
+{
+ if (!isVCLOpenGLEnabled())
+ return;
+
+ glFlush();
+ CHECK_GL_ERROR();
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/unx/generic/window/salframe.cxx b/vcl/unx/generic/window/salframe.cxx
index 8dacdd8..43189003 100644
--- a/vcl/unx/generic/window/salframe.cxx
+++ b/vcl/unx/generic/window/salframe.cxx
@@ -35,6 +35,7 @@
#include "vcl/settings.hxx"
#include "vcl/bmpacc.hxx"
#include "vcl/opengl/OpenGLContext.hxx"
+#include "vcl/opengl/OpenGLHelper.hxx"
#include <prex.h>
#include <X11/Xatom.h>
@@ -2454,11 +2455,13 @@ void X11SalFrame::SetTitle( const OUString& rTitle )
void X11SalFrame::Flush()
{
XFlush( GetDisplay()->GetDisplay() );
+ OpenGLHelper::flush();
}
void X11SalFrame::Sync()
{
XSync( GetDisplay()->GetDisplay(), False );
+ OpenGLHelper::flush();
}
// Keyboard
diff --git a/vcl/unx/gtk/window/gtksalframe.cxx b/vcl/unx/gtk/window/gtksalframe.cxx
index 6bc25f3..b911378 100644
--- a/vcl/unx/gtk/window/gtksalframe.cxx
+++ b/vcl/unx/gtk/window/gtksalframe.cxx
@@ -37,6 +37,7 @@
#include <vcl/svapp.hxx>
#include <vcl/window.hxx>
#include <vcl/settings.hxx>
+#include <vcl/opengl/OpenGLHelper.hxx>
#if !GTK_CHECK_VERSION(3,0,0)
# include <unx/x11/xlimits.hxx>
@@ -2934,11 +2935,13 @@ void GtkSalFrame::Flush()
#else
XFlush (GDK_DISPLAY_XDISPLAY (getGdkDisplay()));
#endif
+ OpenGLHelper::flush();
}
void GtkSalFrame::Sync()
{
gdk_display_sync( getGdkDisplay() );
+ OpenGLHelper::flush();
}
#ifndef GDK_Open
diff --git a/vcl/win/source/window/salframe.cxx b/vcl/win/source/window/salframe.cxx
index 4268173..8dc8076 100644
--- a/vcl/win/source/window/salframe.cxx
+++ b/vcl/win/source/window/salframe.cxx
@@ -46,6 +46,7 @@
#include <vcl/window.hxx>
#include <vcl/wrkwin.hxx>
#include <vcl/svapp.hxx>
+#include <vcl/opengl/OpenGLHelper.hxx>
// Warning in SDK header
#ifdef _MSC_VER
@@ -2201,11 +2202,13 @@ void WinSalFrame::SetPointerPos( long nX, long nY )
void WinSalFrame::Flush()
{
GdiFlush();
+ OpenGLHelper::flush();
}
void WinSalFrame::Sync()
{
GdiFlush();
+ OpenGLHelper::flush();
}
static void ImplSalFrameSetInputContext( HWND hWnd, const SalInputContext* pContext )
More information about the Libreoffice-commits
mailing list