diff options
author | Markus Mohrhard <markus.mohrhard@collabora.co.uk> | 2014-04-15 01:42:42 +0200 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@collabora.co.uk> | 2014-04-15 01:51:29 +0200 |
commit | 2be4ee667237a688a863d446d32b74189f796c0b (patch) | |
tree | 8bc07f9ac4905fcce2dde34ddf71e2dd9d621353 | |
parent | 34bd4798c56b5ad84450593f150ce97d912e6a2f (diff) |
don't try to init OpenGLRender in the constructor
wait until the context has been created and we can actually render
Change-Id: I841d64ae847a2fdc74954887d3a6fcfcd06fc6a3
-rw-r--r-- | chart2/source/view/main/DummyXShape.cxx | 10 | ||||
-rw-r--r-- | chart2/source/view/main/DummyXShape.hxx | 2 |
2 files changed, 10 insertions, 2 deletions
diff --git a/chart2/source/view/main/DummyXShape.cxx b/chart2/source/view/main/DummyXShape.cxx index 5a0f88eaabb3..dc22de2da6f6 100644 --- a/chart2/source/view/main/DummyXShape.cxx +++ b/chart2/source/view/main/DummyXShape.cxx @@ -1143,11 +1143,11 @@ void DummyXShapes::render() } DummyChart::DummyChart(uno::Reference< drawing::XShape > xTarget): - m_GLRender(xTarget) + m_GLRender(xTarget), + mbNotInit(true) { SAL_INFO("chart2.opengl", "DummyXShape::DummyChart()-----test: "); setName("com.sun.star.chart2.shapes"); - m_GLRender.InitOpenGL(); } void SAL_CALL DummyChart::setPosition( const awt::Point& aPosition ) @@ -1173,6 +1173,12 @@ void SAL_CALL DummyChart::setSize( const awt::Size& aSize ) void DummyChart::render() { + if(mbNotInit) + { + m_GLRender.InitOpenGL(); + mbNotInit = false; + } + SAL_INFO("chart2.opengl", "render chart"); m_GLRender.prepareToRender(); #if 0 diff --git a/chart2/source/view/main/DummyXShape.hxx b/chart2/source/view/main/DummyXShape.hxx index b5aeb262e972..0cff72f71d9a 100644 --- a/chart2/source/view/main/DummyXShape.hxx +++ b/chart2/source/view/main/DummyXShape.hxx @@ -407,6 +407,8 @@ private: public: OpenGLRender m_GLRender; + + bool mbNotInit; }; class DummyGroup2D : public DummyXShapes |