diff options
author | Markus Mohrhard <markus.mohrhard@collabora.co.uk> | 2014-06-01 19:36:39 +0200 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@collabora.co.uk> | 2014-06-04 07:49:12 +0200 |
commit | 389d8e9f5232501ac782562ba7c07c052f19766d (patch) | |
tree | e27b6f67d9c4f60472da50e53df01fff57883d6f | |
parent | dacab84536f61f79a5422e1d8d394019ec62f3ec (diff) |
fix refresh problem with 2D OpenGL chart and OpenGLWindow
Change-Id: I32f23967a826262051495d57a4dd529ca3694548
-rw-r--r-- | chart2/inc/ChartView.hxx | 3 | ||||
-rw-r--r-- | chart2/source/view/main/ChartView.cxx | 43 |
2 files changed, 46 insertions, 0 deletions
diff --git a/chart2/inc/ChartView.hxx b/chart2/inc/ChartView.hxx index ab552f9fa250..d69aa9f86225 100644 --- a/chart2/inc/ChartView.hxx +++ b/chart2/inc/ChartView.hxx @@ -55,6 +55,7 @@ class DrawModelWrapper; class SeriesPlotterContainer; class VDataSeries; class GL3DPlotterBase; +class GL2DRenderer; enum TimeBasedMode { @@ -103,6 +104,7 @@ class ChartView : public ::cppu::WeakImplHelper10< , public ExplicitValueProvider , private SfxListener { + friend class GL2DRenderer; private: void init(); @@ -277,6 +279,7 @@ private: //member boost::shared_ptr<GL3DPlotterBase> m_pGL3DPlotter; TimeBasedInfo maTimeBased; osl::Mutex maTimeMutex; + boost::scoped_ptr<GL2DRenderer> mp2DRenderer; }; } diff --git a/chart2/source/view/main/ChartView.cxx b/chart2/source/view/main/ChartView.cxx index f9b7d70401a7..5a2b3e424cdb 100644 --- a/chart2/source/view/main/ChartView.cxx +++ b/chart2/source/view/main/ChartView.cxx @@ -154,6 +154,46 @@ void debugGL3DOutput( ChartModel& rModel ) } +class GL2DRenderer : public IRenderer +{ +public: + GL2DRenderer(ChartView* pView); + + virtual void update() SAL_OVERRIDE; + virtual void clickedAt(const Point& rPos, sal_uInt16 nButton) SAL_OVERRIDE; + virtual void mouseDragMove(const Point& rBegin, const Point& rEnd, sal_uInt16 nButton) SAL_OVERRIDE; + virtual void scroll(long nDelta) SAL_OVERRIDE; + virtual void contextDestroyed() SAL_OVERRIDE; +private: + ChartView* mpView; +}; + +GL2DRenderer::GL2DRenderer(ChartView* pView): + mpView(pView) +{ +} + +void GL2DRenderer::update() +{ + mpView->render(); +} + +void GL2DRenderer::clickedAt(const Point&, sal_uInt16 ) +{ +} + +void GL2DRenderer::mouseDragMove(const Point& , const Point& , sal_uInt16 ) +{ +} + +void GL2DRenderer::scroll(long ) +{ +} + +void GL2DRenderer::contextDestroyed() +{ +} + const uno::Sequence<sal_Int8>& ExplicitValueProvider::getUnoTunnelId() { return theExplicitValueProviderUnoTunnelId::get().getSeq(); @@ -195,6 +235,7 @@ ChartView::ChartView( , m_nScaleYDenominator(1) , m_bSdrViewIsInEditMode(false) , m_aResultingDiagramRectangleExcludingAxes(0,0,0,0) + , mp2DRenderer(new GL2DRenderer(this)) { init(); } @@ -2674,6 +2715,8 @@ void ChartView::render() { AbstractShapeFactory* pShapeFactory = AbstractShapeFactory::getOrCreateShapeFactory(m_xShapeFactory); OpenGLWindow* pWindow = mrChartModel.getOpenGLWindow(); + if(pWindow) + pWindow->setRenderer(mp2DRenderer.get()); bool bRender = pShapeFactory->preRender(pWindow); if(bRender) { |