diff --git a/chart2/source/view/charttypes/GL3DBarChart.cxx b/chart2/source/view/charttypes/GL3DBarChart.cxx index 8ce235fb9dae..540615b44f7c 100644 --- a/chart2/source/view/charttypes/GL3DBarChart.cxx +++ b/chart2/source/view/charttypes/GL3DBarChart.cxx @@ -407,6 +407,7 @@ void GL3DBarChart::update() Size aSize = mrWindow.GetSizePixel(); mrWindow.getContext().setWinSize(aSize); mpRenderThread = rtl::Reference(new RenderOneFrameThread(this)); + mrWindow.getContext().resetCurrent(); mpRenderThread->launch(); } @@ -441,6 +442,7 @@ void GL3DBarChart::moveToDefault() Size aSize = mrWindow.GetSizePixel(); mrWindow.getContext().setWinSize(aSize); mpRenderThread = rtl::Reference(new RenderAnimationThread(this, maCameraPosition, maDefaultCameraPosition, STEPS)); + mrWindow.getContext().resetCurrent(); mpRenderThread->launch(); /* @@ -498,6 +500,7 @@ void GL3DBarChart::clickedAt(const Point& rPos, sal_uInt16 nButtons) Size aSize = mrWindow.GetSizePixel(); mrWindow.getContext().setWinSize(aSize); mpRenderThread = rtl::Reference(new RenderAnimationThread(this, maCameraPosition, maTargetPosition, STEPS)); + mrWindow.getContext().resetCurrent(); mpRenderThread->launch(); /* @@ -579,6 +582,7 @@ void GL3DBarChart::moveToCorner() mrWindow.getContext().setWinSize(aSize); mpRenderThread = rtl::Reference(new RenderAnimationThread(this, getCornerPosition(mnCornerId), maCameraPosition, STEPS)); + mrWindow.getContext().resetCurrent(); mpRenderThread->launch(); // TODO: moggi: add to thread diff --git a/include/vcl/opengl/OpenGLContext.hxx b/include/vcl/opengl/OpenGLContext.hxx index 1e6f13ed3bae..94c70f30c2e1 100644 --- a/include/vcl/opengl/OpenGLContext.hxx +++ b/include/vcl/opengl/OpenGLContext.hxx @@ -151,6 +151,7 @@ public: bool init(SystemChildWindow* pChildWindow); void makeCurrent(); + void resetCurrent(); void swapBuffers(); void sync(); void show(); diff --git a/vcl/source/opengl/OpenGLContext.cxx b/vcl/source/opengl/OpenGLContext.cxx index 48eb267aa404..dedd5b4953ae 100644 --- a/vcl/source/opengl/OpenGLContext.cxx +++ b/vcl/source/opengl/OpenGLContext.cxx @@ -800,6 +800,17 @@ void OpenGLContext::makeCurrent() #endif } +void OpenGLContext::resetCurrent() +{ +#if defined( WNT ) + wglMakeCurrent( m_aGLWin.hDC, 0 ); +#elif defined( MACOSX ) || defined( IOS ) || defined( ANDROID ) + // nothing +#elif defined( UNX ) + glXMakeCurrent(m_aGLWin.dpy, None, NULL); +#endif +} + void OpenGLContext::swapBuffers() { #if defined( WNT )