summaryrefslogtreecommitdiff
path: root/slideshow
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2016-05-20 09:41:18 +0100
committerCaolán McNamara <caolanm@redhat.com>2016-05-21 10:04:15 +0100
commitb8d163f4334424e78290eae49713e6ba2405b30f (patch)
tree55e78506accb6fe4dbbc1ecb918e4ccc2f510254 /slideshow
parentda03b62bb4d44ad1410a4dff15f97bacd55fb99b (diff)
Split OpenGLContext up into SalInstance specific classes
which, at least theoretically, allows there to be vclplug specific ones. i.e. a gtk3 specific one which doesn't assume gtk3 is running under X Change-Id: I6c007a87abbd3049b6fffc70d349e3b7ac445eec
Diffstat (limited to 'slideshow')
-rw-r--r--slideshow/source/engine/OGLTrans/generic/OGLTrans_TransitionerImpl.cxx28
-rw-r--r--slideshow/source/engine/shapes/viewmediashape.cxx2
2 files changed, 8 insertions, 22 deletions
diff --git a/slideshow/source/engine/OGLTrans/generic/OGLTrans_TransitionerImpl.cxx b/slideshow/source/engine/OGLTrans/generic/OGLTrans_TransitionerImpl.cxx
index 5ba940fa1c90..fa4df10f6a80 100644
--- a/slideshow/source/engine/OGLTrans/generic/OGLTrans_TransitionerImpl.cxx
+++ b/slideshow/source/engine/OGLTrans/generic/OGLTrans_TransitionerImpl.cxx
@@ -67,11 +67,6 @@
#include "OGLTrans_TransitionImpl.hxx"
-#if defined( UNX ) && !defined( MACOSX )
- #include <X11/keysym.h>
- #include <X11/X.h>
-#endif
-
#include <vcl/sysdata.hxx>
#if OSL_DEBUG_LEVEL > 0
@@ -257,9 +252,7 @@ private:
bool mbFreeLeavingPixmap;
bool mbFreeEnteringPixmap;
#endif
-#if defined( UNX ) && !defined( MACOSX )
bool mbRestoreSync;
-#endif
bool mbUseLeavingPixmap;
bool mbUseEnteringPixmap;
@@ -437,10 +430,9 @@ void OGLTransitionerImpl::impl_prepareSlides()
mbUseLeavingPixmap = false;
mbUseEnteringPixmap = false;
-#if defined( GLX_EXT_texture_from_pixmap )
-
const GLWindow& rGLWindow(mpContext->getOpenGLWindow());
+#if defined( GLX_EXT_texture_from_pixmap )
if( GLXEW_EXT_texture_from_pixmap && xLeavingSet.is() && xEnteringSet.is() && mbHasTFPVisual ) {
Sequence< Any > leaveArgs;
Sequence< Any > enterArgs;
@@ -509,8 +501,8 @@ void OGLTransitionerImpl::impl_prepareSlides()
XSetErrorHandler( oldHandler );
}
}
-
#endif
+
if( !mbUseLeavingPixmap )
maLeavingBytes = mxLeavingBitmap->getData(maSlideBitmapLayout, aSlideRect);
if( !mbUseEnteringPixmap )
@@ -524,13 +516,11 @@ void OGLTransitionerImpl::impl_prepareSlides()
mpContext->sync();
CHECK_GL_ERROR();
-#if defined( UNX ) && !defined( MACOSX )
+
// synchronized X still gives us much smoother play
// I suspect some issues in above code in slideshow
// synchronize whole transition for now
- XSynchronize( rGLWindow.dpy, true );
- mbRestoreSync = true;
-#endif
+ mbRestoreSync = rGLWindow.Synchronize(true);
}
bool OGLTransitionerImpl::impl_prepareTransition()
@@ -1326,13 +1316,11 @@ void OGLTransitionerImpl::disposing()
}
#endif
-#if defined( UNX ) && !defined( MACOSX )
- if( mbRestoreSync && bool(mpContext.is()) ) {
+ if (mbRestoreSync && bool(mpContext.is())) {
// try to reestablish synchronize state
- char* sal_synchronize = getenv("SAL_SYNCHRONIZE");
- XSynchronize( mpContext->getOpenGLWindow().dpy, sal_synchronize && *sal_synchronize == '1' );
+ const char* sal_synchronize = getenv("SAL_SYNCHRONIZE");
+ mpContext->getOpenGLWindow().Synchronize(sal_synchronize && *sal_synchronize == '1' );
}
-#endif
impl_dispose();
@@ -1359,9 +1347,7 @@ OGLTransitionerImpl::OGLTransitionerImpl()
, mbFreeLeavingPixmap(false)
, mbFreeEnteringPixmap(false)
#endif
-#if defined( UNX ) && !defined( MACOSX )
, mbRestoreSync(false)
-#endif
, mbUseLeavingPixmap(false)
, mbUseEnteringPixmap(false)
, maSlideBitmapLayout()
diff --git a/slideshow/source/engine/shapes/viewmediashape.cxx b/slideshow/source/engine/shapes/viewmediashape.cxx
index e0c30a27b139..0db3ea64f91d 100644
--- a/slideshow/source/engine/shapes/viewmediashape.cxx
+++ b/slideshow/source/engine/shapes/viewmediashape.cxx
@@ -463,7 +463,7 @@ namespace slideshow
Size( aAWTRect.Width, aAWTRect.Height ) );
mpEventHandlerParent->EnablePaint(false);
mpEventHandlerParent->Show();
- SystemWindowData aWinData = OpenGLContext::generateWinData(mpEventHandlerParent.get(), false);
+ SystemWindowData aWinData = OpenGLContext::Create()->generateWinData(mpEventHandlerParent.get(), false);
mpMediaWindow = VclPtr<SystemChildWindow>::Create(mpEventHandlerParent.get(), 0, &aWinData);
mpMediaWindow->SetPosSizePixel( Point( 0, 0 ),
Size( aAWTRect.Width, aAWTRect.Height ) );