diff options
author | Michael Meeks <michael.meeks@collabora.com> | 2015-09-08 11:46:13 +0100 |
---|---|---|
committer | Michael Meeks <michael.meeks@collabora.com> | 2015-09-08 13:04:02 +0100 |
commit | 56900a441de1d4cc896ad1e36a44622ed1598fad (patch) | |
tree | ae176203c003dce23d188dbd198359da802d728f /vcl/source/window | |
parent | 2456cf8306be22e32130e789ab939c059e5e79e5 (diff) |
tdf#94006 - fix OpenGLContext mis-use in several places.
gltf rendering, OpenGL canvas, GL transitions & GL capable (charts)
Avoid GLX operations on un-initialized contexts.
Change-Id: I7f523640f66ab656896181e5c865879234f6640e
Diffstat (limited to 'vcl/source/window')
-rw-r--r-- | vcl/source/window/openglwin.cxx | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/vcl/source/window/openglwin.cxx b/vcl/source/window/openglwin.cxx index 46628c6d7929..e07937538d7c 100644 --- a/vcl/source/window/openglwin.cxx +++ b/vcl/source/window/openglwin.cxx @@ -17,18 +17,19 @@ class OpenGLWindowImpl public: explicit OpenGLWindowImpl(vcl::Window* pWindow); ~OpenGLWindowImpl() { mxChildWindow.disposeAndClear(); } - OpenGLContext& getContext() { return maContext;} + OpenGLContext& getContext() { return *mxContext.get(); } private: - OpenGLContext maContext; + rtl::Reference<OpenGLContext> mxContext; VclPtr<SystemChildWindow> mxChildWindow; }; OpenGLWindowImpl::OpenGLWindowImpl(vcl::Window* pWindow) + : mxContext(OpenGLContext::Create()) { SystemWindowData aData = OpenGLContext::generateWinData(pWindow, false); mxChildWindow.reset(VclPtr<SystemChildWindow>::Create(pWindow, 0, &aData)); mxChildWindow->Show(); - maContext.init(mxChildWindow.get()); + mxContext->init(mxChildWindow.get()); pWindow->SetMouseTransparent(false); } |