[Libreoffice-commits] core.git: Branch 'feature/chart-opengl2' - 13 commits - chart2/source

Markus Mohrhard markus.mohrhard at googlemail.com
Wed Jan 1 12:26:41 PST 2014


 chart2/source/view/inc/DummyXShape.hxx         |    9 
 chart2/source/view/inc/OpenglShapeFactory.hxx  |    4 
 chart2/source/view/main/DummyXShape.cxx        |   95 ++++++
 chart2/source/view/main/OpenGLRender.cxx       |  373 +++++--------------------
 chart2/source/view/main/OpenGLRender.hxx       |    7 
 chart2/source/view/main/OpenglShapeFactory.cxx |  102 ------
 6 files changed, 191 insertions(+), 399 deletions(-)

New commits:
commit 2a7c08a93e2a5ef71d1ff60a23c9719d420f8dd6
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Wed Jan 1 22:38:26 2014 +0100

    one more change to the rendering
    
    Change-Id: I36ba16e8ccb8782c9fd85d7cf772d74ffab5a7f7

diff --git a/chart2/source/view/main/OpenGLRender.cxx b/chart2/source/view/main/OpenGLRender.cxx
index b630ec9..14cd9c3 100644
--- a/chart2/source/view/main/OpenGLRender.cxx
+++ b/chart2/source/view/main/OpenGLRender.cxx
@@ -25,6 +25,8 @@ using namespace com::sun::star;
 
 using namespace std;
 
+#define RENDER_TO_FILE 0
+
 #define OPENGL_SHADER( ... )# __VA_ARGS__
 
 #define GL_PI 3.14159f
@@ -34,8 +36,6 @@ using namespace std;
 #define WGL_SAMPLES_ARB          0x2042
 #endif
 
-#define RENDER_TO_FILE 0
-
 const char *ColorFragmemtShader = OPENGL_SHADER (
 
 varying vec3 fragmentColor;
@@ -532,6 +532,28 @@ void OpenGLRender::prepareToRender()
 
 void OpenGLRender::renderToBitmap()
 {
+    if (m_iArbMultisampleSupported)
+    {
+        GLenum status;
+        glBindFramebuffer(GL_FRAMEBUFFER, 0);
+        glBindFramebuffer(GL_READ_FRAMEBUFFER, m_frameBufferMS);
+        status = glCheckFramebufferStatus(GL_READ_FRAMEBUFFER);
+        if (status != GL_FRAMEBUFFER_COMPLETE)
+        {
+            cout << "The frame buffer status is not complete!" << endl;
+        }
+        glBindFramebuffer(GL_DRAW_FRAMEBUFFER, m_FboID[m_iFboIdx % 2]);
+        status = glCheckFramebufferStatus(GL_DRAW_FRAMEBUFFER);
+        if (status != GL_FRAMEBUFFER_COMPLETE)
+        {
+            cout << "The frame buffer status is not complete!" << endl;
+        }
+        glBlitFramebuffer(0, 0 ,m_iWidth, m_iHeight, 0, 0,m_iWidth ,m_iHeight, GL_COLOR_BUFFER_BIT, GL_LINEAR);
+        glBindFramebuffer(GL_READ_FRAMEBUFFER,0);
+        glBindFramebuffer(GL_DRAW_FRAMEBUFFER,0);
+        glBindFramebuffer(GL_FRAMEBUFFER, m_FboID[m_iFboIdx % 2]);
+    }
+
 #if RENDER_TO_FILE
     char fileName[256] = {0};
     sprintf(fileName, "D:\\shaderout_%d_%d_%d.bmp", m_iWidth, m_iHeight, m_iFboIdx);
@@ -1146,7 +1168,6 @@ int OpenGLRender::Bubble2DShapePoint(float x, float y, float directionX, float d
 
 int OpenGLRender::RenderBubble2FBO(int)
 {
-    GLenum status;
     int listNum = m_Bubble2DShapePointList.size();
     for (int i = 0; i < listNum; i++)
     {
@@ -1193,28 +1214,6 @@ int OpenGLRender::RenderBubble2FBO(int)
     {
         return -1;
     }
-    if (m_iArbMultisampleSupported)
-    {
-        glBindFramebuffer(GL_FRAMEBUFFER, 0);
-        glBindFramebuffer(GL_READ_FRAMEBUFFER, m_frameBufferMS);
-        status = glCheckFramebufferStatus(GL_READ_FRAMEBUFFER);
-        if (status != GL_FRAMEBUFFER_COMPLETE)
-        {
-            cout << "The frame buffer status is not complete!" << endl;
-            return -1;
-        }
-        glBindFramebuffer(GL_DRAW_FRAMEBUFFER, m_FboID[m_iFboIdx % 2]);
-        status = glCheckFramebufferStatus(GL_DRAW_FRAMEBUFFER);
-        if (status != GL_FRAMEBUFFER_COMPLETE)
-        {
-            cout << "The frame buffer status is not complete!" << endl;
-            return -1;
-        }
-        glBlitFramebuffer(0, 0 ,m_iWidth, m_iHeight, 0, 0,m_iWidth ,m_iHeight, GL_COLOR_BUFFER_BIT, GL_LINEAR);
-        glBindFramebuffer(GL_READ_FRAMEBUFFER,0);
-        glBindFramebuffer(GL_DRAW_FRAMEBUFFER,0);
-        glBindFramebuffer(GL_FRAMEBUFFER, m_FboID[m_iFboIdx % 2]);
-    }
     return 0;
 }
 
commit 33eed4391d4db1b2604e5d096fa4b88adaf01b9c
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Wed Jan 1 22:13:43 2014 +0100

    add more debug output
    
    Change-Id: Ib9454f6fec6988899161e59c066fcc384e286200

diff --git a/chart2/source/view/main/DummyXShape.cxx b/chart2/source/view/main/DummyXShape.cxx
index a204334..2fe8e79 100644
--- a/chart2/source/view/main/DummyXShape.cxx
+++ b/chart2/source/view/main/DummyXShape.cxx
@@ -378,7 +378,8 @@ DummyCircle::DummyCircle(const awt::Point& rPos, const awt::Size& rSize)
 void DummyCircle::render()
 {
     debugProperties(maProperties);
-    std::map<OUString, uno::Any> itr = maProperties.find("FillColor");
+    DummyChart* pChart = getRootShape();
+    std::map<OUString, uno::Any>::const_iterator itr = maProperties.find("FillColor");
     if(itr != maProperties.end())
     {
         sal_Int32 nColor = itr->second.get<sal_Int32>();
@@ -386,10 +387,10 @@ void DummyCircle::render()
     }
     else
         SAL_WARN("chart2.opengl", "missing color");
-    long color = 0x3465AF;
-    DummyChart* pChart = getRootShape();
     pChart->m_GLRender.Bubble2DShapePoint(maPosition.X, maPosition.Y,
                                           maSize.Width, maSize.Height);
+    SAL_WARN("chart2.opengl", "Bubble Position: " << maPosition.X << "," << maPosition.Y);
+    SAL_WARN("chart2.opengl", "Bubble Size: " << maSize.Width << "," << maSize.Height);
     pChart->m_GLRender.RenderBubble2FBO(GL_TRUE);
 }
 
commit daa7d299368792b6639028f3dee7c1e5f14c662c
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Wed Jan 1 22:10:17 2014 +0100

    add color to bubbles
    
    Change-Id: Id851916a160b65360ee0dd4bbe67b5246067b659

diff --git a/chart2/source/view/main/DummyXShape.cxx b/chart2/source/view/main/DummyXShape.cxx
index 3b714e9..a204334 100644
--- a/chart2/source/view/main/DummyXShape.cxx
+++ b/chart2/source/view/main/DummyXShape.cxx
@@ -378,9 +378,16 @@ DummyCircle::DummyCircle(const awt::Point& rPos, const awt::Size& rSize)
 void DummyCircle::render()
 {
     debugProperties(maProperties);
+    std::map<OUString, uno::Any> itr = maProperties.find("FillColor");
+    if(itr != maProperties.end())
+    {
+        sal_Int32 nColor = itr->second.get<sal_Int32>();
+        pChart->m_GLRender.SetColor(nColor);
+    }
+    else
+        SAL_WARN("chart2.opengl", "missing color");
     long color = 0x3465AF;
     DummyChart* pChart = getRootShape();
-    pChart->m_GLRender.SetColor(color);
     pChart->m_GLRender.Bubble2DShapePoint(maPosition.X, maPosition.Y,
                                           maSize.Width, maSize.Height);
     pChart->m_GLRender.RenderBubble2FBO(GL_TRUE);
commit e2d53b9ed96e54fb59daf33e3734aa944b21f7e2
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Wed Jan 1 22:02:13 2014 +0100

    add more debug output
    
    Change-Id: I41710783f1f2d448110b5db8e9c2e7955e2ed5a7

diff --git a/chart2/source/view/main/DummyXShape.cxx b/chart2/source/view/main/DummyXShape.cxx
index d95f430..3b714e9 100644
--- a/chart2/source/view/main/DummyXShape.cxx
+++ b/chart2/source/view/main/DummyXShape.cxx
@@ -439,6 +439,8 @@ DummyLine2D::DummyLine2D(const awt::Size& rSize, const awt::Point& rPosition)
 
 void DummyLine2D::render()
 {
+    SAL_WARN("chart2.opengl", "rendering line 2D");
+    debugProperties(maProperties);
     DummyChart* pChart = getRootShape();
     std::map< OUString, uno::Any >::const_iterator itr = maProperties.find(UNO_NAME_LINECOLOR);
     if(itr != maProperties.end())
commit 3e6037b47554e4f63c7ea6a0c56204cc24704988
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Wed Jan 1 18:16:37 2014 +0100

    activate the new rendering code
    
    Change-Id: Ie5b8ef035610d5ca26b418ec966d3eaa95966241

diff --git a/chart2/source/view/inc/DummyXShape.hxx b/chart2/source/view/inc/DummyXShape.hxx
index 81a5234..a2faf60 100644
--- a/chart2/source/view/inc/DummyXShape.hxx
+++ b/chart2/source/view/inc/DummyXShape.hxx
@@ -420,6 +420,8 @@ public:
     virtual void SAL_CALL setPosition( const ::com::sun::star::awt::Point& aPosition ) throw(::com::sun::star::uno::RuntimeException);
     virtual void SAL_CALL setSize( const ::com::sun::star::awt::Size& aSize ) throw(::com::sun::star::beans::PropertyVetoException, ::com::sun::star::uno::RuntimeException);
 
+    virtual void render() SAL_OVERRIDE;
+
 private:
 
     GLWindow GLWin;    /// Holds the information of our new child window
diff --git a/chart2/source/view/main/DummyXShape.cxx b/chart2/source/view/main/DummyXShape.cxx
index 9277f7f..d95f430 100644
--- a/chart2/source/view/main/DummyXShape.cxx
+++ b/chart2/source/view/main/DummyXShape.cxx
@@ -1053,6 +1053,13 @@ void DummyChart::setSize( const awt::Size& aSize )
 
 }
 
+void DummyChart::render()
+{
+    m_GLRender.prepareToRender();
+    DummyXShapes::render();
+    m_GLRender.renderToBitmap();
+}
+
 }
 
 }
commit d98daba28c00fcffafbc345d3595769db6489e76
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Wed Jan 1 18:14:16 2014 +0100

    some inital work on merging all the rendered shapes
    
    Change-Id: Ic8e68e1311393d5f2115412a703e3d86b91e1df8

diff --git a/chart2/source/view/main/OpenGLRender.cxx b/chart2/source/view/main/OpenGLRender.cxx
index 084ada3..b630ec9 100644
--- a/chart2/source/view/main/OpenGLRender.cxx
+++ b/chart2/source/view/main/OpenGLRender.cxx
@@ -34,6 +34,8 @@ using namespace std;
 #define WGL_SAMPLES_ARB          0x2042
 #endif
 
+#define RENDER_TO_FILE 0
+
 const char *ColorFragmemtShader = OPENGL_SHADER (
 
 varying vec3 fragmentColor;
@@ -455,37 +457,8 @@ int OpenGLRender::SetLine2DShapePoint(float x, float y, int listLength)
     return 0;
 }
 
-int OpenGLRender::RenderLine2FBO(int wholeFlag)
+int OpenGLRender::RenderLine2FBO(int)
 {
-    char fileName[256] = {0};
-    sprintf(fileName, "D:\\shaderout_%d_%d_%d.bmp", m_iWidth, m_iHeight, m_iFboIdx);
-
-    glViewport(0, 0, m_iWidth, m_iHeight);
-    glClearDepth(1.0f);
-    // Clear the screen
-    glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
-    if ((!m_FboID[0]) || (!m_FboID[1]))
-    {
-        // create a texture object
-        CreateTextureObj(m_iWidth, m_iHeight);
-        //create render buffer object
-        CreateRenderObj(m_iWidth, m_iHeight);
-        //create fbo
-        if ( CreateFrameBufferObj() !=0 )
-            return -1;
-    }
-    //bind fbo
-    glBindFramebuffer(GL_FRAMEBUFFER, m_FboID[m_iFboIdx % 2]);
-
-    // Clear the screen
-    glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
-    if (wholeFlag)
-    {
-        if (m_iFboIdx > 0)
-        {
-           RenderTexture2FBO(m_TextureObj[(m_iFboIdx - 1) % 2]);
-        }
-    }
     glLineWidth(m_fLineWidth);
     int listNum = m_Line2DShapePointList.size();
     for (int i = 0; i < listNum; i++)
@@ -519,7 +492,49 @@ int OpenGLRender::RenderLine2FBO(int wholeFlag)
     m_iPointNum = 0;
     GLenum status;
     CHECK_GL_FRAME_BUFFER_STATUS();
-#if 0
+    return 0;
+}
+
+void OpenGLRender::prepareToRender()
+{
+    glViewport(0, 0, m_iWidth, m_iHeight);
+    glClearDepth(1.0f);
+    // Clear the screen
+    glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
+    if ((!m_FboID[0]) || (!m_FboID[1]))
+    {
+        // create a texture object
+        CreateTextureObj(m_iWidth, m_iHeight);
+        //create render buffer object
+        CreateRenderObj(m_iWidth, m_iHeight);
+        //create fbo
+        CreateFrameBufferObj();
+        if (m_iArbMultisampleSupported)
+        {
+            CreateMultiSampleFrameBufObj();
+        }
+    }
+    //bind fbo
+    if (m_iArbMultisampleSupported)
+    {
+        glBindFramebuffer(GL_FRAMEBUFFER,m_frameBufferMS);
+    }
+    else
+    {
+        glBindFramebuffer(GL_FRAMEBUFFER, m_FboID[m_iFboIdx % 2]);
+    }
+
+    // Clear the screen
+    glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
+
+    RenderTexture2FBO(m_TextureObj[(m_iFboIdx - 1) % 2]);
+}
+
+void OpenGLRender::renderToBitmap()
+{
+#if RENDER_TO_FILE
+    char fileName[256] = {0};
+    sprintf(fileName, "D:\\shaderout_%d_%d_%d.bmp", m_iWidth, m_iHeight, m_iFboIdx);
     sal_uInt8 *buf = (sal_uInt8 *)malloc(m_iWidth * m_iHeight * 3 + BMP_HEADER_LEN);
     CreateBMPHeader(buf, m_iWidth, m_iHeight);
     glReadPixels(0, 0, m_iWidth, m_iHeight, GL_BGR, GL_UNSIGNED_BYTE, buf + BMP_HEADER_LEN);
@@ -534,7 +549,6 @@ int OpenGLRender::RenderLine2FBO(int wholeFlag)
     xPropSet->setPropertyValue("Graphic", uno::makeAny(aGraphic.GetXGraphic()));
     mxRenderTarget->setSize(awt::Size(m_iWidth, m_iHeight));
     mxRenderTarget->setPosition(awt::Point(0,0));
-
 #endif
     glBindFramebuffer(GL_FRAMEBUFFER, 0);
 #if defined( WNT )
@@ -545,7 +559,7 @@ int OpenGLRender::RenderLine2FBO(int wholeFlag)
 #endif
     RenderTexture(m_TextureObj[m_iFboIdx % 2]);
     m_iFboIdx++;
-    return 0;
+
 }
 
 int OpenGLRender::RenderTexture2FBO(GLuint TexID)
@@ -964,6 +978,7 @@ int OpenGLRender::InitMultisample(PIXELFORMATDESCRIPTOR pfd)
     return  m_iArbMultisampleSupported;
 }
 #endif
+
 int OpenGLRender::GetMSAASupport()
 {
     return m_iArbMultisampleSupported;
@@ -1015,6 +1030,7 @@ int OpenGLRender::InitTempWindow(HWND *hwnd, int width, int height, PIXELFORMATD
     }
     return 0;
 }
+
 int OpenGLRender::WGLisExtensionSupported(const char *extension)
 {
     const size_t extlen = strlen(extension);
@@ -1128,45 +1144,9 @@ int OpenGLRender::Bubble2DShapePoint(float x, float y, float directionX, float d
     return 0;
 }
 
-int OpenGLRender::RenderBubble2FBO(int wholeFlag)
+int OpenGLRender::RenderBubble2FBO(int)
 {
-    char fileName[256] = {0};
     GLenum status;
-    glViewport(0, 0, m_iWidth, m_iHeight);
-    glClearDepth(1.0f);
-    // Clear the screen
-    glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
-    if ((!m_FboID[0]) || (!m_FboID[1]))
-    {
-        // create a texture object
-        CreateTextureObj(m_iWidth, m_iHeight);
-        //create render buffer object
-        CreateRenderObj(m_iWidth, m_iHeight);
-        //create fbo
-        CreateFrameBufferObj();
-        if (m_iArbMultisampleSupported)
-        {
-            CreateMultiSampleFrameBufObj();
-        }
-    }
-    //bind fbo
-    if (m_iArbMultisampleSupported)
-    {
-        glBindFramebuffer(GL_FRAMEBUFFER,m_frameBufferMS);
-    }
-    else
-    {
-        glBindFramebuffer(GL_FRAMEBUFFER, m_FboID[m_iFboIdx % 2]);
-    }
-    // Clear the screen
-    glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
-    if (wholeFlag)
-    {
-        if (m_iFboIdx > 0)
-        {
-           RenderTexture2FBO(m_TextureObj[(m_iFboIdx - 1) % 2]);
-        }
-    }
     int listNum = m_Bubble2DShapePointList.size();
     for (int i = 0; i < listNum; i++)
     {
@@ -1235,30 +1215,6 @@ int OpenGLRender::RenderBubble2FBO(int wholeFlag)
         glBindFramebuffer(GL_DRAW_FRAMEBUFFER,0);
         glBindFramebuffer(GL_FRAMEBUFFER, m_FboID[m_iFboIdx % 2]);
     }
-    int wndLeft = ((int)m_fPicLeft + (m_iWidth / 2) - 1) & ~3;
-    int wndRight = ((int)m_fPicRight + (m_iWidth / 2) + 7) & ~3;
-    int wndBottom = ((int)m_fPicBottom + (m_iHeight/ 2) - 1) & ~3;
-    int wndTop = ((int)m_fPicTop + (m_iHeight/ 2) + 7) & ~3;
-    int picWidth = wndRight - wndLeft;
-    int picHeight = wndTop - wndBottom;
-    sprintf(fileName, "D:\\shaderout_%d_%d_%d.bmp", picWidth, picHeight, m_iFboIdx);
-    sal_uInt8 *buf = (sal_uInt8 *)malloc(picWidth * picHeight * 3 + BMP_HEADER_LEN);
-    CreateBMPHeader(buf, picWidth, picHeight);
-    glReadPixels(wndLeft, wndBottom, picWidth, picHeight, GL_BGR, GL_UNSIGNED_BYTE, buf + BMP_HEADER_LEN);
-    FILE *pfile = fopen(fileName,"wb");
-    fwrite(buf, picWidth * picHeight * 3 + BMP_HEADER_LEN, 1, pfile);
-    free(buf);
-    fclose(pfile);
-
-    glBindFramebuffer(GL_FRAMEBUFFER, 0);
-#if defined( WNT )
-    SwapBuffers(glWin.hDC);
-    glFlush();
-#elif defined( UNX )
-    unx::glXSwapBuffers(glWin.dpy, glWin.win);
-#endif
-//    RenderTexture(m_TextureObj[m_iFboIdx % 2]);
-    m_iFboIdx++;
     return 0;
 }
 
diff --git a/chart2/source/view/main/OpenGLRender.hxx b/chart2/source/view/main/OpenGLRender.hxx
index ec7c6e4..63643ed 100644
--- a/chart2/source/view/main/OpenGLRender.hxx
+++ b/chart2/source/view/main/OpenGLRender.hxx
@@ -145,6 +145,9 @@ public:
     void SetColor(sal_uInt32 color);
     int Bubble2DShapePoint(float x, float y, float directionX, float directionY);
     int RenderBubble2FBO(int wholeFlag);
+
+    void prepareToRender();
+    void renderToBitmap();
 private:
     GLint LoadShaders(const char *vertexShader,const char *fragmentShader);
     int CreateTextureObj(int width, int height);
commit 9338a8de2b63e2b8ec786cdd6c0ce9fa1e3ba28f
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Wed Jan 1 17:54:18 2014 +0100

    use initializer list in constructo
    
    Change-Id: I772f6cf195e48b4efba86e50efeaef32d5b9639b

diff --git a/chart2/source/view/main/OpenGLRender.cxx b/chart2/source/view/main/OpenGLRender.cxx
index 3c52866..084ada3 100644
--- a/chart2/source/view/main/OpenGLRender.cxx
+++ b/chart2/source/view/main/OpenGLRender.cxx
@@ -765,17 +765,19 @@ void OpenGLRender::Release()
 }
 
 
-OpenGLRender::OpenGLRender(uno::Reference< drawing::XShape > xTarget)
+OpenGLRender::OpenGLRender(uno::Reference< drawing::XShape > xTarget):
+    m_Model(glm::mat4(1.0f)),
+    m_TranslationMatrix(glm::translate(m_Model, glm::vec3(0.0f, 0.0f, 0.0f))),
+    m_RotationMatrix(glm::eulerAngleYXZ(0.0f, 0.0f, 0.0f)),
+    m_ScaleMatrix(glm::scale(m_Model, glm::vec3(1.0f, 1.0f, 1.0f))),
+    m_Line2DColor(glm::vec4(1.0, 0.0, 0.0, 1.0)),
+    m_iWidth(0),
+    m_iHeight(0),
+    m_iPointNum(0),
+    m_iFboIdx(0),
+    m_fLineAlpha(1.0),
+    mxRenderTarget(xTarget)
 {
-    //[mod] by gaowei
-    m_Model = glm::mat4(1.0f);
-    m_TranslationMatrix = glm::translate(m_Model, glm::vec3(0.0f, 0.0f, 0.0f));
-    m_ScaleMatrix = glm::scale(m_Model, glm::vec3(1.0f, 1.0f, 1.0f));
-    m_RotationMatrix = glm::eulerAngleYXZ(0.0f, 0.0f, 0.0f);
-    m_iWidth = 0;
-    m_iHeight = 0;
-    m_Line2DColor = glm::vec4(1.0, 0.0, 0.0, 1.0);
-    m_iPointNum = 0;
     memset(&m_Line2DPoitList, 0, sizeof(Line2DPointList));
     m_iFboIdx = 0;
     m_FboID[0] = 0;
@@ -784,9 +786,7 @@ OpenGLRender::OpenGLRender(uno::Reference< drawing::XShape > xTarget)
     m_TextureObj[1] = 0;
     m_RboID[0] = 0;
     m_RboID[1] = 0;
-    m_fLineAlpha = 1.0;
 
-    mxRenderTarget = xTarget;
     mxRenderTarget->setPosition(awt::Point(0,0));
 }
 OpenGLRender::~OpenGLRender()
commit 02f3848676675c46b39b8ca90181d2438dd8451b
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Wed Jan 1 17:40:29 2014 +0100

    remove one more unused method
    
    Change-Id: I6801486c09e5fdfe9a7a00c42503c3701f77cd54

diff --git a/chart2/source/view/main/OpenGLRender.cxx b/chart2/source/view/main/OpenGLRender.cxx
index 1ede766..3c52866 100644
--- a/chart2/source/view/main/OpenGLRender.cxx
+++ b/chart2/source/view/main/OpenGLRender.cxx
@@ -384,70 +384,6 @@ int OpenGLRender::InitOpenGL(GLWindow aWindow)
     return 0;
 }
 
-
-int OpenGLRender::RenderModelf(float *vertexArray, unsigned int vertexArraySize, float *colorArray, unsigned int colorArraySize)
-{
-    if (vertexArraySize != colorArraySize)
-    {
-        return -1;
-    }
-    glViewport(0, 0, m_iWidth, m_iHeight);
-    glClearDepth(1.0f);
-    glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
-    //fill vertex buffer
-    glBindBuffer(GL_ARRAY_BUFFER, m_VertexBuffer);
-    glBufferData(GL_ARRAY_BUFFER, vertexArraySize, vertexArray, GL_STATIC_DRAW);
-    //fill color buffer
-    glBindBuffer(GL_ARRAY_BUFFER, m_ColorBuffer);
-    glBufferData(GL_ARRAY_BUFFER, colorArraySize, colorArray, GL_STATIC_DRAW);
-    m_MVP = m_Projection * m_View * m_Model;
-    // Clear the screen
-    glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
-
-    // Use our shader
-    glUseProgram(m_ProgramID);
-
-    // Send our transformation to the currently bound shader,
-    // in the "MVP" uniform
-    glUniformMatrix4fv(m_MatrixID, 1, GL_FALSE, &m_MVP[0][0]);
-
-    // 1rst attribute buffer : vertices
-    glEnableVertexAttribArray(m_VertexID);
-    glBindBuffer(GL_ARRAY_BUFFER, m_VertexBuffer);
-    glVertexAttribPointer(
-        m_VertexID,                  // attribute. No particular reason for 0, but must match the layout in the shader.
-        3,                  // size
-        GL_FLOAT,           // type
-        GL_FALSE,           // normalized?
-        0,                  // stride
-        (void*)0            // array buffer offset
-        );
-    // 2nd attribute buffer : colors
-    glEnableVertexAttribArray(m_ColorID);
-    glBindBuffer(GL_ARRAY_BUFFER, m_ColorBuffer);
-    glVertexAttribPointer(
-        m_ColorID,                                // attribute. No particular reason for 1, but must match the layout in the shader.
-        3,                                // size
-        GL_FLOAT,                         // type
-        GL_FALSE,                         // normalized?
-        0,                                // stride
-        (void*)0                          // array buffer offset
-        );
-    // Draw the triangle !
-    glDrawArrays(GL_TRIANGLES, 0, vertexArraySize / sizeof(float)); // 12*3 indices starting at 0 -> 12 triangles
-
-    glDisableVertexAttribArray(m_VertexID);
-    glDisableVertexAttribArray(m_ColorID);
-    glUseProgram(0);
-#if defined( WNT )
-    SwapBuffers(glWin.hDC);
-    glFlush();
-#elif defined( UNX )
-    unx::glXSwapBuffers(glWin.dpy, glWin.win);
-#endif
-    return 0;
-}
-
 BitmapEx OpenGLRender::GetAsBitmap()
 {
     boost::scoped_array<sal_uInt8> buf(new sal_uInt8[m_iWidth * m_iHeight * 4]);
diff --git a/chart2/source/view/main/OpenGLRender.hxx b/chart2/source/view/main/OpenGLRender.hxx
index 0260cc1..ec7c6e4 100644
--- a/chart2/source/view/main/OpenGLRender.hxx
+++ b/chart2/source/view/main/OpenGLRender.hxx
@@ -126,7 +126,6 @@ public:
     int InitOpenGL(GLWindow);
     int SetViewPoint(PosVeci3 camPos, PosVeci3 orgPos, int headUpFlag);
     int MoveModelf(PosVecf3 trans, PosVecf3 angle, PosVecf3 scale);
-    int RenderModelf(float *vertexArray, unsigned int vertexArraySize, float *colorArray, unsigned int colorArraySize);
     void SetWidth(int width);
     void SetHeight(int height);
     int GetWidth();
commit 9a335eda3121921449b3c3a4e2f70e11b4d35d94
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Wed Jan 1 17:37:43 2014 +0100

    remove unused method
    
    Change-Id: I0ed8082ceb42f2b1c89571884b46bf537507abb2

diff --git a/chart2/source/view/main/OpenGLRender.cxx b/chart2/source/view/main/OpenGLRender.cxx
index f048d37..1ede766 100644
--- a/chart2/source/view/main/OpenGLRender.cxx
+++ b/chart2/source/view/main/OpenGLRender.cxx
@@ -496,102 +496,6 @@ BitmapEx OpenGLRender::GetAsBitmap()
     return aBmp;
 }
 
-int OpenGLRender::RenderModelf2FBO(float *vertexArray, unsigned int vertexArraySize, float *colorArray, unsigned int colorArraySize)
-{
-    char fileName[256] = {0};
-    sprintf(fileName, "D:\\shaderout_%d_%d.bmp", m_iWidth, m_iHeight);
-    if (vertexArraySize != colorArraySize)
-    {
-        return -1;
-    }
-    glViewport(0, 0, m_iWidth, m_iHeight);
-    glClearDepth(1.0f);
-    glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
-    // create a texture object
-    CreateTextureObj(m_iWidth, m_iHeight);
-    //create render buffer object
-    CreateRenderObj(m_iWidth, m_iHeight);
-    //create fbo
-    if ( CreateFrameBufferObj() !=0 )
-        return -1;
-    //fill vertex buffer
-    glBindBuffer(GL_ARRAY_BUFFER, m_VertexBuffer);
-    glBufferData(GL_ARRAY_BUFFER, vertexArraySize, vertexArray, GL_STATIC_DRAW);
-    //fill color buffer
-    glBindBuffer(GL_ARRAY_BUFFER, m_ColorBuffer);
-    glBufferData(GL_ARRAY_BUFFER, colorArraySize, colorArray, GL_STATIC_DRAW);
-    m_MVP = m_Projection * m_View * m_Model;
-    //bind fbo
-    glBindFramebuffer(GL_FRAMEBUFFER, m_FboID[0]);
-
-    // Clear the screen
-    glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
-
-    // Use our shader
-    glUseProgram(m_ProgramID);
-
-    // Send our transformation to the currently bound shader,
-    // in the "MVP" uniform
-    glUniformMatrix4fv(m_MatrixID, 1, GL_FALSE, &m_MVP[0][0]);
-
-    // 1rst attribute buffer : vertices
-    glEnableVertexAttribArray(m_VertexID);
-    glBindBuffer(GL_ARRAY_BUFFER, m_VertexBuffer);
-    glVertexAttribPointer(
-        m_VertexID,                  // attribute. No particular reason for 0, but must match the layout in the shader.
-        3,                  // size
-        GL_FLOAT,           // type
-        GL_FALSE,           // normalized?
-        0,                  // stride
-        (void*)0            // array buffer offset
-        );
-    // 2nd attribute buffer : colors
-    glEnableVertexAttribArray(m_ColorID);
-    glBindBuffer(GL_ARRAY_BUFFER, m_ColorBuffer);
-    glVertexAttribPointer(
-        m_ColorID,                                // attribute. No particular reason for 1, but must match the layout in the shader.
-        3,                                // size
-        GL_FLOAT,                         // type
-        GL_FALSE,                         // normalized?
-        0,                                // stride
-        (void*)0                          // array buffer offset
-        );
-    // Draw the triangle !
-    glDrawArrays(GL_TRIANGLES, 0, vertexArraySize / sizeof(float)); // 12*3 indices starting at 0 -> 12 triangles
-    glDisableVertexAttribArray(m_VertexID);
-    glDisableVertexAttribArray(m_ColorID);
-    glUseProgram(0);
-    GLenum status;
-    CHECK_GL_FRAME_BUFFER_STATUS();
-#if 0
-    sal_uInt8 *buf = (sal_uInt8 *)malloc(m_iWidth * m_iHeight * 3 + BMP_HEADER_LEN);
-    CreateBMPHeader(buf, m_iWidth, -m_iHeight);
-    glReadPixels(0, 0, m_iWidth, m_iHeight, GL_BGR, GL_UNSIGNED_BYTE, buf + BMP_HEADER_LEN);
-    FILE *pfile = fopen(fileName,"wb");
-    fwrite(buf,m_iWidth * m_iHeight * 3 + BMP_HEADER_LEN, 1, pfile);
-    free(buf);
-    fclose(pfile);
-
-#else
-    fprintf( stderr, "this RGBA guy ...\n");
-    BitmapEx aBmp = GetAsBitmap(); // unclear why we create then do nothing with this.
-#endif
-
-    glBindFramebuffer(GL_FRAMEBUFFER, 0);
-    RenderTexture(m_TextureObj[0]);
-#if 0
-    sal_uInt8 *buf = (sal_uInt8 *)malloc(m_iWidth * m_iHeight * 3);
-    glBindTexture(GL_TEXTURE_2D, m_TextureObj);
-    glGetTexImage(GL_TEXTURE_2D, 0, GL_BGR, GL_UNSIGNED_BYTE, buf);
-    FILE *pfile = fopen(fileName,"wb");
-    fwrite(buf,m_iWidth * m_iHeight * 3, 1, pfile);
-    fclose(pfile);
-    free(buf);
-    glBindTexture(GL_TEXTURE_2D, 0);
-#endif
-    return 0;
-}
-
 int OpenGLRender::SetLine2DShapePoint(float x, float y, int listLength)
 {
     if (!m_Line2DPoitList.pointBuf)
diff --git a/chart2/source/view/main/OpenGLRender.hxx b/chart2/source/view/main/OpenGLRender.hxx
index f23f0bb..0260cc1 100644
--- a/chart2/source/view/main/OpenGLRender.hxx
+++ b/chart2/source/view/main/OpenGLRender.hxx
@@ -127,7 +127,6 @@ public:
     int SetViewPoint(PosVeci3 camPos, PosVeci3 orgPos, int headUpFlag);
     int MoveModelf(PosVecf3 trans, PosVecf3 angle, PosVecf3 scale);
     int RenderModelf(float *vertexArray, unsigned int vertexArraySize, float *colorArray, unsigned int colorArraySize);
-    int RenderModelf2FBO(float *vertexArray, unsigned int vertexArraySize, float *colorArray, unsigned int colorArraySize);
     void SetWidth(int width);
     void SetHeight(int height);
     int GetWidth();
@@ -263,7 +262,7 @@ private:
     Bubble2DPointList m_Bubble2DPointList;
 
     list <Bubble2DPointList> m_Bubble2DShapePointList;
-         GLint m_CommonProID;
+    GLint m_CommonProID;
     GLint m_2DVertexID;
     GLint m_2DColorID;
 };
commit fa40bc30ee67e6b3cb5de922b91a0a5762408308
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Wed Jan 1 17:27:23 2014 +0100

    remove leftover pieces to amke factory clearly stateless again
    
    Change-Id: I0744ebed41cc1c9bbf40ef2caecb8d97baf177e6

diff --git a/chart2/source/view/inc/OpenglShapeFactory.hxx b/chart2/source/view/inc/OpenglShapeFactory.hxx
index f4f6160..313deef 100644
--- a/chart2/source/view/inc/OpenglShapeFactory.hxx
+++ b/chart2/source/view/inc/OpenglShapeFactory.hxx
@@ -16,6 +16,8 @@ namespace chart {
 
 namespace opengl {
 
+// This class is stateless!!!!!
+// Don't add member variables
 class OpenglShapeFactory : public chart::AbstractShapeFactory
 {
 public:
@@ -192,8 +194,6 @@ public:
     virtual void setPageSize( com::sun::star::uno::Reference < com::sun::star::drawing::XShapes > xChartShapes, const com::sun::star::awt::Size& rSize );
 
     virtual void render(com::sun::star::uno::Reference< com::sun::star::drawing::XShapes > xRootShape) SAL_OVERRIDE;
-private:
-    void *m_pChart;
 
 };
 
diff --git a/chart2/source/view/main/OpenglShapeFactory.cxx b/chart2/source/view/main/OpenglShapeFactory.cxx
index f10708c..16516c2 100644
--- a/chart2/source/view/main/OpenglShapeFactory.cxx
+++ b/chart2/source/view/main/OpenglShapeFactory.cxx
@@ -122,13 +122,8 @@ uno::Reference< drawing::XShapes > OpenglShapeFactory::getOrCreateChartRootShape
         uno::Reference< drawing::XShape > xTarget (m_xShapeFactory->createInstance(
                 "com.sun.star.drawing.GraphicObjectShape" ), uno::UNO_QUERY );
         dummy::DummyChart *pChart = new dummy::DummyChart(xTarget);
-        m_pChart = (void *)pChart;
         SvxDummyShapeContainer* pContainer = new SvxDummyShapeContainer(pChart);
         xRet = pChart;
-#if 0
-        xRet = new dummy::DummyChart();
-        m_pChart = (void *)((dummy::DummyChart *)xRet);
-#endif
         xDrawPage->add(xTarget);
         xDrawPage->add(pContainer);
     }
@@ -321,7 +316,6 @@ uno::Reference< drawing::XShape >
             rPosition.PositionX - (rSize.DirectionX / 2.0),
             rPosition.PositionY - (rSize.DirectionY / 2.0),
             rPosition.PositionZ );
-    dummy::DummyChart *pChart = (dummy::DummyChart *)m_pChart;
     dummy::DummyCircle* pCircle = new dummy::DummyCircle(Position3DToAWTPoint( aCenterPosition ),
             Direction3DToAWTSize( rSize ));
     xTarget->add(pCircle);
commit a31b0fb56238d42765e12cc92c4b6efaf2ac9087
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Wed Jan 1 17:25:30 2014 +0100

    add some code to list the properties for debugging
    
    Change-Id: I0ebad4112899965dea0da9da44c5f4b7b444948e

diff --git a/chart2/source/view/main/DummyXShape.cxx b/chart2/source/view/main/DummyXShape.cxx
index 3798490..9277f7f 100644
--- a/chart2/source/view/main/DummyXShape.cxx
+++ b/chart2/source/view/main/DummyXShape.cxx
@@ -24,7 +24,6 @@
 #include <tools/gen.hxx>
 #include <editeng/unoprnms.hxx>
 
-
 #include <algorithm>
 
 using namespace com::sun::star;
@@ -35,6 +34,23 @@ namespace chart {
 
 namespace dummy {
 
+namespace {
+
+struct PrintProperties
+{
+    void operator()(const std::pair<OUString, uno::Any>& rProp)
+    {
+        SAL_WARN("chart2.opengl", "Property: " << rProp.first);
+    }
+};
+
+void debugProperties(std::map<OUString, uno::Any>& rProperties)
+{
+    for_each(rProperties.begin(), rProperties.end(), PrintProperties());
+}
+
+}
+
 DummyXShape::DummyXShape():
     mpParent(NULL)
 {
@@ -361,6 +377,7 @@ DummyCircle::DummyCircle(const awt::Point& rPos, const awt::Size& rSize)
 
 void DummyCircle::render()
 {
+    debugProperties(maProperties);
     long color = 0x3465AF;
     DummyChart* pChart = getRootShape();
     pChart->m_GLRender.SetColor(color);
commit cda131b6838a7ce54b4634f9e4ac86e74f3ac17c
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Wed Jan 1 17:24:17 2014 +0100

    move Circle to OpenGl backend and out of the factory
    
    This finally makes the factory stateless again. Now it is possible again
    to render more than one chart in the OpenGL backend.
    
    Change-Id: I9d1a24dabb2bdf5aacd05cbe2931924f27aafeca

diff --git a/chart2/source/view/inc/DummyXShape.hxx b/chart2/source/view/inc/DummyXShape.hxx
index 31ff485..81a5234 100644
--- a/chart2/source/view/inc/DummyXShape.hxx
+++ b/chart2/source/view/inc/DummyXShape.hxx
@@ -185,11 +185,11 @@ public:
 protected:
 
     std::map<OUString, uno::Any> maProperties;
+    com::sun::star::awt::Point maPosition;
+    com::sun::star::awt::Size maSize;
 
 private:
     OUString maName;
-    com::sun::star::awt::Point maPosition;
-    com::sun::star::awt::Size maSize;
 
     com::sun::star::uno::Reference< com::sun::star::uno::XInterface > mxParent;
     DummyXShape* mpParent;
@@ -336,6 +336,7 @@ class DummyCircle : public DummyXShape
 public:
     DummyCircle(const awt::Point& rPosition, const awt::Size& rSize);
 
+    virtual void render() SAL_OVERRIDE;
 };
 
 class DummyLine3D : public DummyXShape
diff --git a/chart2/source/view/main/DummyXShape.cxx b/chart2/source/view/main/DummyXShape.cxx
index 78ee3f5..3798490 100644
--- a/chart2/source/view/main/DummyXShape.cxx
+++ b/chart2/source/view/main/DummyXShape.cxx
@@ -359,6 +359,16 @@ DummyCircle::DummyCircle(const awt::Point& rPos, const awt::Size& rSize)
     setSize(rSize);
 }
 
+void DummyCircle::render()
+{
+    long color = 0x3465AF;
+    DummyChart* pChart = getRootShape();
+    pChart->m_GLRender.SetColor(color);
+    pChart->m_GLRender.Bubble2DShapePoint(maPosition.X, maPosition.Y,
+                                          maSize.Width, maSize.Height);
+    pChart->m_GLRender.RenderBubble2FBO(GL_TRUE);
+}
+
 namespace {
 
 void setProperties( const VLineProperties& rLineProperties, std::map<OUString, uno::Any>& rTargetProps )
diff --git a/chart2/source/view/main/OpenglShapeFactory.cxx b/chart2/source/view/main/OpenglShapeFactory.cxx
index 484f27e..f10708c 100644
--- a/chart2/source/view/main/OpenglShapeFactory.cxx
+++ b/chart2/source/view/main/OpenglShapeFactory.cxx
@@ -322,11 +322,6 @@ uno::Reference< drawing::XShape >
             rPosition.PositionY - (rSize.DirectionY / 2.0),
             rPosition.PositionZ );
     dummy::DummyChart *pChart = (dummy::DummyChart *)m_pChart;
-    long color = 0x3465AF;
-    pChart->m_GLRender.SetColor(color);
-    pChart->m_GLRender.Bubble2DShapePoint(rPosition.PositionX, rPosition.PositionY,
-                                          rSize.DirectionX / 2.0, rSize.DirectionY / 2.0);
-    pChart->m_GLRender.RenderBubble2FBO(GL_TRUE);
     dummy::DummyCircle* pCircle = new dummy::DummyCircle(Position3DToAWTPoint( aCenterPosition ),
             Direction3DToAWTSize( rSize ));
     xTarget->add(pCircle);
commit 6da5d495e7cc8421313afb753f07a5d902a492e4
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Wed Jan 1 17:11:36 2014 +0100

    move code out of the factory into the OpenGL implementation
    
    one step closer to a stateless factory
    
    Change-Id: If491a53d9ce0d27244d4df293de7792019539c33

diff --git a/chart2/source/view/inc/DummyXShape.hxx b/chart2/source/view/inc/DummyXShape.hxx
index 915b5aa..31ff485 100644
--- a/chart2/source/view/inc/DummyXShape.hxx
+++ b/chart2/source/view/inc/DummyXShape.hxx
@@ -353,6 +353,8 @@ public:
     DummyLine2D(const drawing::PointSequenceSequence& rPoints, const VLineProperties* pProperties);
     DummyLine2D(const awt::Size& rSize, const awt::Point& rPosition);
 
+    virtual void render() SAL_OVERRIDE;
+
 private:
     drawing::PointSequenceSequence maPoints;
 };
diff --git a/chart2/source/view/main/DummyXShape.cxx b/chart2/source/view/main/DummyXShape.cxx
index 6f6c41d..78ee3f5 100644
--- a/chart2/source/view/main/DummyXShape.cxx
+++ b/chart2/source/view/main/DummyXShape.cxx
@@ -410,6 +410,55 @@ DummyLine2D::DummyLine2D(const awt::Size& rSize, const awt::Point& rPosition)
     setSize(rSize);
 }
 
+void DummyLine2D::render()
+{
+    DummyChart* pChart = getRootShape();
+    std::map< OUString, uno::Any >::const_iterator itr = maProperties.find(UNO_NAME_LINECOLOR);
+    if(itr != maProperties.end())
+    {
+        //set line color
+        uno::Any co =  itr->second;
+        sal_Int32 nColorValue = co.get<sal_Int32>();
+        SAL_WARN("chart2.opengl", "*colorvalue = " << nColorValue);
+        sal_uInt8 R = (nColorValue & 0x00FF0000) >> 16;
+        sal_uInt8 G = (nColorValue & 0x0000FF00) >> 8;
+        sal_uInt8 B = (nColorValue & 0x000000FF);
+        pChart->m_GLRender.SetLine2DColor(R, G, B);
+
+        SAL_WARN("chart2.opengl", "*colorvalue = " << nColorValue << ", R = " << R << ", G = " << G << ", B = " << B);
+    }
+    else
+        SAL_WARN("chart2.opengl", "no line color set");
+
+    //set line width
+    itr = maProperties.find(UNO_NAME_LINEWIDTH);
+    if(itr != maProperties.end())
+    {
+        uno::Any cow = itr->second;
+        sal_Int32 nWidth = cow.get<sal_Int32>();
+        pChart->m_GLRender.SetLine2DWidth(nWidth);
+
+        SAL_WARN("chart2.opengl", "width = " << nWidth);
+    }
+    else
+        SAL_WARN("chart2.opengl", "no line width set");
+
+    sal_Int32 pointsscount = maPoints.getLength();
+    for(sal_Int32 i = 0; i < pointsscount; i++)
+    {
+        com::sun::star::uno::Sequence<com::sun::star::awt::Point>& points = maPoints[i];
+        sal_Int32 pointscount = points.getLength();
+        for(sal_Int32 j = 0; j < pointscount; j++)
+        {
+            com::sun::star::awt::Point& p = points[j];
+            pChart->m_GLRender.SetLine2DShapePoint((float)p.X, (float)p.Y, pointscount);
+        }
+
+    }
+    pChart->m_GLRender.RenderLine2FBO(GL_TRUE);
+
+}
+
 DummyRectangle::DummyRectangle()
 {
 }
diff --git a/chart2/source/view/main/OpenglShapeFactory.cxx b/chart2/source/view/main/OpenglShapeFactory.cxx
index 7210035..484f27e 100644
--- a/chart2/source/view/main/OpenglShapeFactory.cxx
+++ b/chart2/source/view/main/OpenglShapeFactory.cxx
@@ -362,97 +362,6 @@ uno::Reference< drawing::XShape >
     dummy::DummyLine2D* pLine = new dummy::DummyLine2D(rPoints, pLineProperties);
     xTarget->add(pLine);
 
-    dummy::DummyChart *pChart = (dummy::DummyChart *)m_pChart;
-    if (!m_pChart)
-    {
-        SAL_WARN("chart2.opengl", "createLine2D::DummyChart = NULL");
-    }
-
-
-//create shape
-    uno::Reference< drawing::XShape > xShape(
-        m_xShapeFactory->createInstance(
-            "com.sun.star.drawing.PolyLineShape" ), uno::UNO_QUERY );
-//    xTarget->add(xShape);
-
-    //set properties
-    uno::Reference< beans::XPropertySet > xProp( xShape, uno::UNO_QUERY );
-    OSL_ENSURE(xProp.is(), "created shape offers no XPropertySet");
-    if( xProp.is())
-    {
-        try
-        {
-            //Polygon
-            xProp->setPropertyValue( UNO_NAME_POLYPOLYGON
-                , uno::makeAny( rPoints ) );
-
-            if(pLineProperties)
-            {
-                //Transparency
-                if(pLineProperties->Transparence.hasValue())
-                    xProp->setPropertyValue( UNO_NAME_LINETRANSPARENCE
-                        , pLineProperties->Transparence );
-
-                //LineStyle
-                if(pLineProperties->LineStyle.hasValue())
-                    xProp->setPropertyValue( UNO_NAME_LINESTYLE
-                        , pLineProperties->LineStyle );
-
-                //LineWidth
-                if(pLineProperties->Width.hasValue())
-                    xProp->setPropertyValue( UNO_NAME_LINEWIDTH
-                        , pLineProperties->Width );
-
-                //LineColor
-                if(pLineProperties->Color.hasValue())
-                    xProp->setPropertyValue( UNO_NAME_LINECOLOR
-                        , pLineProperties->Color );
-
-                //LineDashName
-                if(pLineProperties->DashName.hasValue())
-                    xProp->setPropertyValue( "LineDashName"
-                        , pLineProperties->DashName );
-            }
-        }
-        catch( const uno::Exception& e )
-        {
-            ASSERT_EXCEPTION( e );
-        }
-
-    }
-    //set line color
-    uno::Any co =  xProp->getPropertyValue(UNO_NAME_LINECOLOR);
-    long *colorvalue = (long*)co.getValue();
-    SAL_WARN("chart2.opengl", "*colorvalue = " << (*colorvalue));
-    sal_uInt8 R = ((*colorvalue) & 0x00FF0000) >> 16;
-    sal_uInt8 G = ((*colorvalue) & 0x0000FF00) >> 8;
-    sal_uInt8 B = ((*colorvalue) & 0x000000FF);
-    pChart->m_GLRender.SetLine2DColor(R, G, B);
-
-    SAL_WARN("chart2.opengl", "*colorvalue = " << (*colorvalue) << ", R = " << (int)R << ", G = " << (int)G << ", B = " << (int)B);
-
-    //set line width
-    uno::Any cow =  xProp->getPropertyValue(UNO_NAME_LINEWIDTH);
-    long *width = (long*)cow.getValue();
-    pChart->m_GLRender.SetLine2DWidth((int)(*width));
-
-    SAL_WARN("chart2.opengl", "width = " << (*width));
-
-    com::sun::star::uno::Sequence<drawing::PointSequence> pointss =  rPoints;
-    int pointsscount = pointss.getLength();
-    for(int i = 0; i < pointsscount; i++)
-    {
-        com::sun::star::uno::Sequence<com::sun::star::awt::Point> points = pointss[i];
-        int pointscount = points.getLength();
-        for(int j = 0; j < pointscount; j++)
-        {
-            com::sun::star::awt::Point p = points[j];
-            pChart->m_GLRender.SetLine2DShapePoint((float)p.X, (float)p.Y, pointscount);
- //           printf("point x:%ld,y:%ld\n",p.X,p.Y);
-        }
-
-    }
-    pChart->m_GLRender.RenderLine2FBO(GL_TRUE);
     return pLine;
 }
 


More information about the Libreoffice-commits mailing list