diff options
Diffstat (limited to 'chart2')
-rw-r--r-- | chart2/Package_opengl.mk | 2 | ||||
-rw-r--r-- | chart2/source/view/charttypes/GL3DBarChart.cxx | 19 | ||||
-rw-r--r-- | chart2/source/view/inc/GL3DBarChart.hxx | 2 | ||||
-rw-r--r-- | chart2/source/view/inc/GL3DRenderer.hxx | 6 | ||||
-rw-r--r-- | chart2/source/view/main/GL3DRenderer.cxx | 18 |
5 files changed, 43 insertions, 4 deletions
diff --git a/chart2/Package_opengl.mk b/chart2/Package_opengl.mk index 6e1e298af669..820cf35fc693 100644 --- a/chart2/Package_opengl.mk +++ b/chart2/Package_opengl.mk @@ -34,6 +34,8 @@ $(eval $(call gb_Package_add_files,chart2_opengl_shader,$(LIBO_BIN_FOLDER)/openg shape3DVertexShaderV300.glsl \ textFragmentShaderBatch.glsl \ textVertexShaderBatch.glsl \ + shape3DFragmentShaderBatchScroll.glsl \ + shape3DVertexShaderBatchScroll.glsl \ )) # vim: set noet sw=4 ts=4: diff --git a/chart2/source/view/charttypes/GL3DBarChart.cxx b/chart2/source/view/charttypes/GL3DBarChart.cxx index 5cba5177ebae..47706aed9bb1 100644 --- a/chart2/source/view/charttypes/GL3DBarChart.cxx +++ b/chart2/source/view/charttypes/GL3DBarChart.cxx @@ -350,7 +350,7 @@ void RenderBenchMarkThread::UpdateFPS() osl_getSystemTime(&mafpsRenderStartTime); } osl_getSystemTime(&mafpsRenderEndTime); -#if 0 +#if 1 opengl3D::ScreenText tFPS(mpChart->mpRenderer.get(), *(mpChart->mpTextCache), mpChart->mTestString, 0); opengl3D::TextCacheItem tmpTextCache = mpChart->mpTextCache->getText(mpChart->mTestString); #else @@ -414,8 +414,23 @@ GL3DBarChart::GL3DBarChart( mbNeedsNewRender(true), mbCameraInit(false), mbRenderDie(false), - maRenderEvent(EVENT_NONE) + maRenderEvent(EVENT_NONE), + miScrollRate(0), + mbScrollFlg(false) { + if (BENCH_MARK_MODE) + { + char *scrollFrame = getenv("SCROLL_RATE"); + if (scrollFrame) + { + miScrollRate = atoi(scrollFrame); + if (miScrollRate > 0) + { + mbScrollFlg = true; + mpRenderer->SetScroll(); + } + } + } Size aSize = mrWindow.GetSizePixel(); mpRenderer->SetSize(aSize); mrWindow.setRenderer(this); diff --git a/chart2/source/view/inc/GL3DBarChart.hxx b/chart2/source/view/inc/GL3DBarChart.hxx index 38be7bdf5b37..a4a92a4d680c 100644 --- a/chart2/source/view/inc/GL3DBarChart.hxx +++ b/chart2/source/view/inc/GL3DBarChart.hxx @@ -138,6 +138,8 @@ private: sal_uInt32 mSelectBarId; Point maClickPos; OUString mTestString; + sal_uInt32 miScrollRate; + bool mbScrollFlg; }; } diff --git a/chart2/source/view/inc/GL3DRenderer.hxx b/chart2/source/view/inc/GL3DRenderer.hxx index 9ada8f8ebccc..a82b1bf0cf7f 100644 --- a/chart2/source/view/inc/GL3DRenderer.hxx +++ b/chart2/source/view/inc/GL3DRenderer.hxx @@ -209,6 +209,7 @@ public: void ReleaseTextTexture(); void StartClick(sal_uInt32 &selectID); void EndClick(); + void SetScroll(); private: void MoveModelf( const PosVecf3& trans, const PosVecf3& angle, const PosVecf3& scale); @@ -275,6 +276,7 @@ private: struct ShaderResources { bool m_b330Support; + bool m_bScrollFlag; // 3DProID GLint m_3DProID; GLint m_3DProjectionID; @@ -324,6 +326,10 @@ private: GLint m_3DBatchVertexID; GLint m_3DBatchNormalID; GLint m_3DBatchColorID; + GLint m_3DBatchTransMatrixID; + GLint m_3DBatchMinCoordXID; + GLint m_3DBatchMaxCoordXID; + GLint m_3DBatchUndrawID; //Batch render text bool mbTexBatchSupport; diff --git a/chart2/source/view/main/GL3DRenderer.cxx b/chart2/source/view/main/GL3DRenderer.cxx index e6f5e95d9d72..20b88a7eef85 100644 --- a/chart2/source/view/main/GL3DRenderer.cxx +++ b/chart2/source/view/main/GL3DRenderer.cxx @@ -200,6 +200,7 @@ OpenGL3DRenderer::ShaderResources::ShaderResources() , m_BatchTextVertexID(0) , m_BatchTextTexCoordID(0) , m_BatchTextTexID(0) + , m_bScrollFlag(false) { } @@ -230,8 +231,16 @@ void OpenGL3DRenderer::ShaderResources::LoadShaders() m_3DNormalMatrixID = glGetUniformLocation(m_3DProID, "normalMatrix"); m_3DVertexID = glGetAttribLocation(m_3DProID, "vertexPositionModelspace"); m_3DNormalID = glGetAttribLocation(m_3DProID, "vertexNormalModelspace"); - - m_3DBatchProID = OpenGLHelper::LoadShaders("shape3DVertexShaderBatch", "shape3DFragmentShaderBatch"); + if (m_bScrollFlag) + { + m_3DBatchProID = OpenGLHelper::LoadShaders("shape3DVertexShaderBatchScroll", "shape3DFragmentShaderBatchScroll"); + m_3DBatchTransMatrixID = glGetUniformLocation(m_3DBatchProID, "transMatrix"); + m_3DBatchMinCoordXID = glGetUniformLocation(m_3DBatchProID, "minCoordX"); + m_3DBatchMaxCoordXID = glGetUniformLocation(m_3DBatchProID, "maxCoordX"); + m_3DBatchUndrawID = glGetUniformLocation(m_3DBatchProID, "undraw"); + } + else + m_3DBatchProID = OpenGLHelper::LoadShaders("shape3DVertexShaderBatch", "shape3DFragmentShaderBatch"); m_3DBatchProjectionID = glGetUniformLocation(m_3DBatchProID, "P"); m_3DBatchViewID = glGetUniformLocation(m_3DBatchProID, "V"); m_3DBatchModelID = glGetAttribLocation(m_3DBatchProID, "M"); @@ -2267,6 +2276,11 @@ void OpenGL3DRenderer::EndClick() } } +void OpenGL3DRenderer::SetScroll() +{ + maResources.m_bScrollFlag = true; +} + void OpenGL3DRenderer::RenderBatchBars(bool bNewScene) { if(bNewScene) |