From dc4b01a5a937565b1d6491850c922e1b7de0e949 Mon Sep 17 00:00:00 2001 From: Markus Mohrhard Date: Tue, 7 Jun 2016 16:11:02 +0200 Subject: only init the OpenGL context if we need it Reviewed-on: https://gerrit.libreoffice.org/26023 Tested-by: Jenkins Reviewed-by: Markus Mohrhard (cherry picked from commit 78b100ec9cb0db2f7b33ece5ad3287a67a37246f) we also need to set initialized falg for deferred initialization Change-Id: Ia88a1720d204b9933f1476bd703b99180e45abde Reviewed-on: https://gerrit.libreoffice.org/26031 Reviewed-by: Tor Lillqvist Tested-by: Tor Lillqvist --- include/vcl/openglwin.hxx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/vcl/openglwin.hxx b/include/vcl/openglwin.hxx index 6b2e58dd5c40..cac81a6968ea 100644 --- a/include/vcl/openglwin.hxx +++ b/include/vcl/openglwin.hxx @@ -33,7 +33,7 @@ public: class VCL_DLLPUBLIC OpenGLWindow : public vcl::Window { public: - OpenGLWindow(vcl::Window* pParent); + OpenGLWindow(vcl::Window* pParent, bool bInit = true); virtual ~OpenGLWindow(); virtual void dispose() override; @@ -48,6 +48,10 @@ public: virtual void MouseMove( const MouseEvent& rMEvt ) override; virtual void Command( const CommandEvent& rCEvt ) override; + bool IsInitialized() const; + + void Initialize(); + private: std::unique_ptr mxImpl; IRenderer* mpRenderer; -- cgit