summaryrefslogtreecommitdiff
path: root/chart2
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@collabora.co.uk>2014-05-28 19:11:47 +0200
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2014-05-28 19:17:54 +0200
commita8b7fcf34914df128e9664bbd70dc269c7cf32cb (patch)
treef247632839e8f16fdd54341da69aaf5a73d6c5d7 /chart2
parenta45b16602f4d167d1cccfa285dd0c49a6c9d7c45 (diff)
prevent generating repeated information in rendering
Change-Id: I1cc5453af6cabe7736cc43e13aad280aaf2c62f6
Diffstat (limited to 'chart2')
-rw-r--r--chart2/source/view/charttypes/GL3DBarChart.cxx2
-rw-r--r--chart2/source/view/inc/GL3DRenderer.hxx4
-rw-r--r--chart2/source/view/main/GL3DRenderer.cxx9
3 files changed, 8 insertions, 7 deletions
diff --git a/chart2/source/view/charttypes/GL3DBarChart.cxx b/chart2/source/view/charttypes/GL3DBarChart.cxx
index bc1caee7a815..b129b9f07786 100644
--- a/chart2/source/view/charttypes/GL3DBarChart.cxx
+++ b/chart2/source/view/charttypes/GL3DBarChart.cxx
@@ -296,8 +296,8 @@ void GL3DBarChart::render()
{
mpCamera->render();
}
+ mpRenderer->ProcessUnrenderedShape(mbNeedsNewRender);
mbNeedsNewRender = false;
- mpRenderer->ProcessUnrenderedShape();
mrWindow.getContext()->swapBuffers();
}
diff --git a/chart2/source/view/inc/GL3DRenderer.hxx b/chart2/source/view/inc/GL3DRenderer.hxx
index 4e85568315eb..20fbca98f152 100644
--- a/chart2/source/view/inc/GL3DRenderer.hxx
+++ b/chart2/source/view/inc/GL3DRenderer.hxx
@@ -179,7 +179,7 @@ public:
glm::vec2 vTopLeft, glm::vec2 vBottomRight,
sal_uInt32 nUniqueId);
- void ProcessUnrenderedShape();
+ void ProcessUnrenderedShape(bool bNewScene);
void SetPickingMode(bool bPickingMode);
@@ -231,7 +231,7 @@ private:
void GetBatchMiddleInfo(Extrude3DInfo &extrude3D);
void InitBatch3DUniformBlock();
void UpdateBatch3DUniformBlock();
- void RenderBatchBars();
+ void RenderBatchBars(bool bNewScene);
private:
struct ShaderResources
diff --git a/chart2/source/view/main/GL3DRenderer.cxx b/chart2/source/view/main/GL3DRenderer.cxx
index ae987aea490c..aded984a43f8 100644
--- a/chart2/source/view/main/GL3DRenderer.cxx
+++ b/chart2/source/view/main/GL3DRenderer.cxx
@@ -1693,7 +1693,7 @@ void OpenGL3DRenderer::CreateSceneBoxView()
m_CameraInfo.cameraUp);
}
-void OpenGL3DRenderer::ProcessUnrenderedShape()
+void OpenGL3DRenderer::ProcessUnrenderedShape(bool bNewScene)
{
glViewport(0, 0, m_iWidth, m_iHeight);
glClearDepth(1.0f);
@@ -1706,7 +1706,7 @@ void OpenGL3DRenderer::ProcessUnrenderedShape()
if(mbPickingMode)
RenderExtrude3DObject();
else
- RenderBatchBars();
+ RenderBatchBars(bNewScene);
//render text
RenderTextShape();
// render screen text
@@ -1865,9 +1865,10 @@ void OpenGL3DRenderer::GetBatchBarsInfo()
}
}
-void OpenGL3DRenderer::RenderBatchBars()
+void OpenGL3DRenderer::RenderBatchBars(bool bNewScene)
{
- GetBatchBarsInfo();
+ if(bNewScene)
+ GetBatchBarsInfo();
glEnable(GL_DEPTH_TEST);
glEnable(GL_CULL_FACE);
glCullFace(GL_BACK);