[Libreoffice-commits] core.git: 10 commits - chart2/opengl chart2/Package_opengl.mk chart2/source include/vcl vcl/source

Markus Mohrhard markus.mohrhard at collabora.co.uk
Sun May 25 18:34:16 PDT 2014


 chart2/Package_opengl.mk                       |    2 
 chart2/opengl/screenTextFragmentShader.glsl    |   17 ++
 chart2/opengl/screenTextVertexShader.glsl      |   19 ++
 chart2/source/view/charttypes/GL3DBarChart.cxx |  101 +++++++++++-
 chart2/source/view/inc/3DChartObjects.hxx      |   17 +-
 chart2/source/view/inc/GL3DBarChart.hxx        |   23 ++
 chart2/source/view/inc/GL3DRenderer.hxx        |   70 +-------
 chart2/source/view/main/3DChartObjects.cxx     |   22 ++
 chart2/source/view/main/GL3DRenderer.cxx       |  202 ++++++++++++++++++++-----
 include/vcl/openglwin.hxx                      |    2 
 vcl/source/window/openglwin.cxx                |    2 
 11 files changed, 362 insertions(+), 115 deletions(-)

New commits:
commit dc91ebed1a3b0ef900b1bb5cf203c6a9aeb83016
Author: Markus Mohrhard <markus.mohrhard at collabora.co.uk>
Date:   Mon May 26 03:20:12 2014 +0200

    react only to left mouse click
    
    Change-Id: Ia4c2c52b8803cd36d7ed32be559ba446589377e7

diff --git a/chart2/source/view/charttypes/GL3DBarChart.cxx b/chart2/source/view/charttypes/GL3DBarChart.cxx
index ea589ac..3f330a8 100644
--- a/chart2/source/view/charttypes/GL3DBarChart.cxx
+++ b/chart2/source/view/charttypes/GL3DBarChart.cxx
@@ -306,11 +306,14 @@ public:
 
 }
 
-void GL3DBarChart::clickedAt(const Point& /*rPos*/)
+void GL3DBarChart::clickedAt(const Point& /*rPos*/, sal_uInt16 nButtons)
 {
     if(mbBlockUserInput)
         return;
 
+    if(nButtons != MOUSE_LEFT)
+        return;
+
     mbBlockUserInput = true;
     sal_uInt32 nId = 5;
     /*
diff --git a/chart2/source/view/inc/GL3DBarChart.hxx b/chart2/source/view/inc/GL3DBarChart.hxx
index 377b18c..eb436db 100644
--- a/chart2/source/view/inc/GL3DBarChart.hxx
+++ b/chart2/source/view/inc/GL3DBarChart.hxx
@@ -50,7 +50,7 @@ public:
 
     virtual void update() SAL_OVERRIDE;
 
-    virtual void clickedAt(const Point& rPos) SAL_OVERRIDE;
+    virtual void clickedAt(const Point& rPos, sal_uInt16 nButtons) SAL_OVERRIDE;
     virtual void mouseDragMove(const Point& rStartPos, const Point& rEndPos, sal_uInt16 nButtons) SAL_OVERRIDE;
     virtual void scroll(long nDelta) SAL_OVERRIDE;
     virtual void contextDestroyed() SAL_OVERRIDE;
diff --git a/include/vcl/openglwin.hxx b/include/vcl/openglwin.hxx
index d2e86cc..85d1940 100644
--- a/include/vcl/openglwin.hxx
+++ b/include/vcl/openglwin.hxx
@@ -24,7 +24,7 @@ class VCLOPENGL_DLLPUBLIC IRenderer
 public:
     virtual ~IRenderer() {}
     virtual void update() = 0;
-    virtual void clickedAt(const Point& rPos) = 0;
+    virtual void clickedAt(const Point& rPos, sal_uInt16 nButtons) = 0;
     virtual void mouseDragMove(const Point& rPosBegin, const Point& rPosEnd, sal_uInt16 nButtons) = 0;
     virtual void scroll(long nDelta) = 0;
 
diff --git a/vcl/source/window/openglwin.cxx b/vcl/source/window/openglwin.cxx
index 455e455..1983376 100644
--- a/vcl/source/window/openglwin.cxx
+++ b/vcl/source/window/openglwin.cxx
@@ -68,7 +68,7 @@ void OpenGLWindow::MouseButtonUp( const MouseEvent& rMEvt )
         Color aColor = GetPixel(aPoint);
         SAL_WARN("vcl.opengl", aColor.GetColor());
         if(mpRenderer)
-            mpRenderer->clickedAt(aPoint);
+            mpRenderer->clickedAt(aPoint, rMEvt.GetButtons());
     }
     else
     {
commit 8097fff2cc3ec601248c55f4d1434bd6d4c6c66e
Author: Markus Mohrhard <markus.mohrhard at collabora.co.uk>
Date:   Mon May 26 03:15:18 2014 +0200

    remove unnecessary debug message
    
    Change-Id: I63e65bce671d1feab4ea93bdff906b597ce180c3

diff --git a/chart2/source/view/charttypes/GL3DBarChart.cxx b/chart2/source/view/charttypes/GL3DBarChart.cxx
index 03897df..ea589ac 100644
--- a/chart2/source/view/charttypes/GL3DBarChart.cxx
+++ b/chart2/source/view/charttypes/GL3DBarChart.cxx
@@ -347,13 +347,13 @@ void GL3DBarChart::clickedAt(const Point& /*rPos*/)
 
 }
 
-void GL3DBarChart::mouseDragMove(const Point& rStartPos, const Point& rEndPos, sal_uInt16 nButtons)
+void GL3DBarChart::mouseDragMove(const Point& , const Point& , sal_uInt16 nButtons)
 {
     if(mbBlockUserInput)
         return;
 
     mbBlockUserInput = true;
-    SAL_WARN("chart2.opengl", "Dragging: " << rStartPos << " to : " << rEndPos << " Buttons: " << nButtons);
+
     if(nButtons == MOUSE_RIGHT)
     {
         mnCornerId = (mnCornerId + 1) % 4;
commit d0f2ea6aefd7fb797cad55cf73964cb0e261318b
Author: Markus Mohrhard <markus.mohrhard at collabora.co.uk>
Date:   Mon May 26 03:14:48 2014 +0200

    improve screen text positioning
    
    Change-Id: Ia1f4ae40b8dbed2324c600f7ef68a33a5b04027b

diff --git a/chart2/source/view/charttypes/GL3DBarChart.cxx b/chart2/source/view/charttypes/GL3DBarChart.cxx
index 73a41d8..03897df 100644
--- a/chart2/source/view/charttypes/GL3DBarChart.cxx
+++ b/chart2/source/view/charttypes/GL3DBarChart.cxx
@@ -343,7 +343,7 @@ void GL3DBarChart::clickedAt(const Point& /*rPos*/)
     maShapes.push_back(new opengl3D::ScreenText(mpRenderer.get(), *mpTextCache,
                 OUString("Value: ") + OUString::number(rBarInfo.mnVal), 0));
     opengl3D::ScreenText* pScreenText = static_cast<opengl3D::ScreenText*>(&maShapes.back());
-    pScreenText->setPosition(glm::vec2(-1.0f, 0.9f), glm::vec2(-0.6f, 0.75f));
+    pScreenText->setPosition(glm::vec2(-0.9f, 0.9f), glm::vec2(-0.6f, 0.8f));
 
 }
 
commit 257510bffb75eb11d759db7d86b78861b49e921e
Author: Markus Mohrhard <markus.mohrhard at collabora.co.uk>
Date:   Mon May 26 03:11:22 2014 +0200

    block user input while we are in another user interaction
    
    Change-Id: I25a846b0648d2d28585a58066a9bb1088d607c24

diff --git a/chart2/source/view/charttypes/GL3DBarChart.cxx b/chart2/source/view/charttypes/GL3DBarChart.cxx
index 951188d..73a41d8 100644
--- a/chart2/source/view/charttypes/GL3DBarChart.cxx
+++ b/chart2/source/view/charttypes/GL3DBarChart.cxx
@@ -34,7 +34,8 @@ GL3DBarChart::GL3DBarChart(
     mpTextCache(new opengl3D::TextCache()),
     mnStep(0),
     mnStepsTotal(0),
-    mnCornerId(0)
+    mnCornerId(0),
+    mbBlockUserInput(false)
 {
     Size aSize = mrWindow.GetSizePixel();
     mpRenderer->SetSize(aSize);
@@ -307,6 +308,10 @@ public:
 
 void GL3DBarChart::clickedAt(const Point& /*rPos*/)
 {
+    if(mbBlockUserInput)
+        return;
+
+    mbBlockUserInput = true;
     sal_uInt32 nId = 5;
     /*
     {
@@ -344,6 +349,10 @@ void GL3DBarChart::clickedAt(const Point& /*rPos*/)
 
 void GL3DBarChart::mouseDragMove(const Point& rStartPos, const Point& rEndPos, sal_uInt16 nButtons)
 {
+    if(mbBlockUserInput)
+        return;
+
+    mbBlockUserInput = true;
     SAL_WARN("chart2.opengl", "Dragging: " << rStartPos << " to : " << rEndPos << " Buttons: " << nButtons);
     if(nButtons == MOUSE_RIGHT)
     {
@@ -413,6 +422,7 @@ IMPL_LINK_NOARG(GL3DBarChart, MoveCamera)
     }
     else
     {
+        mbBlockUserInput = false;
         mnStep = 0;
     }
 
@@ -434,6 +444,7 @@ IMPL_LINK_NOARG(GL3DBarChart, MoveToBar)
     else
     {
         maShapes.pop_back();
+        mbBlockUserInput = false;
         mnStep = 0;
     }
 
@@ -442,6 +453,9 @@ IMPL_LINK_NOARG(GL3DBarChart, MoveToBar)
 
 void GL3DBarChart::scroll(long nDelta)
 {
+    if(mbBlockUserInput)
+        return;
+
     glm::vec3 maDir = glm::normalize(maCameraPosition - maCameraDirection);
     maCameraPosition -= (float((nDelta/10)) * maDir);
     mpCamera->setPosition(maCameraPosition);
diff --git a/chart2/source/view/inc/GL3DBarChart.hxx b/chart2/source/view/inc/GL3DBarChart.hxx
index 1f54cc6..377b18c 100644
--- a/chart2/source/view/inc/GL3DBarChart.hxx
+++ b/chart2/source/view/inc/GL3DBarChart.hxx
@@ -107,6 +107,7 @@ private:
 
 
     std::map<sal_uInt32, const BarInformation> maBarMap;
+    bool mbBlockUserInput;
 };
 
 }
commit b8dc914cdc0eab0735e4fec7613221fef2fc0fdb
Author: Markus Mohrhard <markus.mohrhard at collabora.co.uk>
Date:   Mon May 26 03:08:08 2014 +0200

    adapt bar size to demo
    
    Change-Id: Id746ce00f9e91397a3edf0b39bf7dbb08ea59885

diff --git a/chart2/source/view/charttypes/GL3DBarChart.cxx b/chart2/source/view/charttypes/GL3DBarChart.cxx
index 6131e05..951188d 100644
--- a/chart2/source/view/charttypes/GL3DBarChart.cxx
+++ b/chart2/source/view/charttypes/GL3DBarChart.cxx
@@ -97,7 +97,7 @@ void GL3DBarChart::create3DShapes(const boost::ptr_vector<VDataSeries>& rDataSer
     // guarantee they are positioned correctly.  In fact, they are guaranteed
     // to be positioned incorrectly.
 
-    const float nBarSizeX = 10.0f;
+    const float nBarSizeX = 5.0f;
     const float nBarSizeY = 30.0f;
     const float nBarDistanceX = 5.0f;
     const float nBarDistanceY = 5.0;
commit d06ce014edf0c83b27b31d6c5af20de39d593037
Author: Markus Mohrhard <markus.mohrhard at collabora.co.uk>
Date:   Mon May 26 02:37:28 2014 +0200

    add initial work on zoom into the bar movement
    
    Change-Id: Idc8c1f27dbeafdf34706f09c890f202849c2ce33

diff --git a/chart2/source/view/charttypes/GL3DBarChart.cxx b/chart2/source/view/charttypes/GL3DBarChart.cxx
index 9674495..6131e05 100644
--- a/chart2/source/view/charttypes/GL3DBarChart.cxx
+++ b/chart2/source/view/charttypes/GL3DBarChart.cxx
@@ -40,7 +40,15 @@ GL3DBarChart::GL3DBarChart(
     mpRenderer->SetSize(aSize);
     mrWindow.setRenderer(this);
     mpRenderer->init();
-    maTimer.SetTimeoutHdl(LINK(this, GL3DBarChart, MoveCamera));
+}
+
+GL3DBarChart::BarInformation::BarInformation(const glm::vec3& rPos, float nVal,
+        sal_Int32 nIndex, sal_Int32 nSeriesIndex):
+    maPos(rPos),
+    mnVal(nVal),
+    mnIndex(nIndex),
+    mnSeriesIndex(nSeriesIndex)
+{
 }
 
 GL3DBarChart::~GL3DBarChart()
@@ -102,6 +110,10 @@ void GL3DBarChart::create3DShapes(const boost::ptr_vector<VDataSeries>& rDataSer
         COL_RED, COL_GREEN, COL_YELLOW, COL_BROWN, COL_GRAY
     };
 
+    maCategories.clear();
+    maSeriesNames.clear();
+    maSeriesNames.reserve(rDataSeriesContainer.size());
+    maBarMap.clear();
     maShapes.clear();
     maShapes.push_back(new opengl3D::Camera(mpRenderer.get()));
     mpCamera = static_cast<opengl3D::Camera*>(&maShapes.back());
@@ -125,6 +137,8 @@ void GL3DBarChart::create3DShapes(const boost::ptr_vector<VDataSeries>& rDataSer
             DataSeriesHelper::getDataSeriesLabel(
                 rDataSeries.getModel(), mxChartType->getRoleOfSequenceForSeriesLabel());
 
+        maSeriesNames.push_back(aSeriesName);
+
         if(!aSeriesName.isEmpty())
         {
             maShapes.push_back(new opengl3D::Text(mpRenderer.get(),
@@ -155,6 +169,10 @@ void GL3DBarChart::create3DShapes(const boost::ptr_vector<VDataSeries>& rDataSer
             glm::mat4 aTranslationMatrix = glm::translate(nXPos, nYPos, 0.0f);
             glm::mat4 aBarPosition = aTranslationMatrix * aScaleMatrix;
 
+            maBarMap.insert(std::pair<sal_uInt32, BarInformation>(nId,
+                        BarInformation(glm::vec3(nXPos, nYPos, float(nVal/nMaxVal)),
+                            nVal, nIndex, nSeriesIndex)));
+
             maShapes.push_back(new opengl3D::Bar(mpRenderer.get(), aBarPosition, nColor, nId++));
         }
 
@@ -186,12 +204,6 @@ void GL3DBarChart::create3DShapes(const boost::ptr_vector<VDataSeries>& rDataSer
     pAxis->setPosition(aBegin, aEnd);
     pAxis->setLineColor(COL_BLUE);
 
-    // test for information
-    maShapes.push_back(new opengl3D::ScreenText(mpRenderer.get(), *mpTextCache,
-                "I'm really nice text", 0));
-    opengl3D::ScreenText* pScreenText = static_cast<opengl3D::ScreenText*>(&maShapes.back());
-    pScreenText->setPosition(glm::vec2(-1.0f, 0.9f), glm::vec2(-0.6f, 0.75f));
-
     // Chart background.
     maShapes.push_back(new opengl3D::Rectangle(mpRenderer.get(), nId++));
     opengl3D::Rectangle* pRect = static_cast<opengl3D::Rectangle*>(&maShapes.back());
@@ -208,6 +220,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)
     {
+        maCategories.push_back(aCats[i]);
         if(aCats[i].isEmpty())
             continue;
 
@@ -292,16 +305,41 @@ public:
 
 }
 
-void GL3DBarChart::clickedAt(const Point& rPos)
+void GL3DBarChart::clickedAt(const Point& /*rPos*/)
 {
-    sal_uInt32 nId = 1;
+    sal_uInt32 nId = 5;
+    /*
     {
         PickingModeSetter aPickingModeSetter(mpRenderer.get());
         render();
         nId = mpRenderer->GetPixelColorFromPoint(rPos.X(), rPos.Y());
     }
-    if (mpCamera && nId != COL_WHITE)
-        mpCamera->zoom(nId);
+    */
+
+    std::map<sal_uInt32, const BarInformation>::const_iterator itr =
+        maBarMap.find(nId);
+
+    if(itr == maBarMap.end())
+        return;
+
+    const BarInformation& rBarInfo = itr->second;
+    mnStepsTotal = 100;
+    mnStep = 0;
+    maOldCameraDirection = maCameraDirection;
+    maCameraDirection = rBarInfo.maPos;
+    render();
+
+    maStep = (rBarInfo.maPos - maCameraPosition)/102.0f;
+
+    maTimer.SetTimeout(TIMEOUT);
+    maTimer.SetTimeoutHdl(LINK(this, GL3DBarChart, MoveToBar));
+    maTimer.Start();
+
+    maShapes.push_back(new opengl3D::ScreenText(mpRenderer.get(), *mpTextCache,
+                OUString("Value: ") + OUString::number(rBarInfo.mnVal), 0));
+    opengl3D::ScreenText* pScreenText = static_cast<opengl3D::ScreenText*>(&maShapes.back());
+    pScreenText->setPosition(glm::vec2(-1.0f, 0.9f), glm::vec2(-0.6f, 0.75f));
+
 }
 
 void GL3DBarChart::mouseDragMove(const Point& rStartPos, const Point& rEndPos, sal_uInt16 nButtons)
@@ -357,6 +395,7 @@ void GL3DBarChart::moveToCorner()
     mnStepsTotal = 100;
     maStep = (getCornerPosition(mnCornerId) - maCameraPosition) / float(mnStepsTotal);
     maTimer.SetTimeout(TIMEOUT);
+    maTimer.SetTimeoutHdl(LINK(this, GL3DBarChart, MoveCamera));
     maTimer.Start();
 }
 
@@ -380,6 +419,27 @@ IMPL_LINK_NOARG(GL3DBarChart, MoveCamera)
     return 0;
 }
 
+IMPL_LINK_NOARG(GL3DBarChart, MoveToBar)
+{
+    maTimer.Stop();
+    if(mnStep < mnStepsTotal)
+    {
+        ++mnStep;
+        maCameraPosition += maStep;
+        mpCamera->setPosition(maCameraPosition);
+        render();
+        maTimer.SetTimeout(TIMEOUT);
+        maTimer.Start();
+    }
+    else
+    {
+        maShapes.pop_back();
+        mnStep = 0;
+    }
+
+    return 0;
+}
+
 void GL3DBarChart::scroll(long nDelta)
 {
     glm::vec3 maDir = glm::normalize(maCameraPosition - maCameraDirection);
diff --git a/chart2/source/view/inc/3DChartObjects.hxx b/chart2/source/view/inc/3DChartObjects.hxx
index 24eb19f..31e64f2 100644
--- a/chart2/source/view/inc/3DChartObjects.hxx
+++ b/chart2/source/view/inc/3DChartObjects.hxx
@@ -132,9 +132,6 @@ public:
     void setPosition(const glm::vec3& rPos);
     void setDirection(const glm::vec3& rPos);
 
-    /// Zooms the camera towards the bar with Unique Id nId.
-    void zoom(sal_uInt32 nId);
-
 private:
     glm::vec3 maPos;
     glm::vec3 maUp;
diff --git a/chart2/source/view/inc/GL3DBarChart.hxx b/chart2/source/view/inc/GL3DBarChart.hxx
index f7408d8..1f54cc6 100644
--- a/chart2/source/view/inc/GL3DBarChart.hxx
+++ b/chart2/source/view/inc/GL3DBarChart.hxx
@@ -61,6 +61,7 @@ private:
     glm::vec3 getCornerPosition(sal_Int8 nCornerId);
 
     DECL_LINK(MoveCamera, void*);
+    DECL_LINK(MoveToBar, void*);
 
     css::uno::Reference<css::chart2::XChartType> mxChartType;
     boost::ptr_vector<opengl3D::Renderable3DObject> maShapes;
@@ -76,6 +77,9 @@ private:
     glm::vec3 maCameraPosition;
     glm::vec3 maCameraDirection;
 
+    glm::vec3 maOldCameraPosition;
+    glm::vec3 maOldCameraDirection;
+
     Timer maTimer;
     glm::vec3 maStep;
     size_t mnStep;
@@ -88,14 +92,21 @@ private:
      */
     sal_Int8 mnCornerId;
 
+    std::vector<OUString> maCategories;
+    std::vector<OUString> maSeriesNames;
     struct BarInformation
     {
-        double nVal;
-        OUString aSeriesName;
+        glm::vec3 maPos;
+        float mnVal;
+        sal_Int32 mnIndex;
+        sal_Int32 mnSeriesIndex;
+
+        BarInformation(const glm::vec3& rPos, float nVal,
+                sal_Int32 nIndex, sal_Int32 nSeriesIndex);
     };
 
 
-    std::map<sal_uInt32, BarInformation> maBarMap;
+    std::map<sal_uInt32, const BarInformation> maBarMap;
 };
 
 }
diff --git a/chart2/source/view/main/3DChartObjects.cxx b/chart2/source/view/main/3DChartObjects.cxx
index 730bd1e..e510235 100644
--- a/chart2/source/view/main/3DChartObjects.cxx
+++ b/chart2/source/view/main/3DChartObjects.cxx
@@ -209,11 +209,6 @@ void Camera::setDirection(const glm::vec3& rDir)
     maDirection = rDir;
 }
 
-void Camera::zoom(sal_uInt32 /*nId*/)
-{
-    // TODO here
-}
-
 }
 
 }
commit 22e1895acb128e6b950cd4763c0f56e017d4cb3a
Author: Markus Mohrhard <markus.mohrhard at collabora.co.uk>
Date:   Mon May 26 00:35:35 2014 +0200

    remove more unused methods
    
    Change-Id: If50cb8b21aa7b7196027a411f207eff9aee3676a

diff --git a/chart2/source/view/inc/GL3DRenderer.hxx b/chart2/source/view/inc/GL3DRenderer.hxx
index 852366a..21f12c7 100644
--- a/chart2/source/view/inc/GL3DRenderer.hxx
+++ b/chart2/source/view/inc/GL3DRenderer.hxx
@@ -263,10 +263,6 @@ private:
     ShaderResources maResources;
     PickingShaderResources maPickingResources;
 
-    // Projection matrix : default 45 degree Field of View, 4:3 ratio, display range : 0.1 unit <-> 100 units
-    glm::mat4 m_Projection;
-    // Camera matrix
-    glm::mat4 m_View;
     // Model matrix : an identity matrix (model will be at the origin
     glm::mat4 m_Model;
 
@@ -282,8 +278,6 @@ private:
 
     std::vector <Polygon3DInfo> m_Polygon3DInfoList;
 
-    glm::mat4 m_D3DTrasform;
-
     glm::mat4 m_3DProjection;
 
     glm::mat4 m_3DView;
commit 64b5ba4bfa195637bad12c9f6c2dcd19f53fc05b
Author: Markus Mohrhard <markus.mohrhard at collabora.co.uk>
Date:   Mon May 26 00:33:39 2014 +0200

    remove unused method and shader
    
    Change-Id: Ic4aafe0aa596f97ea4220e6fc063a61fa13b877d

diff --git a/chart2/source/view/inc/GL3DRenderer.hxx b/chart2/source/view/inc/GL3DRenderer.hxx
index 387f8ef..852366a 100644
--- a/chart2/source/view/inc/GL3DRenderer.hxx
+++ b/chart2/source/view/inc/GL3DRenderer.hxx
@@ -202,7 +202,6 @@ private:
     int GenerateRoundCornerBar(std::vector<glm::vec3> &vertices, std::vector<glm::vec3> &normals, float fRadius, int iSubDivY,
                                int iSubDivZ, float width, float height, float depth);
     void CreateSceneBoxView();
-    void RenderTexture(GLuint TexID);
 
     void ReleaseShapes();
     void ReleasePolygonShapes();
@@ -241,12 +240,6 @@ private:
         GLint m_2DColorID;
         GLint m_MatrixID;
 
-        // RenderProID
-        GLint m_RenderProID;
-        GLint m_RenderTexID;
-        GLint m_RenderVertexID;
-        GLint m_RenderTexCoordID;
-
         ShaderResources();
         ~ShaderResources();
 
diff --git a/chart2/source/view/main/GL3DRenderer.cxx b/chart2/source/view/main/GL3DRenderer.cxx
index 7f6e9c3..7182a94 100644
--- a/chart2/source/view/main/GL3DRenderer.cxx
+++ b/chart2/source/view/main/GL3DRenderer.cxx
@@ -128,17 +128,12 @@ OpenGL3DRenderer::ShaderResources::ShaderResources()
     , m_2DVertexID(0)
     , m_2DColorID(0)
     , m_MatrixID(0)
-    , m_RenderProID(0)
-    , m_RenderTexID(0)
-    , m_RenderVertexID(0)
-    , m_RenderTexCoordID(0)
 {
 }
 
 OpenGL3DRenderer::ShaderResources::~ShaderResources()
 {
     glDeleteProgram(m_CommonProID);
-    glDeleteProgram(m_RenderProID);
     glDeleteProgram(m_TextProID);
     glDeleteProgram(m_ScreenTextProID);
     glDeleteProgram(m_3DProID);
@@ -170,10 +165,6 @@ void OpenGL3DRenderer::ShaderResources::LoadShaders()
     m_2DVertexID = glGetAttribLocation(m_CommonProID, "vPosition");
     m_2DColorID = glGetUniformLocation(m_CommonProID, "vColor");
 
-    m_RenderProID = OpenGLHelper::LoadShaders("renderTextureVertexShader", "renderTextureFragmentShader");
-    m_RenderVertexID = glGetAttribLocation(m_RenderProID, "vPosition");
-    m_RenderTexCoordID = glGetAttribLocation(m_RenderProID, "texCoord");
-    m_RenderTexID = glGetUniformLocation(m_RenderProID, "RenderTex");
     CHECK_GL_ERROR();
 }
 
@@ -205,41 +196,6 @@ void OpenGL3DRenderer::SetCameraInfo(glm::vec3 pos, glm::vec3 direction, glm::ve
     m_CameraInfo.cameraUp = up;
 }
 
-void OpenGL3DRenderer::RenderTexture(GLuint TexID)
-{
-    glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
-
-    glUseProgram(maResources.m_RenderProID);
-
-    glEnableVertexAttribArray(maResources.m_RenderVertexID);
-    glBindBuffer(GL_ARRAY_BUFFER, m_RenderVertexBuf);
-    glVertexAttribPointer(
-        maResources.m_RenderVertexID, // attribute
-        3,                  // size
-        GL_FLOAT,           // type
-        GL_FALSE,           // normalized?
-        0,                  // stride
-        (void*)0            // array buffer offset
-        );
-    glEnableVertexAttribArray(maResources.m_RenderTexCoordID);
-    glBindBuffer(GL_ARRAY_BUFFER, m_RenderTexCoordBuf);
-    glVertexAttribPointer(
-        maResources.m_RenderTexCoordID, // attribute.
-        2,                  // size
-        GL_FLOAT,           // type
-        GL_FALSE,           // normalized?
-        0,                  // stride
-        (void*)0            // array buffer offset
-        );
-    glBindTexture(GL_TEXTURE_2D, TexID);
-    glUniform1i(maResources.m_RenderTexID, 0);
-    glDrawArrays(GL_QUADS, 0, 4);
-    glDisableVertexAttribArray(maResources.m_RenderTexCoordID);
-    glDisableVertexAttribArray(maResources.m_RenderVertexID);
-    glBindTexture(GL_TEXTURE_2D, 0);
-    glUseProgram(0);
-}
-
 void OpenGL3DRenderer::init()
 {
     glEnable(GL_TEXTURE_2D);
commit 3fbaec0501385cd31818ba704c5cb91b7b96aa59
Author: Markus Mohrhard <markus.mohrhard at collabora.co.uk>
Date:   Mon May 26 00:31:53 2014 +0200

    let us not implement this large constructor in the header file
    
    Change-Id: I271882d8cba0201b6aa63308e502509b3c2ac170

diff --git a/chart2/source/view/inc/GL3DRenderer.hxx b/chart2/source/view/inc/GL3DRenderer.hxx
index e337623..387f8ef 100644
--- a/chart2/source/view/inc/GL3DRenderer.hxx
+++ b/chart2/source/view/inc/GL3DRenderer.hxx
@@ -247,42 +247,8 @@ private:
         GLint m_RenderVertexID;
         GLint m_RenderTexCoordID;
 
-        ShaderResources()
-            : m_3DProID(0)
-            , m_3DProjectionID(0)
-            , m_3DViewID(0)
-            , m_3DModelID(0)
-            , m_3DNormalMatrixID(0)
-            , m_3DVertexID(0)
-            , m_3DNormalID(0)
-            , m_TextProID(0)
-            , m_TextMatrixID(0)
-            , m_TextVertexID(0)
-            , m_TextTexCoordID(0)
-            , m_TextTexID(0)
-            , m_ScreenTextProID(0)
-            , m_ScreenTextVertexID(0)
-            , m_ScreenTextTexCoordID(0)
-            , m_ScreenTextTexID(0)
-            , m_CommonProID(0)
-            , m_2DVertexID(0)
-            , m_2DColorID(0)
-            , m_MatrixID(0)
-            , m_RenderProID(0)
-            , m_RenderTexID(0)
-            , m_RenderVertexID(0)
-            , m_RenderTexCoordID(0)
-        {
-        }
-
-        ~ShaderResources()
-        {
-            glDeleteProgram(m_CommonProID);
-            glDeleteProgram(m_RenderProID);
-            glDeleteProgram(m_TextProID);
-            glDeleteProgram(m_ScreenTextProID);
-            glDeleteProgram(m_3DProID);
-        }
+        ShaderResources();
+        ~ShaderResources();
 
         void LoadShaders();
     };
@@ -295,18 +261,8 @@ private:
         GLint m_2DColorID;
         GLint m_MatrixID;
 
-        PickingShaderResources()
-            : m_CommonProID(0)
-            , m_2DVertexID(0)
-            , m_2DColorID(0)
-            , m_MatrixID(0)
-        {
-        }
-
-        ~PickingShaderResources()
-        {
-            glDeleteProgram(m_CommonProID);
-        }
+        PickingShaderResources();
+        ~PickingShaderResources();
 
         void LoadShaders();
     };
diff --git a/chart2/source/view/main/GL3DRenderer.cxx b/chart2/source/view/main/GL3DRenderer.cxx
index 8bbd5e7..7f6e9c3 100644
--- a/chart2/source/view/main/GL3DRenderer.cxx
+++ b/chart2/source/view/main/GL3DRenderer.cxx
@@ -107,6 +107,43 @@ OpenGL3DRenderer::~OpenGL3DRenderer()
     glDeleteRenderbuffers(1, &mnPickingRboColor);
 }
 
+OpenGL3DRenderer::ShaderResources::ShaderResources()
+    : m_3DProID(0)
+    , m_3DProjectionID(0)
+    , m_3DViewID(0)
+    , m_3DModelID(0)
+    , m_3DNormalMatrixID(0)
+    , m_3DVertexID(0)
+    , m_3DNormalID(0)
+    , m_TextProID(0)
+    , m_TextMatrixID(0)
+    , m_TextVertexID(0)
+    , m_TextTexCoordID(0)
+    , m_TextTexID(0)
+    , m_ScreenTextProID(0)
+    , m_ScreenTextVertexID(0)
+    , m_ScreenTextTexCoordID(0)
+    , m_ScreenTextTexID(0)
+    , m_CommonProID(0)
+    , m_2DVertexID(0)
+    , m_2DColorID(0)
+    , m_MatrixID(0)
+    , m_RenderProID(0)
+    , m_RenderTexID(0)
+    , m_RenderVertexID(0)
+    , m_RenderTexCoordID(0)
+{
+}
+
+OpenGL3DRenderer::ShaderResources::~ShaderResources()
+{
+    glDeleteProgram(m_CommonProID);
+    glDeleteProgram(m_RenderProID);
+    glDeleteProgram(m_TextProID);
+    glDeleteProgram(m_ScreenTextProID);
+    glDeleteProgram(m_3DProID);
+}
+
 void OpenGL3DRenderer::ShaderResources::LoadShaders()
 {
     m_3DProID = OpenGLHelper::LoadShaders("shape3DVertexShader", "shape3DFragmentShader");
@@ -140,6 +177,19 @@ void OpenGL3DRenderer::ShaderResources::LoadShaders()
     CHECK_GL_ERROR();
 }
 
+OpenGL3DRenderer::PickingShaderResources::PickingShaderResources()
+    : m_CommonProID(0)
+    , m_2DVertexID(0)
+    , m_2DColorID(0)
+    , m_MatrixID(0)
+{
+}
+
+OpenGL3DRenderer::PickingShaderResources::~PickingShaderResources()
+{
+    glDeleteProgram(m_CommonProID);
+}
+
 void OpenGL3DRenderer::PickingShaderResources::LoadShaders()
 {
     m_CommonProID = OpenGLHelper::LoadShaders("pickingVertexShader", "pickingFragmentShader");
commit 36943e981baf837191d78a0b7fe77c23e7dde0d6
Author: Markus Mohrhard <markus.mohrhard at collabora.co.uk>
Date:   Mon May 26 00:27:22 2014 +0200

    initial work on screen text
    
    Screen text is positioned in screen coordinates and therefore in 2D.
    This means it will not move with the camera.
    
    Change-Id: I3cf2e8859871ebc8034396b4c2d6f1ff9fe5d9f6

diff --git a/chart2/Package_opengl.mk b/chart2/Package_opengl.mk
index cb8c456..99cdde3 100644
--- a/chart2/Package_opengl.mk
+++ b/chart2/Package_opengl.mk
@@ -22,6 +22,8 @@ $(eval $(call gb_Package_add_files,chart2_opengl_shader,$(LIBO_BIN_FOLDER)/openg
 	symbolVertexShader.glsl \
 	textFragmentShader.glsl \
 	textVertexShader.glsl \
+	screenTextFragmentShader.glsl \
+	screenTextVertexShader.glsl \
 	shape3DFragmentShader.glsl \
 	shape3DVertexShader.glsl \
 	renderTextureVertexShader.glsl \
diff --git a/chart2/opengl/screenTextFragmentShader.glsl b/chart2/opengl/screenTextFragmentShader.glsl
new file mode 100644
index 0000000..a848103
--- /dev/null
+++ b/chart2/opengl/screenTextFragmentShader.glsl
@@ -0,0 +1,17 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+varying vec2 vTexCoord;
+uniform sampler2D TextTex;
+void main()
+{
+    gl_FragColor = vec4(texture2D(TextTex, vTexCoord).rgba);
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/chart2/opengl/screenTextVertexShader.glsl b/chart2/opengl/screenTextVertexShader.glsl
new file mode 100644
index 0000000..8d046f5
--- /dev/null
+++ b/chart2/opengl/screenTextVertexShader.glsl
@@ -0,0 +1,19 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+attribute vec3 vPosition;
+attribute vec2 texCoord;
+varying vec2 vTexCoord;
+void main()
+{
+    gl_Position =  vec4(vPosition, 1);
+    vTexCoord = texCoord;
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/chart2/source/view/charttypes/GL3DBarChart.cxx b/chart2/source/view/charttypes/GL3DBarChart.cxx
index 6594c03..9674495 100644
--- a/chart2/source/view/charttypes/GL3DBarChart.cxx
+++ b/chart2/source/view/charttypes/GL3DBarChart.cxx
@@ -186,6 +186,12 @@ void GL3DBarChart::create3DShapes(const boost::ptr_vector<VDataSeries>& rDataSer
     pAxis->setPosition(aBegin, aEnd);
     pAxis->setLineColor(COL_BLUE);
 
+    // test for information
+    maShapes.push_back(new opengl3D::ScreenText(mpRenderer.get(), *mpTextCache,
+                "I'm really nice text", 0));
+    opengl3D::ScreenText* pScreenText = static_cast<opengl3D::ScreenText*>(&maShapes.back());
+    pScreenText->setPosition(glm::vec2(-1.0f, 0.9f), glm::vec2(-0.6f, 0.75f));
+
     // Chart background.
     maShapes.push_back(new opengl3D::Rectangle(mpRenderer.get(), nId++));
     opengl3D::Rectangle* pRect = static_cast<opengl3D::Rectangle*>(&maShapes.back());
diff --git a/chart2/source/view/inc/3DChartObjects.hxx b/chart2/source/view/inc/3DChartObjects.hxx
index acc3bf4..24eb19f 100644
--- a/chart2/source/view/inc/3DChartObjects.hxx
+++ b/chart2/source/view/inc/3DChartObjects.hxx
@@ -91,6 +91,20 @@ private:
     glm::vec3 maBottomRight;
 };
 
+class ScreenText : public Renderable3DObject
+{
+public:
+    ScreenText(OpenGL3DRenderer* pRenderer, TextCache& rTextCache, const OUString& rStr, sal_uInt32 nId);
+
+    virtual void render() SAL_OVERRIDE;
+    void setPosition(const glm::vec2& rTopLeft, const glm::vec2& rBottomRight);
+
+private:
+    const BitmapEx& mrText;
+    glm::vec2 maTopLeft;
+    glm::vec2 maBottomRight;
+};
+
 class Rectangle : public Renderable3DObject
 {
 public:
diff --git a/chart2/source/view/inc/GL3DBarChart.hxx b/chart2/source/view/inc/GL3DBarChart.hxx
index 0f56b64..f7408d8 100644
--- a/chart2/source/view/inc/GL3DBarChart.hxx
+++ b/chart2/source/view/inc/GL3DBarChart.hxx
@@ -87,6 +87,15 @@ private:
      * numbering counter clockwise
      */
     sal_Int8 mnCornerId;
+
+    struct BarInformation
+    {
+        double nVal;
+        OUString aSeriesName;
+    };
+
+
+    std::map<sal_uInt32, BarInformation> maBarMap;
 };
 
 }
diff --git a/chart2/source/view/inc/GL3DRenderer.hxx b/chart2/source/view/inc/GL3DRenderer.hxx
index 5584458..e337623 100644
--- a/chart2/source/view/inc/GL3DRenderer.hxx
+++ b/chart2/source/view/inc/GL3DRenderer.hxx
@@ -162,6 +162,7 @@ public:
     void SetSize(const Size& rSize);
     void SetCameraInfo(glm::vec3 pos, glm::vec3 direction, glm::vec3 up);
     void CreateTextTexture(const BitmapEx& rBitmapEx, glm::vec3 vTopLeft,glm::vec3 vTopRight, glm::vec3 vBottomRight, glm::vec3 vBottomLeft, sal_uInt32 nUniqueId);
+    void CreateScreenTextTexture(const BitmapEx& rBitmapEx, glm::vec2 vTopLeft, glm::vec2 vBottomRight, sal_uInt32 nUniqueId);
     void ProcessUnrenderedShape();
 
     void SetPickingMode(bool bPickingMode);
@@ -178,6 +179,7 @@ private:
     void RenderExtrude3DObject();
     //add for text
     void RenderTextShape();
+    void RenderScreenTextShape();
     void RenderExtrudeSurface(const Extrude3DInfo& extrude3D);
     void RenderExtrudeTopSurface(const Extrude3DInfo& extrude3D);
     void RenderExtrudeMiddleSurface(const Extrude3DInfo& extrude3D);
@@ -206,6 +208,7 @@ private:
     void ReleasePolygonShapes();
     void ReleaseExtrude3DShapes();
     void ReleaseTextShapes();
+    void ReleaseScreenTextShapes();
 private:
 
     struct ShaderResources
@@ -226,6 +229,12 @@ private:
         GLint m_TextTexCoordID;
         GLint m_TextTexID;
 
+        // ScreenTextProID
+        GLint m_ScreenTextProID;
+        GLint m_ScreenTextVertexID;
+        GLint m_ScreenTextTexCoordID;
+        GLint m_ScreenTextTexID;
+
         // CommonProID
         GLint m_CommonProID;
         GLint m_2DVertexID;
@@ -251,6 +260,10 @@ private:
             , m_TextVertexID(0)
             , m_TextTexCoordID(0)
             , m_TextTexID(0)
+            , m_ScreenTextProID(0)
+            , m_ScreenTextVertexID(0)
+            , m_ScreenTextTexCoordID(0)
+            , m_ScreenTextTexID(0)
             , m_CommonProID(0)
             , m_2DVertexID(0)
             , m_2DColorID(0)
@@ -267,6 +280,7 @@ private:
             glDeleteProgram(m_CommonProID);
             glDeleteProgram(m_RenderProID);
             glDeleteProgram(m_TextProID);
+            glDeleteProgram(m_ScreenTextProID);
             glDeleteProgram(m_3DProID);
         }
 
@@ -353,6 +367,7 @@ private:
     GLuint m_BoundBoxNormal;
      // add for text
     std::vector <TextInfo> m_TextInfoList;
+    std::vector <TextInfo> m_ScreenTextInfoList;
     GLuint m_TextTexCoordBuf;
 
     std::vector<glm::vec3> m_Vertices;
diff --git a/chart2/source/view/main/3DChartObjects.cxx b/chart2/source/view/main/3DChartObjects.cxx
index ce959f3..730bd1e 100644
--- a/chart2/source/view/main/3DChartObjects.cxx
+++ b/chart2/source/view/main/3DChartObjects.cxx
@@ -115,6 +115,23 @@ 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):
+    Renderable3DObject(pRenderer, nId),
+    mrText(rTextCache.getText(rStr))
+{
+}
+
+void ScreenText::setPosition(const glm::vec2& rTopLeft, const glm::vec2& rBottomRight)
+{
+    maTopLeft = rTopLeft;
+    maBottomRight = rBottomRight;
+}
+
+void ScreenText::render()
+{
+    mpRenderer->CreateScreenTextTexture(mrText, maTopLeft, maBottomRight, mnUniqueId);
+}
+
 Rectangle::Rectangle(OpenGL3DRenderer* pRenderer, sal_uInt32 nId):
     Renderable3DObject(pRenderer, nId)
 {
diff --git a/chart2/source/view/main/GL3DRenderer.cxx b/chart2/source/view/main/GL3DRenderer.cxx
index 4489388..8bbd5e7 100644
--- a/chart2/source/view/main/GL3DRenderer.cxx
+++ b/chart2/source/view/main/GL3DRenderer.cxx
@@ -123,6 +123,11 @@ void OpenGL3DRenderer::ShaderResources::LoadShaders()
     m_TextTexCoordID = glGetAttribLocation(m_TextProID, "texCoord");
     m_TextTexID = glGetUniformLocation(m_TextProID, "TextTex");
 
+    m_ScreenTextProID = OpenGLHelper::LoadShaders("screenTextVertexShader", "screenTextFragmentShader");
+    m_ScreenTextVertexID = glGetAttribLocation(m_ScreenTextProID, "vPosition");
+    m_ScreenTextTexCoordID = glGetAttribLocation(m_ScreenTextProID, "texCoord");
+    m_ScreenTextTexID = glGetUniformLocation(m_ScreenTextProID, "TextTex");
+
     m_CommonProID = OpenGLHelper::LoadShaders("commonVertexShader", "commonFragmentShader");
     m_MatrixID = glGetUniformLocation(m_CommonProID, "MVP");
     m_2DVertexID = glGetAttribLocation(m_CommonProID, "vPosition");
@@ -1349,6 +1354,50 @@ void OpenGL3DRenderer::RenderExtrude3DObject()
     glDisable(GL_CULL_FACE);
 }
 
+void OpenGL3DRenderer::CreateScreenTextTexture(const BitmapEx& rBitmapEx, glm::vec2 vTopLeft, glm::vec2 vBottomRight, sal_uInt32 nUniqueId)
+{
+    long bmpWidth = rBitmapEx.GetSizePixel().Width();
+    long bmpHeight = rBitmapEx.GetSizePixel().Height();
+    boost::scoped_array<sal_uInt8> bitmapBuf(OpenGLHelper::ConvertBitmapExToRGBABuffer(rBitmapEx));
+
+    TextInfo aTextInfo;
+    aTextInfo.id = getColorAsVector(nUniqueId);
+    aTextInfo.vertex[0] = vTopLeft.x;
+    aTextInfo.vertex[1] = vTopLeft.y;
+    aTextInfo.vertex[2] = 0;
+
+    aTextInfo.vertex[3] = vBottomRight.x;
+    aTextInfo.vertex[4] = vTopLeft.y;
+    aTextInfo.vertex[5] = 0;
+
+    aTextInfo.vertex[9] = vTopLeft.x;
+    aTextInfo.vertex[10] = vBottomRight.y;
+    aTextInfo.vertex[11] = 0;
+
+    aTextInfo.vertex[6] = vBottomRight.x;
+    aTextInfo.vertex[7] = vBottomRight.y;
+    aTextInfo.vertex[8] = 0;
+
+    CHECK_GL_ERROR();
+    glGenTextures(1, &aTextInfo.texture);
+    CHECK_GL_ERROR();
+    glBindTexture(GL_TEXTURE_2D, aTextInfo.texture);
+    CHECK_GL_ERROR();
+    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP);
+    CHECK_GL_ERROR();
+    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP);
+    CHECK_GL_ERROR();
+    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
+    CHECK_GL_ERROR();
+    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
+    CHECK_GL_ERROR();
+    glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, bmpWidth, bmpHeight, 0, GL_RGBA, GL_UNSIGNED_BYTE, bitmapBuf.get());
+    CHECK_GL_ERROR();
+    glBindTexture(GL_TEXTURE_2D, 0);
+    CHECK_GL_ERROR();
+    m_ScreenTextInfoList.push_back(aTextInfo);
+}
+
 void OpenGL3DRenderer::CreateTextTexture(const BitmapEx& rBitmapEx, glm::vec3 vTopLeft,glm::vec3 vTopRight, glm::vec3 vBottomRight, glm::vec3 vBottomLeft, sal_uInt32 nUniqueId)
 {
     long bmpWidth = rBitmapEx.GetSizePixel().Width();
@@ -1403,6 +1452,72 @@ void OpenGL3DRenderer::ReleaseTextShapes()
     m_TextInfoList.clear();
 }
 
+void OpenGL3DRenderer::ReleaseScreenTextShapes()
+{
+    for (size_t i = 0; i < m_ScreenTextInfoList.size(); i++)
+    {
+        TextInfo &textInfo = m_ScreenTextInfoList[i];
+        glDeleteTextures(1, &textInfo.texture);
+    }
+    m_ScreenTextInfoList.clear();
+}
+
+void OpenGL3DRenderer::RenderScreenTextShape()
+{
+    CHECK_GL_ERROR();
+    for (size_t i = 0; i < m_ScreenTextInfoList.size(); i++)
+    {
+        TextInfo &textInfo = m_ScreenTextInfoList[i];
+        glBindBuffer(GL_ARRAY_BUFFER, m_VertexBuffer);
+        CHECK_GL_ERROR();
+        glBufferData(GL_ARRAY_BUFFER, sizeof(textInfo.vertex), textInfo.vertex, GL_STATIC_DRAW);
+        CHECK_GL_ERROR();
+        glUseProgram(maResources.m_ScreenTextProID);
+
+        CHECK_GL_ERROR();
+
+        // 1rst attribute buffer : vertices
+        glEnableVertexAttribArray(maResources.m_ScreenTextVertexID);
+        glBindBuffer(GL_ARRAY_BUFFER, m_VertexBuffer);
+        glVertexAttribPointer(
+            maResources.m_ScreenTextVertexID,
+            3,                  // size
+            GL_FLOAT,           // type
+            GL_FALSE,           // normalized?
+            0,                  // stride
+            (void*)0            // array buffer offset
+            );
+        //tex coord
+        CHECK_GL_ERROR();
+        glEnableVertexAttribArray(maResources.m_ScreenTextTexCoordID);
+        glBindBuffer(GL_ARRAY_BUFFER, m_TextTexCoordBuf);
+        glVertexAttribPointer(
+            maResources.m_ScreenTextTexCoordID,
+            2,                  // size
+            GL_FLOAT,           // type
+            GL_FALSE,           // normalized?
+            0,                  // stride
+            (void*)0            // array buffer offset
+            );
+        //texture
+        CHECK_GL_ERROR();
+        glBindTexture(GL_TEXTURE_2D, textInfo.texture);
+        CHECK_GL_ERROR();
+        glUniform1i(maResources.m_ScreenTextTexID, 0);
+        CHECK_GL_ERROR();
+        //TODO: moggi: get rid fo GL_QUADS
+        glDrawArrays(GL_QUADS, 0, 4);
+        CHECK_GL_ERROR();
+        glDisableVertexAttribArray(maResources.m_ScreenTextTexCoordID);
+        CHECK_GL_ERROR();
+        glDisableVertexAttribArray(maResources.m_ScreenTextVertexID);
+        CHECK_GL_ERROR();
+        glBindTexture(GL_TEXTURE_2D, 0);
+        glUseProgram(0);
+    }
+    CHECK_GL_ERROR();
+}
+
 void OpenGL3DRenderer::RenderTextShape()
 {
     CHECK_GL_ERROR();
@@ -1484,6 +1599,8 @@ void OpenGL3DRenderer::ProcessUnrenderedShape()
     RenderExtrude3DObject();
     //render text
     RenderTextShape();
+    // render screen text
+    RenderScreenTextShape();
     ReleaseShapes();
 #if DEBUG_FBO
     OUString aFileName = OUString("D://shaderout_") + OUString::number(m_iWidth) + "_" + OUString::number(m_iHeight) + ".png";
@@ -1525,6 +1642,7 @@ void OpenGL3DRenderer::ReleaseShapes()
     ReleasePolygonShapes();
     ReleaseExtrude3DShapes();
     ReleaseTextShapes();
+    ReleaseScreenTextShapes();
 }
 
 }


More information about the Libreoffice-commits mailing list