[Libreoffice-commits] core.git: 10 commits - chart2/source

Markus Mohrhard markus.mohrhard at collabora.co.uk
Wed Aug 27 02:55:58 PDT 2014


 chart2/source/view/charttypes/GL3DBarChart.cxx |  150 ++++++++++++++++---------
 chart2/source/view/inc/3DChartObjects.hxx      |    3 
 chart2/source/view/inc/GL3DBarChart.hxx        |   13 +-
 chart2/source/view/inc/GL3DRenderer.hxx        |    3 
 chart2/source/view/main/3DChartObjects.cxx     |    7 -
 chart2/source/view/main/GL3DRenderer.cxx       |    6 -
 6 files changed, 117 insertions(+), 65 deletions(-)

New commits:
commit 64c187b8628bc103383f3c525d1debef5e32ad2e
Author: Markus Mohrhard <markus.mohrhard at collabora.co.uk>
Date:   Wed Aug 27 11:44:56 2014 +0200

    don't call getenv repeatedly
    
    Change-Id: I90b8e30ffd095cc3fa20938cd15adf4d217bb6e1

diff --git a/chart2/source/view/charttypes/GL3DBarChart.cxx b/chart2/source/view/charttypes/GL3DBarChart.cxx
index bf2a372..e43f90e 100644
--- a/chart2/source/view/charttypes/GL3DBarChart.cxx
+++ b/chart2/source/view/charttypes/GL3DBarChart.cxx
@@ -467,14 +467,14 @@ GL3DBarChart::GL3DBarChart(
     mbBenchMarkMode(false),
     maHistoryCounter(0)
 {
-    char *aBenchMark = getenv("BENCHMARK_MODE");
+    static const char *aBenchMark = getenv("BENCHMARK_MODE");
     if (aBenchMark)
     {
         mbBenchMarkMode = atoi(aBenchMark);
     }
     if (mbBenchMarkMode)
     {
-        char *scrollFrame = getenv("SCROLL_RATE");
+        static const char *scrollFrame = getenv("SCROLL_RATE");
         if (scrollFrame)
         {
             miScrollRate = atoi(scrollFrame);
commit ed48265c56dd7aad075260cdec915d964c406340
Author: weigao <weigao at multicorewareinc.com>
Date:   Wed Aug 27 18:50:41 2014 +0800

    correct the variable name
    
    Change-Id: I053c99c1b544fd64951c42ebe1c232cd1768e79f

diff --git a/chart2/source/view/inc/GL3DRenderer.hxx b/chart2/source/view/inc/GL3DRenderer.hxx
index 3be3771..fe3e96d 100644
--- a/chart2/source/view/inc/GL3DRenderer.hxx
+++ b/chart2/source/view/inc/GL3DRenderer.hxx
@@ -200,7 +200,7 @@ public:
                            sal_uInt32 nUniqueId);
     void CreateScreenTextTexture(const boost::shared_array<sal_uInt8> &bitmapBuf,
                                  ::Size maSizePixels, const glm::vec2& vTopLeft,
-                                 const glm::vec2& vBottomRight, glm::vec3 vPos, glm::vec4 screenTextColor, sal_uInt32 nUniqueId);
+                                 const glm::vec2& vBottomRight, glm::vec3 vPos, glm::vec4 vScreenTextColor, sal_uInt32 nUniqueId);
     void ProcessUnrenderedShape(bool bNewScene);
 
     void SetPickingMode(bool bPickingMode);
diff --git a/chart2/source/view/main/GL3DRenderer.cxx b/chart2/source/view/main/GL3DRenderer.cxx
index 9a2bbf2..3a38cfd 100644
--- a/chart2/source/view/main/GL3DRenderer.cxx
+++ b/chart2/source/view/main/GL3DRenderer.cxx
@@ -1670,7 +1670,7 @@ void OpenGL3DRenderer::RenderExtrude3DObject()
 void OpenGL3DRenderer::CreateScreenTextTexture(
         const boost::shared_array<sal_uInt8> &bitmapBuf,
         ::Size maSizePixels, const glm::vec2& vTopLeft,
-        const glm::vec2& vBottomRight, glm::vec3 vPos, glm::vec4 screenTextColor, sal_uInt32 nUniqueId)
+        const glm::vec2& vBottomRight, glm::vec3 vPos, glm::vec4 vScreenTextColor, sal_uInt32 nUniqueId)
 {
     long bmpWidth = maSizePixels.Width();
     long bmpHeight = maSizePixels.Height();
@@ -1694,7 +1694,7 @@ void OpenGL3DRenderer::CreateScreenTextTexture(
     aTextInfo.vertex[10] = vBottomRight.y;
     aTextInfo.vertex[11] = 0;
     aTextInfo.pos = vPos;
-    aTextInfo.textColor = screenTextColor;
+    aTextInfo.textColor = vScreenTextColor;
 
     CHECK_GL_ERROR();
     glGenTextures(1, &aTextInfo.texture);
commit 155f0b84c18f258ca0a7c94c7d605333c55a2aae
Author: weigao <weigao at multicorewareinc.com>
Date:   Wed Aug 27 18:38:36 2014 +0800

    showing bar info until fly back
    
    Change-Id: Idc13f652d359baf2c91758ee1efd5b908b4b9483

diff --git a/chart2/source/view/charttypes/GL3DBarChart.cxx b/chart2/source/view/charttypes/GL3DBarChart.cxx
index 1c494dd..bf2a372 100644
--- a/chart2/source/view/charttypes/GL3DBarChart.cxx
+++ b/chart2/source/view/charttypes/GL3DBarChart.cxx
@@ -28,7 +28,7 @@
 #define SHAPE_START_ID 10
 #define DATA_UPDATE_TIME 15
 #define FPS_TIME 500
-#define DATAUPDATE_FPS_TIME 500
+#define DATAUPDATE_FPS_TIME 1000
 #define HISTORY_NUM 5
 #define SHOW_VALUE_COUNT 15
 #define SHOW_SCROLL_TEXT_DISTANCE 1000
@@ -241,14 +241,16 @@ void RenderBenchMarkThread::MoveCamera()
         mbAutoFlyExecuting = false;
         if ((mpChart->maRenderEvent == EVENT_CLICK) || (mpChart->maRenderEvent == EVENT_AUTO_FLY))
         {
-            mpChart->mpRenderer->EndClick();
             mbNeedFlyBack = true;
             osl_getSystemTime(&maClickFlyBackStartTime);
             osl_getSystemTime(&maClickFlyBackEndTime);
+            mpChart->maRenderEvent = EVENT_SHOW_SELECT;
         }
         else
+        {
             mbNeedFlyBack = false;
-        mpChart->maRenderEvent = EVENT_NONE;
+            mpChart->maRenderEvent = EVENT_NONE;
+        }
     }
 }
 
@@ -278,19 +280,20 @@ void RenderBenchMarkThread::MoveToBar()
 {
     if (!mbExecuting)
     {
-        mpChart->mpRenderer->EndClick();
         mpChart->mpRenderer->SetPickingMode(true);
         mpChart->mpCamera->render();
         mpChart->mpRenderer->ProcessUnrenderedShape(mpChart->mbNeedsNewRender);
-        mpChart->mSelectBarId = mpChart->mpRenderer->GetPixelColorFromPoint(mpChart->maClickPos.X(), mpChart->maClickPos.Y());
+        mpChart->mnSelectBarId = mpChart->mpRenderer->GetPixelColorFromPoint(mpChart->maClickPos.X(), mpChart->maClickPos.Y());
         mpChart->mpRenderer->SetPickingMode(false);
-        std::map<sal_uInt32, const GL3DBarChart::BarInformation>::const_iterator itr = mpChart->maBarMap.find(mpChart->mSelectBarId);
+        std::map<sal_uInt32, const GL3DBarChart::BarInformation>::const_iterator itr = mpChart->maBarMap.find(mpChart->mnSelectBarId);
         if(itr == mpChart->maBarMap.end())
         {
-            mpChart->maRenderEvent = EVENT_NONE;
+            mpChart->mnSelectBarId = mpChart->mnPreSelectBarId;
+            mpChart->maRenderEvent = mpChart->maPreRenderEvent;
             mpChart->maClickCond.set();
             return;
         }
+        mpChart->mpRenderer->EndClick();
         const GL3DBarChart::BarInformation& rBarInfo = itr->second;
         mnStep = 0;
         mnStepsTotal = STEPS;
@@ -304,7 +307,7 @@ void RenderBenchMarkThread::MoveToBar()
         maStepDirection = (maTargetDirection - mpChart->maCameraDirection)/((float)mnStepsTotal);
         mpChart->maClickCond.set();
         mbExecuting = true;
-        mpChart->mpRenderer->StartClick(mpChart->mSelectBarId);
+        mpChart->mpRenderer->StartClick(mpChart->mnSelectBarId);
     }
     MoveCamera();
 }
@@ -314,7 +317,7 @@ void RenderBenchMarkThread::AutoMoveToBar()
     if (!mbAutoFlyExecuting)
     {
         mpChart->mpRenderer->EndClick();
-        std::map<sal_uInt32, const GL3DBarChart::BarInformation>::const_iterator itr = mpChart->maBarMap.find(mpChart->mnAutoFlyBarID);
+        std::map<sal_uInt32, const GL3DBarChart::BarInformation>::const_iterator itr = mpChart->maBarMap.find(mpChart->mnSelectBarId);
         if(itr == mpChart->maBarMap.end())
         {
             mpChart->maRenderEvent = EVENT_NONE;
@@ -331,7 +334,7 @@ void RenderBenchMarkThread::AutoMoveToBar()
         maTargetDirection.x += BAR_SIZE_X / 2.0f;
         maTargetDirection.y += BAR_SIZE_Y / 2.0f;
         maStepDirection = (maTargetDirection - mpChart->maCameraDirection)/((float)mnStepsTotal);
-        mpChart->mpRenderer->StartClick(mpChart->mnAutoFlyBarID);
+        mpChart->mpRenderer->StartClick(mpChart->mnSelectBarId);
         mbAutoFlyExecuting = true;
     }
     MoveCamera();
@@ -450,7 +453,9 @@ GL3DBarChart::GL3DBarChart(
     mbCameraInit(false),
     mbRenderDie(false),
     maRenderEvent(EVENT_NONE),
-    mSelectBarId(0),
+    maPreRenderEvent(EVENT_NONE),
+    mnSelectBarId(0),
+    mnPreSelectBarId(0),
     miScrollRate(0),
     mbScrollFlg(false),
     mbScreenTextNewRender(false),
@@ -459,7 +464,6 @@ GL3DBarChart::GL3DBarChart(
     miFrameCount(0),
     miDataUpdateCounter(0),
     mnColorRate(0),
-    mnAutoFlyBarID(0),
     mbBenchMarkMode(false),
     maHistoryCounter(0)
 {
@@ -788,7 +792,8 @@ void GL3DBarChart::moveToDefault()
     if(mbBenchMarkMode)
     {
         // add correct handling here!!
-        if ((maRenderEvent != EVENT_NONE) && (maRenderEvent != EVENT_SHOW_SCROLL) && (maRenderEvent != EVENT_AUTO_FLY))
+        if ((maRenderEvent != EVENT_NONE) && (maRenderEvent != EVENT_SHOW_SCROLL) &&
+            (maRenderEvent != EVENT_AUTO_FLY) && (maRenderEvent != EVENT_SHOW_SELECT))
             return;
 
         {
@@ -829,12 +834,15 @@ void GL3DBarChart::clickedAt(const Point& rPos, sal_uInt16 nButtons)
     if (mbBenchMarkMode)
     {
         // add correct handling here !!
-        if ((maRenderEvent != EVENT_NONE) && (maRenderEvent != EVENT_SHOW_SCROLL) && (maRenderEvent != EVENT_AUTO_FLY))
+        if ((maRenderEvent != EVENT_NONE) && (maRenderEvent != EVENT_SHOW_SCROLL) &&
+            (maRenderEvent != EVENT_AUTO_FLY) && (maRenderEvent != EVENT_SHOW_SELECT))
             return;
 
         {
             osl::MutexGuard aGuard(maMutex);
             maClickPos = rPos;
+            mnPreSelectBarId = mnSelectBarId;
+            maPreRenderEvent = maRenderEvent;
             maRenderEvent = EVENT_CLICK;
             maClickCond.reset();
         }
@@ -900,7 +908,8 @@ void GL3DBarChart::mouseDragMove(const Point& rStartPos, const Point& rEndPos, s
 {
     long nDirection = rEndPos.X() - rStartPos.X();
     osl::MutexGuard aGuard(maMutex);
-    if ((maRenderEvent == EVENT_NONE) || (maRenderEvent == EVENT_SHOW_SCROLL) || (maRenderEvent == EVENT_AUTO_FLY))
+    if ((maRenderEvent == EVENT_NONE) || (maRenderEvent == EVENT_SHOW_SCROLL) ||
+        (maRenderEvent == EVENT_AUTO_FLY) || (maRenderEvent == EVENT_SHOW_SELECT))
         maRenderEvent = nDirection > 0 ? EVENT_DRAG_RIGHT : EVENT_DRAG_LEFT;
     if(nDirection < 0)
     {
@@ -975,7 +984,8 @@ void GL3DBarChart::scroll(long nDelta)
 {
     {
         osl::MutexGuard aGuard(maMutex);
-        if ((maRenderEvent != EVENT_NONE) && (maRenderEvent != EVENT_SHOW_SCROLL) && (maRenderEvent != EVENT_AUTO_FLY))
+        if ((maRenderEvent != EVENT_NONE) && (maRenderEvent != EVENT_SHOW_SCROLL) &&
+            (maRenderEvent != EVENT_AUTO_FLY) && (maRenderEvent == EVENT_SHOW_SELECT))
             return;
         glm::vec3 maDir = glm::normalize(maCameraPosition - maCameraDirection);
         maCameraPosition -= (float((nDelta/10)) * maDir);
@@ -1082,10 +1092,9 @@ void GL3DBarChart::recordBarHistory(sal_uInt32 &nBarID, float &nVal)
 
 void GL3DBarChart::updateClickEvent()
 {
-    if (maRenderEvent == EVENT_CLICK || maRenderEvent == EVENT_AUTO_FLY)
+    if (maRenderEvent == EVENT_CLICK || maRenderEvent == EVENT_AUTO_FLY || maRenderEvent == EVENT_SHOW_SELECT)
     {
-        sal_uInt32 nBarId = maRenderEvent == EVENT_CLICK ? mSelectBarId : mnAutoFlyBarID;
-        std::list<float>& aList = maBarHistory[nBarId];
+        std::list<float>& aList = maBarHistory[mnSelectBarId];
         sal_uInt32 aIdex = 0;
         OUString aTitle;
         OUString aBarValue;
@@ -1105,7 +1114,7 @@ void GL3DBarChart::updateClickEvent()
                 maScreenTextShapes.push_back(new opengl3D::ScreenText(mpRenderer.get(), *mpTextCache, aBarValue, glm::vec4(0.0f, 0.0f, 1.0f, 1.0f), CALC_POS_EVENT_ID));
                 const opengl3D::TextCacheItem& rTextCache = mpTextCache->getText(aBarValue);
                 float nRectWidth = (float)rTextCache.maSize.Width() / (float)rTextCache.maSize.Height() * 0.03;
-                std::map<sal_uInt32, const BarInformation>::const_iterator itr = maBarMap.find(nBarId);
+                std::map<sal_uInt32, const BarInformation>::const_iterator itr = maBarMap.find(mnSelectBarId);
                 const BarInformation& rBarInfo = itr->second;
                 glm::vec3 aTextPos = glm::vec3(rBarInfo.maPos.x + BAR_SIZE_X / 2.0f,
                                               rBarInfo.maPos.y + BAR_SIZE_Y / 2.0f,
@@ -1282,7 +1291,8 @@ void GL3DBarChart::processAutoFly(sal_uInt32 nId, sal_uInt32 nColor)
     if (nColorRate >= FLY_THRESHOLD)
     {
         maRenderEvent = EVENT_AUTO_FLY;
-        mnAutoFlyBarID = nColorRate > mnColorRate ? nId : mnAutoFlyBarID;
+        mnSelectBarId = nColorRate > mnColorRate ? nId : mnSelectBarId;
+        mnPreSelectBarId = mnSelectBarId;
         mnColorRate = nColorRate > mnColorRate ? nColorRate : mnColorRate;
     }
 }
diff --git a/chart2/source/view/inc/GL3DBarChart.hxx b/chart2/source/view/inc/GL3DBarChart.hxx
index 8be5d4d..d256ac4 100644
--- a/chart2/source/view/inc/GL3DBarChart.hxx
+++ b/chart2/source/view/inc/GL3DBarChart.hxx
@@ -47,6 +47,7 @@ enum RenderEventType
     EVENT_DRAG_RIGHT,
     EVENT_SCROLL,
     EVENT_SHOW_SCROLL,
+    EVENT_SHOW_SELECT,
     EVENT_AUTO_FLY,
     EVENT_DIE
 };
@@ -154,7 +155,9 @@ private:
     bool mbRenderDie;
     ::osl::Condition maClickCond;
     RenderEventType maRenderEvent;
-    sal_uInt32 mSelectBarId;
+    RenderEventType maPreRenderEvent;
+    sal_uInt32 mnSelectBarId;
+    sal_uInt32 mnPreSelectBarId;
     Point maClickPos;
     sal_uInt32 miScrollRate;
     bool mbScrollFlg;
@@ -174,7 +177,6 @@ private:
     std::map<sal_uInt32, float> maDistanceMap;
     std::map<sal_uInt32, sal_uInt32> maBarColorMap;
     int mnColorRate;
-    sal_uInt32 mnAutoFlyBarID;
     bool mbBenchMarkMode;
     sal_uInt32 maHistoryCounter;
 };
commit 42d5cfcf88a9eb34e2d2ddc2aedfe68dceb68d0f
Author: weigao <weigao at multicorewareinc.com>
Date:   Wed Aug 27 17:32:27 2014 +0800

    modify history data style
    
    Change-Id: I1a86ff55805e88cc559795139c7f8f84d3fb5109

diff --git a/chart2/source/view/charttypes/GL3DBarChart.cxx b/chart2/source/view/charttypes/GL3DBarChart.cxx
index 6d46b68..1c494dd 100644
--- a/chart2/source/view/charttypes/GL3DBarChart.cxx
+++ b/chart2/source/view/charttypes/GL3DBarChart.cxx
@@ -460,7 +460,8 @@ GL3DBarChart::GL3DBarChart(
     miDataUpdateCounter(0),
     mnColorRate(0),
     mnAutoFlyBarID(0),
-    mbBenchMarkMode(false)
+    mbBenchMarkMode(false),
+    maHistoryCounter(0)
 {
     char *aBenchMark = getenv("BENCHMARK_MODE");
     if (aBenchMark)
@@ -743,6 +744,7 @@ void GL3DBarChart::create3DShapes(const boost::ptr_vector<VDataSeries>& rDataSer
         mpRenderThread->launch();
     }
     miDataUpdateCounter++;
+    maHistoryCounter++;
     mbNeedsNewRender = true;
 }
 
@@ -995,13 +997,17 @@ void GL3DBarChart::contextDestroyed()
     mbValidContext = false;
 }
 
-void GL3DBarChart::addScreenTextShape(OUString &nStr, glm::vec2 rLeftTop, float nTextHeight, const glm::vec3& rPos, const glm::vec4& rColor, sal_uInt32 nEvent)
+void GL3DBarChart::addScreenTextShape(OUString &nStr, glm::vec2 rLeftOrRightTop, float nTextHeight, bool bLeftTopFlag,
+                                            const glm::vec3& rPos, const glm::vec4& rColor, sal_uInt32 nEvent)
 {
     maScreenTextShapes.push_back(new opengl3D::ScreenText(mpRenderer.get(), *mpTextCache, nStr, rColor, nEvent));
     const opengl3D::TextCacheItem& rTextCache = mpTextCache->getText(nStr);
     float nRectWidth = (float)rTextCache.maSize.Width() / (float)rTextCache.maSize.Height() * nTextHeight / 2.0f;
     opengl3D::ScreenText* pScreenText = static_cast<opengl3D::ScreenText*>(&maScreenTextShapes.back());
-    pScreenText->setPosition(rLeftTop, glm::vec2(rLeftTop.x + nRectWidth, rLeftTop.y - nTextHeight), rPos);
+    if (bLeftTopFlag)
+        pScreenText->setPosition(rLeftOrRightTop, glm::vec2(rLeftOrRightTop.x + nRectWidth, rLeftOrRightTop.y - nTextHeight), rPos);
+    else
+        pScreenText->setPosition(glm::vec2(rLeftOrRightTop.x - nRectWidth, rLeftOrRightTop.y), glm::vec2(rLeftOrRightTop.x, rLeftOrRightTop.y - nTextHeight), rPos);
 }
 
 void GL3DBarChart::updateRenderFPS()
@@ -1017,7 +1023,8 @@ void GL3DBarChart::updateRenderFPS()
         osl_getSystemTime(&maFPSRenderStartTime);
     }
     osl_getSystemTime(&maFPSRenderEndTime);
-    addScreenTextShape(maFPS, glm::vec2(-0.99f, 0.99f), 0.06f, glm::vec3(0.0f, 0.0f, 0.0f), glm::vec4(1.0f, 0.0f, 0.0f, 1.0f));
+    addScreenTextShape(maFPS, glm::vec2(-0.99f, 0.99f), 0.06f, true,
+                       glm::vec3(0.0f, 0.0f, 0.0f), glm::vec4(1.0f, 0.0f, 0.0f, 1.0f));
 }
 
 int GL3DBarChart::calcTimeInterval(TimeValue &startTime, TimeValue &endTime)
@@ -1061,7 +1068,8 @@ void GL3DBarChart::updateDataUpdateFPS()
         osl_getSystemTime(&maDataUpdateStartTime);
     }
     osl_getSystemTime(&maDataUpdateEndTime);
-    addScreenTextShape(maDataUpdateFPS, glm::vec2(-0.99f, 0.93f), 0.06f, glm::vec3(0.0f, 0.0f, 0.0f), glm::vec4(0.0f, 1.0f, 1.0f, 1.0f));
+    addScreenTextShape(maDataUpdateFPS, glm::vec2(-0.99f, 0.93f), 0.06f, true,
+                        glm::vec3(0.0f, 0.0f, 0.0f), glm::vec4(0.0f, 1.0f, 1.0f, 1.0f));
 }
 
 void GL3DBarChart::recordBarHistory(sal_uInt32 &nBarID, float &nVal)
@@ -1078,11 +1086,20 @@ void GL3DBarChart::updateClickEvent()
     {
         sal_uInt32 nBarId = maRenderEvent == EVENT_CLICK ? mSelectBarId : mnAutoFlyBarID;
         std::list<float>& aList = maBarHistory[nBarId];
-        sal_uInt32 idex = 0;
+        sal_uInt32 aIdex = 0;
+        OUString aTitle;
+        OUString aBarValue;
+        //write title
+        if (aList.size() > 1)
+        {
+            aTitle = OUString("Time      ");
+            addScreenTextShape(aTitle, glm::vec2(0.8f, 0.99f), 0.1f, false);
+            aTitle = OUString("   Value");
+            addScreenTextShape(aTitle, glm::vec2(0.8f, 0.99f), 0.1f);
+        }
         for (std::list<float>::iterator it = aList.begin();it != aList.end();++it)
         {
-            OUString aBarValue;
-            if (idex + 1 == aList.size())
+            if (aIdex + 1 == aList.size())
             {
                 aBarValue = OUString("Value: ") + OUString::number(*it);
                 maScreenTextShapes.push_back(new opengl3D::ScreenText(mpRenderer.get(), *mpTextCache, aBarValue, glm::vec4(0.0f, 0.0f, 1.0f, 1.0f), CALC_POS_EVENT_ID));
@@ -1098,10 +1115,20 @@ void GL3DBarChart::updateClickEvent()
             }
             else
             {
-                aBarValue = OUString("History_") + OUString::number(idex) + OUString(": ") + OUString::number(*it);
-                addScreenTextShape(aBarValue, glm::vec2(0.65f, 0.99f - (idex * 0.1f)), 0.1f);
+                aTitle = OUString("[Time:") + OUString::number((maHistoryCounter - aList.size() + aIdex)) + "]: ";
+                if (aIdex == 0)
+                {
+                    aTitle = OUString("Most Recent") + aTitle;
+                }
+                else if ((aIdex + 2) == aList.size())
+                {
+                    aTitle = OUString("Least Recent") + aTitle;
+                }
+                addScreenTextShape(aTitle, glm::vec2(0.8f, 0.99f - ((aIdex + 1) * 0.1f)), 0.1f, false);
+                aBarValue = OUString::number(*it);
+                addScreenTextShape(aBarValue, glm::vec2(0.8f, 0.99f - ((aIdex + 1) * 0.1f)), 0.1f);
             }
-            idex++;
+            aIdex++;
         }
     }
 }
diff --git a/chart2/source/view/inc/GL3DBarChart.hxx b/chart2/source/view/inc/GL3DBarChart.hxx
index 6978947..8be5d4d 100644
--- a/chart2/source/view/inc/GL3DBarChart.hxx
+++ b/chart2/source/view/inc/GL3DBarChart.hxx
@@ -91,7 +91,7 @@ private:
     void updateDataUpdateFPS();
     DECL_LINK(updateTimer, void*);
     int calcTimeInterval(TimeValue &startTime, TimeValue &endTime);
-    void addScreenTextShape(OUString &nStr, glm::vec2 rLeftTop, float nTextHeight,
+    void addScreenTextShape(OUString &nStr, glm::vec2 rLeftOrRightTop, float nTextHeight, bool bLeftTopFlag = true,
                                   const glm::vec3& rPos = glm::vec3(0.0f, 0.0f, 0.0f),
                                   const glm::vec4& rColor = glm::vec4(0.0f, 0.0f, 1.0f, 1.0f),
                                   sal_uInt32 nEvent = 0);
@@ -176,6 +176,7 @@ private:
     int mnColorRate;
     sal_uInt32 mnAutoFlyBarID;
     bool mbBenchMarkMode;
+    sal_uInt32 maHistoryCounter;
 };
 
 }
commit ca092a929f137d461ac1af67ab05bc7a9026b842
Author: weigao <weigao at multicorewareinc.com>
Date:   Wed Aug 27 12:43:47 2014 +0800

    modify data update fps to data update rate
    
    Change-Id: I9654fb02a1481b679d98359424e272cc4a706464

diff --git a/chart2/source/view/charttypes/GL3DBarChart.cxx b/chart2/source/view/charttypes/GL3DBarChart.cxx
index 2faf96b..6d46b68 100644
--- a/chart2/source/view/charttypes/GL3DBarChart.cxx
+++ b/chart2/source/view/charttypes/GL3DBarChart.cxx
@@ -1050,12 +1050,12 @@ void GL3DBarChart::updateDataUpdateFPS()
         int iFPS = miDataUpdateCounter * 1000 / nDeltaMs;
         if (iFPS)
         {
-            maDataUpdateFPS = OUString("Data Update FPS: ") + OUString::number(iFPS);
+            maDataUpdateFPS = OUString("Data Update Rate: ") + OUString::number(iFPS);
         }
         else
         {
             float fFPS = (float)miDataUpdateCounter * 1000 / (float)nDeltaMs;
-            maDataUpdateFPS = OUString("Data Update FPS: ") + OUString::number(fFPS);
+            maDataUpdateFPS = OUString("Data Update Rate: ") + OUString::number(fFPS);
         }
         miDataUpdateCounter = 0;
         osl_getSystemTime(&maDataUpdateStartTime);
commit 23d54d07085dadcd9c66763d833e9aeb183648e5
Author: weigao <weigao at multicorewareinc.com>
Date:   Wed Aug 27 00:00:58 2014 +0800

    modify data update color to cyan
    
    Change-Id: I61dd4fac1e93e3b6255f31585b19f0182cb45b97

diff --git a/chart2/source/view/charttypes/GL3DBarChart.cxx b/chart2/source/view/charttypes/GL3DBarChart.cxx
index 639354f..2faf96b 100644
--- a/chart2/source/view/charttypes/GL3DBarChart.cxx
+++ b/chart2/source/view/charttypes/GL3DBarChart.cxx
@@ -1061,7 +1061,7 @@ void GL3DBarChart::updateDataUpdateFPS()
         osl_getSystemTime(&maDataUpdateStartTime);
     }
     osl_getSystemTime(&maDataUpdateEndTime);
-    addScreenTextShape(maDataUpdateFPS, glm::vec2(-0.99f, 0.93f), 0.06f);
+    addScreenTextShape(maDataUpdateFPS, glm::vec2(-0.99f, 0.93f), 0.06f, glm::vec3(0.0f, 0.0f, 0.0f), glm::vec4(0.0f, 1.0f, 1.0f, 1.0f));
 }
 
 void GL3DBarChart::recordBarHistory(sal_uInt32 &nBarID, float &nVal)
commit a670e1596f38572b877c68405b8fd07913c08a05
Author: weigao <weigao at multicorewareinc.com>
Date:   Tue Aug 26 23:43:11 2014 +0800

    add screen text color set interface
    
    Change-Id: I2407166368b55b973c70a2edc377785b82d8481b

diff --git a/chart2/source/view/charttypes/GL3DBarChart.cxx b/chart2/source/view/charttypes/GL3DBarChart.cxx
index 3867467..639354f 100644
--- a/chart2/source/view/charttypes/GL3DBarChart.cxx
+++ b/chart2/source/view/charttypes/GL3DBarChart.cxx
@@ -861,7 +861,7 @@ void GL3DBarChart::clickedAt(const Point& rPos, sal_uInt16 nButtons)
                                   rBarInfo.maPos.y + BAR_SIZE_Y / 2.0f,
                                   rBarInfo.maPos.z);
     maShapes.push_back(new opengl3D::ScreenText(mpRenderer.get(), *mpTextCache,
-                OUString("Value: ") + OUString::number(rBarInfo.mnVal), CALC_POS_EVENT_ID));
+                OUString("Value: ") + OUString::number(rBarInfo.mnVal), glm::vec4(0.0f, 0.0f, 1.0f, 1.0f), CALC_POS_EVENT_ID));
     opengl3D::ScreenText* pScreenText = static_cast<opengl3D::ScreenText*>(&maShapes.back());
     pScreenText->setPosition(glm::vec2(-0.9f, 0.9f), glm::vec2(-0.6f, 0.8f), aTextPos);
     pScreenText->render();
@@ -995,9 +995,9 @@ void GL3DBarChart::contextDestroyed()
     mbValidContext = false;
 }
 
-void GL3DBarChart::addScreenTextShape(OUString &nStr, glm::vec2 rLeftTop, float nTextHeight, const glm::vec3& rPos, sal_uInt32 nEvent)
+void GL3DBarChart::addScreenTextShape(OUString &nStr, glm::vec2 rLeftTop, float nTextHeight, const glm::vec3& rPos, const glm::vec4& rColor, sal_uInt32 nEvent)
 {
-    maScreenTextShapes.push_back(new opengl3D::ScreenText(mpRenderer.get(), *mpTextCache, nStr, nEvent));
+    maScreenTextShapes.push_back(new opengl3D::ScreenText(mpRenderer.get(), *mpTextCache, nStr, rColor, nEvent));
     const opengl3D::TextCacheItem& rTextCache = mpTextCache->getText(nStr);
     float nRectWidth = (float)rTextCache.maSize.Width() / (float)rTextCache.maSize.Height() * nTextHeight / 2.0f;
     opengl3D::ScreenText* pScreenText = static_cast<opengl3D::ScreenText*>(&maScreenTextShapes.back());
@@ -1017,7 +1017,7 @@ void GL3DBarChart::updateRenderFPS()
         osl_getSystemTime(&maFPSRenderStartTime);
     }
     osl_getSystemTime(&maFPSRenderEndTime);
-    addScreenTextShape(maFPS, glm::vec2(-0.99f, 0.99f), 0.06f);
+    addScreenTextShape(maFPS, glm::vec2(-0.99f, 0.99f), 0.06f, glm::vec3(0.0f, 0.0f, 0.0f), glm::vec4(1.0f, 0.0f, 0.0f, 1.0f));
 }
 
 int GL3DBarChart::calcTimeInterval(TimeValue &startTime, TimeValue &endTime)
@@ -1085,7 +1085,7 @@ void GL3DBarChart::updateClickEvent()
             if (idex + 1 == aList.size())
             {
                 aBarValue = OUString("Value: ") + OUString::number(*it);
-                maScreenTextShapes.push_back(new opengl3D::ScreenText(mpRenderer.get(), *mpTextCache, aBarValue, CALC_POS_EVENT_ID));
+                maScreenTextShapes.push_back(new opengl3D::ScreenText(mpRenderer.get(), *mpTextCache, aBarValue, glm::vec4(0.0f, 0.0f, 1.0f, 1.0f), CALC_POS_EVENT_ID));
                 const opengl3D::TextCacheItem& rTextCache = mpTextCache->getText(aBarValue);
                 float nRectWidth = (float)rTextCache.maSize.Width() / (float)rTextCache.maSize.Height() * 0.03;
                 std::map<sal_uInt32, const BarInformation>::const_iterator itr = maBarMap.find(nBarId);
@@ -1226,7 +1226,7 @@ void GL3DBarChart::updateScroll()
             for(size_t i = 0; i < aBarInfoList.size(); i++)
             {
                 OUString aBarValue = OUString("Value: ") + OUString::number(aBarInfoList[i].mnVal);
-                maScreenTextShapes.push_back(new opengl3D::ScreenText(mpRenderer.get(), *mpTextCache, aBarValue, CALC_POS_EVENT_ID));
+                maScreenTextShapes.push_back(new opengl3D::ScreenText(mpRenderer.get(), *mpTextCache, aBarValue, glm::vec4(0.0f, 0.0f, 1.0f, 1.0f), CALC_POS_EVENT_ID));
                 const opengl3D::TextCacheItem& rTextCache = mpTextCache->getText(aBarValue);
                 float nRectWidth = (float)rTextCache.maSize.Width() / (float)rTextCache.maSize.Height() * 0.03;
                 glm::vec3 aTextPos = glm::vec3(aBarInfoList[i].maPos.x + BAR_SIZE_X / 2.0f,
diff --git a/chart2/source/view/inc/3DChartObjects.hxx b/chart2/source/view/inc/3DChartObjects.hxx
index 9c8bb503..d3ea915 100644
--- a/chart2/source/view/inc/3DChartObjects.hxx
+++ b/chart2/source/view/inc/3DChartObjects.hxx
@@ -108,7 +108,7 @@ private:
 class ScreenText : public Renderable3DObject
 {
 public:
-    ScreenText(OpenGL3DRenderer* pRenderer, TextCache& rTextCache, const OUString& rStr, sal_uInt32 nId);
+    ScreenText(OpenGL3DRenderer* pRenderer, TextCache& rTextCache, const OUString& rStr, glm::vec4 rColor, sal_uInt32 nId);
 
     virtual void render() SAL_OVERRIDE;
     void setPosition(const glm::vec2& rTopLeft, const glm::vec2& rBottomRight, glm::vec3 r3DPos = glm::vec3(0.0, 0.0, 0.0));
@@ -118,6 +118,7 @@ private:
     glm::vec2 maTopLeft;
     glm::vec2 maBottomRight;
     glm::vec3 ma3DPos;
+    glm::vec4 maColor;
 };
 
 class Rectangle : public Renderable3DObject
diff --git a/chart2/source/view/inc/GL3DBarChart.hxx b/chart2/source/view/inc/GL3DBarChart.hxx
index 0e24273..6978947 100644
--- a/chart2/source/view/inc/GL3DBarChart.hxx
+++ b/chart2/source/view/inc/GL3DBarChart.hxx
@@ -91,7 +91,10 @@ private:
     void updateDataUpdateFPS();
     DECL_LINK(updateTimer, void*);
     int calcTimeInterval(TimeValue &startTime, TimeValue &endTime);
-    void addScreenTextShape(OUString &nStr, glm::vec2 rLeftTop, float nTextHeight, const glm::vec3& rPos = glm::vec3(0.0f, 0.0f, 0.0f), sal_uInt32 nEvent = 0);
+    void addScreenTextShape(OUString &nStr, glm::vec2 rLeftTop, float nTextHeight,
+                                  const glm::vec3& rPos = glm::vec3(0.0f, 0.0f, 0.0f),
+                                  const glm::vec4& rColor = glm::vec4(0.0f, 0.0f, 1.0f, 1.0f),
+                                  sal_uInt32 nEvent = 0);
     void recordBarHistory(sal_uInt32 &nBarID, float &nVal);
     void updateClickEvent();
     void calcDistance(std::vector<sal_uInt32> &vectorNearest);
diff --git a/chart2/source/view/inc/GL3DRenderer.hxx b/chart2/source/view/inc/GL3DRenderer.hxx
index 1993a19..3be3771 100644
--- a/chart2/source/view/inc/GL3DRenderer.hxx
+++ b/chart2/source/view/inc/GL3DRenderer.hxx
@@ -142,6 +142,7 @@ struct TextInfo
     GLuint texture;
     float vertex[12];
     glm::vec3 pos;
+    glm::vec4 textColor;
 };
 
 struct TextureArrayInfo
@@ -199,7 +200,7 @@ public:
                            sal_uInt32 nUniqueId);
     void CreateScreenTextTexture(const boost::shared_array<sal_uInt8> &bitmapBuf,
                                  ::Size maSizePixels, const glm::vec2& vTopLeft,
-                                 const glm::vec2& vBottomRight, glm::vec3 vPos, sal_uInt32 nUniqueId);
+                                 const glm::vec2& vBottomRight, glm::vec3 vPos, glm::vec4 screenTextColor, sal_uInt32 nUniqueId);
     void ProcessUnrenderedShape(bool bNewScene);
 
     void SetPickingMode(bool bPickingMode);
diff --git a/chart2/source/view/main/3DChartObjects.cxx b/chart2/source/view/main/3DChartObjects.cxx
index a045b48..96763d0 100644
--- a/chart2/source/view/main/3DChartObjects.cxx
+++ b/chart2/source/view/main/3DChartObjects.cxx
@@ -128,9 +128,10 @@ void Text::setPosition(const glm::vec3& rTopLeft, const glm::vec3& rTopRight, co
     maBottomRight = rBottomRight;
 }
 
-ScreenText::ScreenText(OpenGL3DRenderer* pRenderer, TextCache& rTextCache, const OUString& rStr, sal_uInt32 nId):
+ScreenText::ScreenText(OpenGL3DRenderer* pRenderer, TextCache& rTextCache, const OUString& rStr, glm::vec4 rColor, sal_uInt32 nId):
     Renderable3DObject(pRenderer, nId),
-    maText(rTextCache.getText(rStr))
+    maText(rTextCache.getText(rStr)),
+    maColor(rColor)
 {
 }
 
@@ -144,7 +145,7 @@ void ScreenText::setPosition(const glm::vec2& rTopLeft, const glm::vec2& rBottom
 void ScreenText::render()
 {
     mpRenderer->CreateScreenTextTexture(maText.maPixels, maText.maSize,
-                                        maTopLeft, maBottomRight, ma3DPos,
+                                        maTopLeft, maBottomRight, ma3DPos, maColor,
                                         mnUniqueId);
 }
 
diff --git a/chart2/source/view/main/GL3DRenderer.cxx b/chart2/source/view/main/GL3DRenderer.cxx
index 7e82334..9a2bbf2 100644
--- a/chart2/source/view/main/GL3DRenderer.cxx
+++ b/chart2/source/view/main/GL3DRenderer.cxx
@@ -1670,7 +1670,7 @@ void OpenGL3DRenderer::RenderExtrude3DObject()
 void OpenGL3DRenderer::CreateScreenTextTexture(
         const boost::shared_array<sal_uInt8> &bitmapBuf,
         ::Size maSizePixels, const glm::vec2& vTopLeft,
-        const glm::vec2& vBottomRight, glm::vec3 vPos, sal_uInt32 nUniqueId)
+        const glm::vec2& vBottomRight, glm::vec3 vPos, glm::vec4 screenTextColor, sal_uInt32 nUniqueId)
 {
     long bmpWidth = maSizePixels.Width();
     long bmpHeight = maSizePixels.Height();
@@ -1694,6 +1694,7 @@ void OpenGL3DRenderer::CreateScreenTextTexture(
     aTextInfo.vertex[10] = vBottomRight.y;
     aTextInfo.vertex[11] = 0;
     aTextInfo.pos = vPos;
+    aTextInfo.textColor = screenTextColor;
 
     CHECK_GL_ERROR();
     glGenTextures(1, &aTextInfo.texture);
@@ -1881,8 +1882,6 @@ void OpenGL3DRenderer::ReleaseScreenTextTexture()
 void OpenGL3DRenderer::RenderScreenTextShape()
 {
     glUseProgram(maResources.m_ScreenTextProID);
-    glm::vec4 textColor = glm::vec4(0.0, 0.0, 1.0, 1.0);
-    glUniform4fv(maResources.m_ScreenTextColorID, 1, &textColor[0]);
     CHECK_GL_ERROR();
     for (size_t i = 0; i < m_ScreenTextInfoList.size(); i++)
     {
@@ -1910,6 +1909,7 @@ void OpenGL3DRenderer::RenderScreenTextShape()
                 }
             }
         }
+        glUniform4fv(maResources.m_ScreenTextColorID, 1, &textInfo.textColor[0]);
         glBindBuffer(GL_ARRAY_BUFFER, m_VertexBuffer);
         CHECK_GL_ERROR();
         glBufferData(GL_ARRAY_BUFFER, sizeof(textInfo.vertex), textInfo.vertex, GL_STATIC_DRAW);
commit bbd07982002b504545d7e5f01db0f18c53e1a4bf
Author: weigao <weigao at multicorewareinc.com>
Date:   Tue Aug 26 23:04:23 2014 +0800

    place date update fps below render fps
    
    Change-Id: I18edebf6fe3c323fec2f6190b00bdc6b5d76c4bc

diff --git a/chart2/source/view/charttypes/GL3DBarChart.cxx b/chart2/source/view/charttypes/GL3DBarChart.cxx
index af55662..3867467 100644
--- a/chart2/source/view/charttypes/GL3DBarChart.cxx
+++ b/chart2/source/view/charttypes/GL3DBarChart.cxx
@@ -1061,7 +1061,7 @@ void GL3DBarChart::updateDataUpdateFPS()
         osl_getSystemTime(&maDataUpdateStartTime);
     }
     osl_getSystemTime(&maDataUpdateEndTime);
-    addScreenTextShape(maDataUpdateFPS, glm::vec2(-0.69f, 0.99f), 0.06f);
+    addScreenTextShape(maDataUpdateFPS, glm::vec2(-0.99f, 0.93f), 0.06f);
 }
 
 void GL3DBarChart::recordBarHistory(sal_uInt32 &nBarID, float &nVal)
commit ce538c824ab9983194cdb8b5d08ccd76e4838139
Author: weigao <weigao at multicorewareinc.com>
Date:   Tue Aug 26 22:52:51 2014 +0800

    reduce render fps and data update fps to half
    
    Change-Id: Ibb8b57577696e582c05ac0ea372385373e3444de

diff --git a/chart2/source/view/charttypes/GL3DBarChart.cxx b/chart2/source/view/charttypes/GL3DBarChart.cxx
index d087064..af55662 100644
--- a/chart2/source/view/charttypes/GL3DBarChart.cxx
+++ b/chart2/source/view/charttypes/GL3DBarChart.cxx
@@ -999,7 +999,7 @@ void GL3DBarChart::addScreenTextShape(OUString &nStr, glm::vec2 rLeftTop, float
 {
     maScreenTextShapes.push_back(new opengl3D::ScreenText(mpRenderer.get(), *mpTextCache, nStr, nEvent));
     const opengl3D::TextCacheItem& rTextCache = mpTextCache->getText(nStr);
-    float nRectWidth = (float)rTextCache.maSize.Width() / (float)rTextCache.maSize.Height() * 0.05;
+    float nRectWidth = (float)rTextCache.maSize.Width() / (float)rTextCache.maSize.Height() * nTextHeight / 2.0f;
     opengl3D::ScreenText* pScreenText = static_cast<opengl3D::ScreenText*>(&maScreenTextShapes.back());
     pScreenText->setPosition(rLeftTop, glm::vec2(rLeftTop.x + nRectWidth, rLeftTop.y - nTextHeight), rPos);
 }
@@ -1017,7 +1017,7 @@ void GL3DBarChart::updateRenderFPS()
         osl_getSystemTime(&maFPSRenderStartTime);
     }
     osl_getSystemTime(&maFPSRenderEndTime);
-    addScreenTextShape(maFPS, glm::vec2(-0.99f, 0.99f), 0.1f);
+    addScreenTextShape(maFPS, glm::vec2(-0.99f, 0.99f), 0.06f);
 }
 
 int GL3DBarChart::calcTimeInterval(TimeValue &startTime, TimeValue &endTime)
@@ -1061,7 +1061,7 @@ void GL3DBarChart::updateDataUpdateFPS()
         osl_getSystemTime(&maDataUpdateStartTime);
     }
     osl_getSystemTime(&maDataUpdateEndTime);
-    addScreenTextShape(maDataUpdateFPS, glm::vec2(-0.69f, 0.99f), 0.1f);
+    addScreenTextShape(maDataUpdateFPS, glm::vec2(-0.69f, 0.99f), 0.06f);
 }
 
 void GL3DBarChart::recordBarHistory(sal_uInt32 &nBarID, float &nVal)
commit ca2c7b32b6b929490dfd57a1f98580aec44aea88
Author: weigao <weigao at multicorewareinc.com>
Date:   Tue Aug 26 22:22:54 2014 +0800

    use environment value to control benchmark mode
    
    Change-Id: I417583701fdc24f846c684924fef4dfa4becb259

diff --git a/chart2/source/view/charttypes/GL3DBarChart.cxx b/chart2/source/view/charttypes/GL3DBarChart.cxx
index 01a0ecd..d087064 100644
--- a/chart2/source/view/charttypes/GL3DBarChart.cxx
+++ b/chart2/source/view/charttypes/GL3DBarChart.cxx
@@ -24,7 +24,6 @@
 #include <windows.h>
 #endif
 
-#define BENCH_MARK_MODE true
 #define CALC_POS_EVENT_ID 1
 #define SHAPE_START_ID 10
 #define DATA_UPDATE_TIME 15
@@ -460,9 +459,15 @@ GL3DBarChart::GL3DBarChart(
     miFrameCount(0),
     miDataUpdateCounter(0),
     mnColorRate(0),
-    mnAutoFlyBarID(0)
+    mnAutoFlyBarID(0),
+    mbBenchMarkMode(false)
 {
-    if (BENCH_MARK_MODE)
+    char *aBenchMark = getenv("BENCHMARK_MODE");
+    if (aBenchMark)
+    {
+        mbBenchMarkMode = atoi(aBenchMark);
+    }
+    if (mbBenchMarkMode)
     {
         char *scrollFrame = getenv("SCROLL_RATE");
         if (scrollFrame)
@@ -499,7 +504,7 @@ GL3DBarChart::BarInformation::BarInformation(const glm::vec3& rPos, float nVal,
 
 GL3DBarChart::~GL3DBarChart()
 {
-    if (BENCH_MARK_MODE)
+    if (mbBenchMarkMode)
     {
         osl::MutexGuard aGuard(maMutex);
         mbRenderDie = true;
@@ -533,7 +538,7 @@ void GL3DBarChart::create3DShapes(const boost::ptr_vector<VDataSeries>& rDataSer
     maSeriesNames.reserve(rDataSeriesContainer.size());
     maBarMap.clear();
     maShapes.clear();
-    if (BENCH_MARK_MODE)
+    if (mbBenchMarkMode)
     {
         mnColorRate = 0;
     }
@@ -598,7 +603,7 @@ void GL3DBarChart::create3DShapes(const boost::ptr_vector<VDataSeries>& rDataSer
                         BarInformation(glm::vec3(nXPos, nYPos, float(nVal/nMaxVal)),
                             nVal, nIndex, nSeriesIndex)));
             recordBarHistory(nId, nVal);
-            if (BENCH_MARK_MODE)
+            if (mbBenchMarkMode)
             {
                 std::map<sal_uInt32, sal_uInt32>::const_iterator it = maBarColorMap.find(nId);
                 if (it == maBarColorMap.end())
@@ -630,7 +635,7 @@ void GL3DBarChart::create3DShapes(const boost::ptr_vector<VDataSeries>& rDataSer
     glm::vec3 aBegin;
     aBegin.y = nYPos;
     glm::vec3 aEnd = aBegin;
-    aEnd.x = BENCH_MARK_MODE ? (mbScrollFlg ? nXEnd - BAR_SIZE_X : nXEnd) : nXEnd;
+    aEnd.x = mbBenchMarkMode ? (mbScrollFlg ? nXEnd - BAR_SIZE_X : nXEnd) : nXEnd;
     pAxis->setPosition(aBegin, aEnd);
     pAxis->setLineColor(COL_BLUE);
 
@@ -650,7 +655,7 @@ void GL3DBarChart::create3DShapes(const boost::ptr_vector<VDataSeries>& rDataSer
     opengl3D::Rectangle* pRect = static_cast<opengl3D::Rectangle*>(&maShapes.back());
     glm::vec3 aTopLeft;
     glm::vec3 aTopRight = aTopLeft;
-    aTopRight.x = BENCH_MARK_MODE ? (mbScrollFlg ? nXEnd - BAR_SIZE_X : nXEnd + 2 * BAR_DISTANCE_X) : (nXEnd + 2 * BAR_DISTANCE_X);
+    aTopRight.x = mbBenchMarkMode ? (mbScrollFlg ? nXEnd - BAR_SIZE_X : nXEnd + 2 * BAR_DISTANCE_X) : (nXEnd + 2 * BAR_DISTANCE_X);
     glm::vec3 aBottomRight = aTopRight;
     aBottomRight.y = nYPos;
     pRect->setPosition(aTopLeft, aTopRight, aBottomRight);
@@ -664,7 +669,7 @@ void GL3DBarChart::create3DShapes(const boost::ptr_vector<VDataSeries>& rDataSer
     uno::Sequence<OUString> aCats = rCatProvider.getSimpleCategories();
     for (sal_Int32 i = 0; i < aCats.getLength(); ++i)
     {
-        if (BENCH_MARK_MODE && mbScrollFlg && (i + 1 == aCats.getLength()))
+        if (mbBenchMarkMode && mbScrollFlg && (i + 1 == aCats.getLength()))
             break;
         maCategories.push_back(aCats[i]);
         if(aCats[i].isEmpty())
@@ -723,7 +728,7 @@ void GL3DBarChart::create3DShapes(const boost::ptr_vector<VDataSeries>& rDataSer
         mpCamera->setPosition(maCameraPosition);
         mpCamera->setDirection(maCameraDirection);
     }
-    if (BENCH_MARK_MODE && (!mpRenderThread.is()))
+    if (mbBenchMarkMode && (!mpRenderThread.is()))
     {
         //if scroll the bars, set the speed and distance first
         if (mbScrollFlg)
@@ -743,7 +748,7 @@ void GL3DBarChart::create3DShapes(const boost::ptr_vector<VDataSeries>& rDataSer
 
 void GL3DBarChart::update()
 {
-    if (BENCH_MARK_MODE)
+    if (mbBenchMarkMode)
         return;
     if(mpRenderThread.is())
         mpRenderThread->join();
@@ -778,7 +783,7 @@ public:
 
 void GL3DBarChart::moveToDefault()
 {
-    if(BENCH_MARK_MODE)
+    if(mbBenchMarkMode)
     {
         // add correct handling here!!
         if ((maRenderEvent != EVENT_NONE) && (maRenderEvent != EVENT_SHOW_SCROLL) && (maRenderEvent != EVENT_AUTO_FLY))
@@ -819,7 +824,7 @@ void GL3DBarChart::clickedAt(const Point& rPos, sal_uInt16 nButtons)
     if(nButtons != MOUSE_LEFT)
         return;
 
-    if (BENCH_MARK_MODE)
+    if (mbBenchMarkMode)
     {
         // add correct handling here !!
         if ((maRenderEvent != EVENT_NONE) && (maRenderEvent != EVENT_SHOW_SCROLL) && (maRenderEvent != EVENT_AUTO_FLY))
@@ -883,7 +888,7 @@ void GL3DBarChart::clickedAt(const Point& rPos, sal_uInt16 nButtons)
 
 void GL3DBarChart::render()
 {
-    if (BENCH_MARK_MODE)
+    if (mbBenchMarkMode)
         return;
 
     update();
@@ -942,7 +947,7 @@ glm::vec3 GL3DBarChart::getCornerPosition(sal_Int8 nId)
 
 void GL3DBarChart::moveToCorner()
 {
-    if(BENCH_MARK_MODE)
+    if(mbBenchMarkMode)
     {
         // add correct handling here!!
         return;
@@ -973,7 +978,7 @@ void GL3DBarChart::scroll(long nDelta)
         glm::vec3 maDir = glm::normalize(maCameraPosition - maCameraDirection);
         maCameraPosition -= (float((nDelta/10)) * maDir);
         mpCamera->setPosition(maCameraPosition);
-        if(BENCH_MARK_MODE)
+        if(mbBenchMarkMode)
         {
             maVectorNearest.clear();
             getNearestBars(maVectorNearest);
diff --git a/chart2/source/view/inc/GL3DBarChart.hxx b/chart2/source/view/inc/GL3DBarChart.hxx
index 2560d58..0e24273 100644
--- a/chart2/source/view/inc/GL3DBarChart.hxx
+++ b/chart2/source/view/inc/GL3DBarChart.hxx
@@ -172,6 +172,7 @@ private:
     std::map<sal_uInt32, sal_uInt32> maBarColorMap;
     int mnColorRate;
     sal_uInt32 mnAutoFlyBarID;
+    bool mbBenchMarkMode;
 };
 
 }


More information about the Libreoffice-commits mailing list