fix refresh problem with 2D OpenGL chart and OpenGLWindow
Change-Id: I32f23967a826262051495d57a4dd529ca3694548
This commit is contained in:
parent
dacab84536
commit
389d8e9f52
2 changed files with 46 additions and 0 deletions
|
@ -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;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue