[Libreoffice-commits] core.git: Branch 'feature/chart-opengl' - 11 commits - chart2/opengl chart2/Package_opengl.mk chart2/source

Markus Mohrhard markus.mohrhard at collabora.co.uk
Sat Feb 15 05:25:00 CET 2014


 chart2/Package_opengl.mk                 |    2 
 chart2/opengl/renderFragmentShader.glsl  |   18 ---
 chart2/opengl/renderVertexShader.glsl    |   20 ----
 chart2/source/view/inc/DummyXShape.hxx   |    1 
 chart2/source/view/main/DummyXShape.cxx  |   55 +++++++----
 chart2/source/view/main/OpenGLRender.cxx |  144 +++----------------------------
 chart2/source/view/main/OpenGLRender.hxx |   30 ------
 7 files changed, 56 insertions(+), 214 deletions(-)

New commits:
commit 0d57c7b118af19f823afa3387bf462dcef0e3890
Author: Markus Mohrhard <markus.mohrhard at collabora.co.uk>
Date:   Sat Feb 15 05:13:56 2014 +0100

    last fix for chart area size and positioning
    
    It WORKS!!!!!!! The chart looks good and there are now only minor
    positioning issues. Issues that I'm aware of:
    
    * legend text is not positioned correctly
    * text seems to be positioned a bit too far to the right
    * bubble positions are incorrect
    
    Change-Id: Ib81cae13624c8119216f0bedea58b5838fcdc80c

diff --git a/chart2/source/view/main/DummyXShape.cxx b/chart2/source/view/main/DummyXShape.cxx
index 85327f8..f71db06 100644
--- a/chart2/source/view/main/DummyXShape.cxx
+++ b/chart2/source/view/main/DummyXShape.cxx
@@ -822,7 +822,7 @@ awt::Point DummyGroup2D::getPosition()
         }
     }
 
-    return awt::Point(nTop, nLeft);
+    return awt::Point(nLeft, nTop);
 }
 
 awt::Size DummyGroup2D::getSize()
commit 1e90acaa4e7606862a0bf962074165ddf9ac56e0
Author: Markus Mohrhard <markus.mohrhard at collabora.co.uk>
Date:   Sat Feb 15 03:58:04 2014 +0100

    fix OpenGL resource leak
    
    Change-Id: I56d00381dc023273c406a134c0828bda89d4d6b2

diff --git a/chart2/source/view/main/OpenGLRender.cxx b/chart2/source/view/main/OpenGLRender.cxx
index 096149c..6983622 100755
--- a/chart2/source/view/main/OpenGLRender.cxx
+++ b/chart2/source/view/main/OpenGLRender.cxx
@@ -634,6 +634,7 @@ void OpenGLRender::Release()
 {
     glDeleteBuffers(1, &m_VertexBuffer);
     glDeleteBuffers(1, &m_ColorBuffer);
+    glDeleteBuffers(1, &m_TextTexCoordBuf);
     glDeleteProgram(m_CommonProID);
     glDeleteProgram(m_TextProID);
     glDeleteProgram(m_BackgroundProID);
commit fe573fe0a2c095856353d39365c00b278dd4dda6
Author: Markus Mohrhard <markus.mohrhard at collabora.co.uk>
Date:   Sat Feb 15 03:47:55 2014 +0100

    remove unused shader
    
    Change-Id: Ib30ff20e099f4b3403a3ca7689f7d8d75d888763

diff --git a/chart2/Package_opengl.mk b/chart2/Package_opengl.mk
index 9c3a663..ef33ebb 100644
--- a/chart2/Package_opengl.mk
+++ b/chart2/Package_opengl.mk
@@ -16,8 +16,6 @@ $(eval $(call gb_Package_add_files,chart2_opengl_shader,$(LIBO_BIN_FOLDER)/openg
 	commonVertexShader.glsl \
 	debugFragmentShader.glsl \
 	debugVertexShader.glsl \
-	renderFragmentShader.glsl \
-	renderVertexShader.glsl \
 	symbolFragmentShader.glsl \
 	symbolVertexShader.glsl \
 	textFragmentShader.glsl \
diff --git a/chart2/opengl/renderFragmentShader.glsl b/chart2/opengl/renderFragmentShader.glsl
deleted file mode 100644
index a6c71f4..0000000
--- a/chart2/opengl/renderFragmentShader.glsl
+++ /dev/null
@@ -1,18 +0,0 @@
-/* -*- 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/.
- */
-
-uniform sampler2D RenderTex;
-varying vec2 vTexCoord;
-
-void main()
-{
-    gl_FragColor = vec4(texture2D(RenderTex, vTexCoord).rgb, 1.0);
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/chart2/opengl/renderVertexShader.glsl b/chart2/opengl/renderVertexShader.glsl
deleted file mode 100644
index 8c55629..0000000
--- a/chart2/opengl/renderVertexShader.glsl
+++ /dev/null
@@ -1,20 +0,0 @@
-/* -*- 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 vec4 vPosition;
-attribute vec2 texCoord;
-varying vec2 vTexCoord;
-
-void main()
-{
-    gl_Position =  vPosition;
-    vTexCoord = texCoord;
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit 8150381d9dc9f4a75cf52629087a2d390d4b3d91
Author: Markus Mohrhard <markus.mohrhard at collabora.co.uk>
Date:   Sat Feb 15 03:46:52 2014 +0100

    remove more unused code
    
    Change-Id: I36ec2e2960072120a064805f171e20703f0508c0

diff --git a/chart2/source/view/main/OpenGLRender.cxx b/chart2/source/view/main/OpenGLRender.cxx
index 2f472d8..096149c 100755
--- a/chart2/source/view/main/OpenGLRender.cxx
+++ b/chart2/source/view/main/OpenGLRender.cxx
@@ -281,13 +281,6 @@ int OpenGLRender::InitOpenGL(GLWindow aWindow)
 
     CHECK_GL_ERROR();
 
-    m_RenderProID = LoadShaders("renderVertexShader", "renderFragmentShader");
-    m_RenderVertexID = glGetAttribLocation(m_RenderProID, "vPosition");
-    m_RenderTexCoordID = glGetAttribLocation(m_RenderProID, "texCoord");
-    m_RenderTexID = glGetUniformLocation(m_RenderProID, "RenderTex");
-
-    CHECK_GL_ERROR();
-
     m_CommonProID = LoadShaders("commonVertexShader", "commonFragmentShader");
     m_MatrixID = glGetUniformLocation(m_CommonProID, "MVP");
     m_2DVertexID = glGetAttribLocation(m_CommonProID, "vPosition");
@@ -323,15 +316,6 @@ int OpenGLRender::InitOpenGL(GLWindow aWindow)
 
     CHECK_GL_ERROR();
 
-    glGenBuffers(1, &m_RenderVertexBuf);
-    glBindBuffer(GL_ARRAY_BUFFER, m_RenderVertexBuf);
-    glBindBuffer(GL_ARRAY_BUFFER, 0);
-
-    glGenBuffers(1, &m_RenderTexCoordBuf);
-    glBindBuffer(GL_ARRAY_BUFFER, m_RenderTexCoordBuf);
-    glBufferData(GL_ARRAY_BUFFER, sizeof(texCoords), texCoords, GL_STATIC_DRAW);
-    glBindBuffer(GL_ARRAY_BUFFER, 0);
-
     glGenBuffers(1, &m_TextTexCoordBuf);
     glBindBuffer(GL_ARRAY_BUFFER, m_TextTexCoordBuf);
     glBufferData(GL_ARRAY_BUFFER, sizeof(texCoords), texCoords, GL_STATIC_DRAW);
@@ -650,9 +634,6 @@ void OpenGLRender::Release()
 {
     glDeleteBuffers(1, &m_VertexBuffer);
     glDeleteBuffers(1, &m_ColorBuffer);
-    glDeleteBuffers(1, &m_RenderVertexBuf);
-    glDeleteBuffers(1, &m_RenderTexCoordBuf);
-    glDeleteProgram(m_RenderProID);
     glDeleteProgram(m_CommonProID);
     glDeleteProgram(m_TextProID);
     glDeleteProgram(m_BackgroundProID);
@@ -704,7 +685,7 @@ OpenGLRender::OpenGLRender(uno::Reference< drawing::XShape > xTarget)
     , m_TextProID(0)
     , m_TextMatrixID(0)
     , m_TextVertexID(0)
-    , m_TextTexCoordID(1)
+    , m_TextTexCoordID(0)
     , m_TextTexCoordBuf(0)
     , m_TextTexID(0)
     , m_BackgroundProID(0)
diff --git a/chart2/source/view/main/OpenGLRender.hxx b/chart2/source/view/main/OpenGLRender.hxx
index cd2d8bc..2a934cf 100755
--- a/chart2/source/view/main/OpenGLRender.hxx
+++ b/chart2/source/view/main/OpenGLRender.hxx
@@ -205,25 +205,12 @@ private:
     // Our ModelViewProjection : multiplication of our 3 matrices
     glm::mat4 m_MVP;
 
-    GLint m_RenderProID;
-
-
     GLuint m_VertexBuffer;
 
     GLuint m_ColorBuffer;
 
     GLint m_MatrixID;
 
-    GLint m_RenderVertexID;
-
-    GLint m_RenderTexCoordID;
-
-    GLint m_RenderTexID;
-
-    GLuint m_RenderVertexBuf;
-
-    GLuint m_RenderTexCoordBuf;
-
     GLuint m_TextureObj;
 
     GLuint m_FboID;
commit 03b3f412da9e435c163ea0003c4a114eb38d8afe
Author: Markus Mohrhard <markus.mohrhard at collabora.co.uk>
Date:   Sat Feb 15 03:32:53 2014 +0100

    remove more unused code
    
    Change-Id: I57c5bc1fd436df4e917d460a31d671e361fd47b3

diff --git a/chart2/source/view/main/OpenGLRender.cxx b/chart2/source/view/main/OpenGLRender.cxx
index 3d571b0..2f472d8 100755
--- a/chart2/source/view/main/OpenGLRender.cxx
+++ b/chart2/source/view/main/OpenGLRender.cxx
@@ -1251,7 +1251,7 @@ int OpenGLRender::RenderRectangleShape(bool bBorder, bool bFill)
 }
 
 
-int OpenGLRender::CreateTextTexture(const BitmapEx& rBitmapEx, awt::Point aPos, awt::Size aSize, long rotation,
+int OpenGLRender::CreateTextTexture(const BitmapEx& rBitmapEx, const awt::Point&, const awt::Size& aSize, long rotation,
         const drawing::HomogenMatrix3& rTrans)
 {
     glm::mat3 aTrans(rTrans.Line1.Column1, rTrans.Line1.Column2, rTrans.Line1.Column3,
@@ -1295,9 +1295,6 @@ int OpenGLRender::CreateTextTexture(const BitmapEx& rBitmapEx, awt::Point aPos,
     }
 
     TextInfo aTextInfo;
-    aTextInfo.x = (float)(aPos.X + aSize.Width / 2);
-    aTextInfo.y = (float)(aPos.Y + aSize.Height / 2);
-    aTextInfo.z = m_fZStep;
     aTextInfo.rotation = -(double)rotation * GL_PI / 18000.0f;
     aTextInfo.vertex[0] = rTrans.Line1.Column3 / OPENGL_SCALE_VALUE;
     aTextInfo.vertex[1] = rTrans.Line2.Column3 / OPENGL_SCALE_VALUE;
@@ -1318,19 +1315,7 @@ int OpenGLRender::CreateTextTexture(const BitmapEx& rBitmapEx, awt::Point aPos,
     //if has ratotion, we must re caculate the central pos
     if (!rtl::math::approxEqual(0, rotation))
     {
-        //use left top
-        double r = sqrt((double)(aSize.Width * aSize.Width + aSize.Height * aSize.Height)) / 2;
-        double sinOrgAngle =  aTextInfo.vertex[1] / r / 2;
-        double cosOrgAngle = aTextInfo.vertex[0] / r / 2;
-        double sinDiataAngle = sin(aTextInfo.rotation);
-        double cosDiataAngle = cos(aTextInfo.rotation);
-        double x = r * (cosOrgAngle * cosDiataAngle - sinOrgAngle * sinDiataAngle);
-        double y = r * (sinOrgAngle * cosDiataAngle + cosOrgAngle * sinDiataAngle);
-        double diataX = x - aTextInfo.vertex[0];
-        double diataY = y - aTextInfo.vertex[1];
-        aTextInfo.x = aTextInfo.x - diataX;
-        aTextInfo.y = aTextInfo.y - diataY;
-
+        // handle rotation
     }
 
     CHECK_GL_ERROR();
@@ -1688,6 +1673,7 @@ int OpenGLRender::RenderSymbol2DShape(float x, float y, float , float , sal_Int3
             0,                  // stride
             (void*)0            // array buffer offset
             );
+
     glDrawArrays(GL_POINTS, 0, 1);
 
     glDisableVertexAttribArray(m_SymbolVertexID);
diff --git a/chart2/source/view/main/OpenGLRender.hxx b/chart2/source/view/main/OpenGLRender.hxx
index fb66cc3..cd2d8bc 100755
--- a/chart2/source/view/main/OpenGLRender.hxx
+++ b/chart2/source/view/main/OpenGLRender.hxx
@@ -79,9 +79,6 @@ struct RectanglePointList
 struct TextInfo
 {
     GLuint texture;
-    float x;
-    float y;
-    float z;
     double rotation;
     float vertex[12];
 };
@@ -168,8 +165,8 @@ public:
     int RectangleShapePoint(float x, float y, float directionX, float directionY);
 
     int CreateTextTexture(const BitmapEx& rBitmapEx,
-            com::sun::star::awt::Point aPos, com::sun::star::awt::Size aSize, long rotation,
-            const com::sun::star::drawing::HomogenMatrix3& rTrans);
+            const com::sun::star::awt::Point& aPos, const com::sun::star::awt::Size& aSize,
+            long rotation, const com::sun::star::drawing::HomogenMatrix3& rTrans);
     int RenderTextShape();
 
     int SetArea2DShapePoint(float x, float y, int listLength);
commit 17997474e6187575518c37669bca8b7e00e0e2ea
Author: Markus Mohrhard <markus.mohrhard at collabora.co.uk>
Date:   Sat Feb 15 03:24:45 2014 +0100

    set transformation matrix as property with fixed size
    
    Change-Id: I3853ea0f6f3b82dc6ea7b402dec58d528b639684

diff --git a/chart2/source/view/inc/DummyXShape.hxx b/chart2/source/view/inc/DummyXShape.hxx
index 4ce530a..3a9dccb 100644
--- a/chart2/source/view/inc/DummyXShape.hxx
+++ b/chart2/source/view/inc/DummyXShape.hxx
@@ -355,7 +355,6 @@ private:
         chart2::XFormattedString > > maFormattedString;
 };
 
-
 class DummyXShapes : public DummyXShape, public com::sun::star::drawing::XShapes
 {
 public:
diff --git a/chart2/source/view/main/DummyXShape.cxx b/chart2/source/view/main/DummyXShape.cxx
index 228cdac..85327f8 100644
--- a/chart2/source/view/main/DummyXShape.cxx
+++ b/chart2/source/view/main/DummyXShape.cxx
@@ -742,6 +742,11 @@ DummyText::DummyText(const OUString& rText, const tNameSequence& rNames,
         drawing::HomogenMatrix3 aTrans = rTrans.get<drawing::HomogenMatrix3>();
         setSize(awt::Size(20*bmpWidth, 20*bmpHeight));
         setPosition(awt::Point(aTrans.Line1.Column3, aTrans.Line2.Column3));
+        aTrans.Line1.Column1 = 20 * bmpWidth;
+        aTrans.Line2.Column2 = 20 * bmpHeight;
+        uno::Any aNewTrans;
+        aNewTrans <<= aTrans;
+        setPropertyValue("Transformation", aNewTrans);
     }
     else
         setSize(awt::Size(20*bmpWidth, 20*bmpHeight));
commit e0af6d89ef9c38ca8b30cfde7cf3d641da124053
Author: Markus Mohrhard <markus.mohrhard at collabora.co.uk>
Date:   Sat Feb 15 03:24:04 2014 +0100

    remove unused functions
    
    Change-Id: I5e176c705cc373333831e4b833386ed707418d2e

diff --git a/chart2/source/view/main/OpenGLRender.cxx b/chart2/source/view/main/OpenGLRender.cxx
index 65e63f4e..3d571b0 100755
--- a/chart2/source/view/main/OpenGLRender.cxx
+++ b/chart2/source/view/main/OpenGLRender.cxx
@@ -588,95 +588,6 @@ void OpenGLRender::renderToBitmap()
     glFlush();
 }
 
-int OpenGLRender::RenderTexture2FBO(GLuint TexID)
-{
-    CHECK_GL_ERROR();
-    glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
-    glDepthMask(GL_FALSE);
-    glUseProgram(m_RenderProID);
-    glEnableVertexAttribArray(m_RenderVertexID);
-    glBindBuffer(GL_ARRAY_BUFFER, m_RenderVertexBuf);
-    glVertexAttribPointer(
-        m_RenderVertexID,                  // 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
-        );
-    glEnableVertexAttribArray(m_RenderTexCoordID);
-    glBindBuffer(GL_ARRAY_BUFFER, m_RenderTexCoordBuf);
-    glVertexAttribPointer(
-        m_RenderTexCoordID,                  // attribute. No particular reason for 0, but must match the layout in the shader.
-        2,                  // size
-        GL_FLOAT,           // type
-        GL_FALSE,           // normalized?
-        0,                  // stride
-        (void*)0            // array buffer offset
-        );
-    glBindTexture(GL_TEXTURE_2D, TexID);
-    glUniform1i(m_RenderTexID, 0);
-    //TODO: moggi: get rid fo GL_QUADS
-    glDrawArrays(GL_QUADS, 0, 4);
-    glDisableVertexAttribArray(m_RenderTexCoordID);
-    glDisableVertexAttribArray(m_RenderVertexID);
-    glBindTexture(GL_TEXTURE_2D, 0);
-    glUseProgram(0);
-    glDepthMask(GL_TRUE);
-    CHECK_GL_ERROR();
-
-    m_fZStep += Z_STEP;
-    return 0;
-}
-
-
-int OpenGLRender::RenderTexture(GLuint TexID)
-{
-    glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
-
-    glUseProgram(m_RenderProID);
-
-    glEnableVertexAttribArray(m_RenderVertexID);
-    glBindBuffer(GL_ARRAY_BUFFER, m_RenderVertexBuf);
-    glVertexAttribPointer(
-        m_RenderVertexID,                  // 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
-        );
-    glEnableVertexAttribArray(m_RenderTexCoordID);
-    glBindBuffer(GL_ARRAY_BUFFER, m_RenderTexCoordBuf);
-    glVertexAttribPointer(
-        m_RenderTexCoordID,                  // attribute. No particular reason for 0, but must match the layout in the shader.
-        2,                  // size
-        GL_FLOAT,           // type
-        GL_FALSE,           // normalized?
-        0,                  // stride
-        (void*)0            // array buffer offset
-        );
-    glBindTexture(GL_TEXTURE_2D, TexID);
-    glUniform1i(m_RenderTexID, 0);
-    //TODO: moggi: get rid fo GL_QUADS
-    glDrawArrays(GL_QUADS, 0, 4);
-    glDisableVertexAttribArray(m_RenderTexCoordID);
-    glDisableVertexAttribArray(m_RenderVertexID);
-    glBindTexture(GL_TEXTURE_2D, 0);
-    glUseProgram(0);
-#if defined( WNT )
-    SwapBuffers(glWin.hDC);
-#elif defined( MACOSX )
-
-#elif defined( UNX )
-    glXSwapBuffers(glWin.dpy, glWin.win);
-#endif
-    glFlush();
-    m_fZStep += Z_STEP;
-    return 0;
-}
-
-
 int OpenGLRender::CreateTextureObj(int width, int height)
 {
     glGenTextures(1, &m_TextureObj);
diff --git a/chart2/source/view/main/OpenGLRender.hxx b/chart2/source/view/main/OpenGLRender.hxx
index a67309d..fb66cc3 100755
--- a/chart2/source/view/main/OpenGLRender.hxx
+++ b/chart2/source/view/main/OpenGLRender.hxx
@@ -191,8 +191,6 @@ private:
     int CreateTextureObj(int width, int height);
     int CreateRenderObj(int width, int height);
     int CreateFrameBufferObj();
-    int RenderTexture(GLuint TexID);
-    int RenderTexture2FBO(GLuint TexID);
 #if defined( _WIN32 )
     int InitTempWindow(HWND *hwnd, int width, int height, PIXELFORMATDESCRIPTOR inPfd);
     bool WGLisExtensionSupported(const char *extension);
commit db655c3f4fe569967034ee7a6c26a77252599d80
Author: Markus Mohrhard <markus.mohrhard at collabora.co.uk>
Date:   Sat Feb 15 03:05:34 2014 +0100

    fix OpenGL text rendering
    
    Change-Id: Ia5dd022d8b79d4276a92bcf741196137d5e9d36e

diff --git a/chart2/source/view/main/OpenGLRender.cxx b/chart2/source/view/main/OpenGLRender.cxx
index 1f07b46..65e63f4e 100755
--- a/chart2/source/view/main/OpenGLRender.cxx
+++ b/chart2/source/view/main/OpenGLRender.cxx
@@ -221,6 +221,17 @@ GLint OpenGLRender::LoadShaders(const OUString& rVertexShaderName,const OUString
     return ProgramID;
 }
 
+namespace {
+
+GLfloat texCoords[] = {
+    0.0f, 0.0f,
+    1.0f, 0.0f,
+    1.0f, 1.0f,
+    0.0f, 1.0f
+};
+
+}
+
 int OpenGLRender::InitOpenGL(GLWindow aWindow)
 {
     glWin = aWindow;
@@ -318,10 +329,12 @@ int OpenGLRender::InitOpenGL(GLWindow aWindow)
 
     glGenBuffers(1, &m_RenderTexCoordBuf);
     glBindBuffer(GL_ARRAY_BUFFER, m_RenderTexCoordBuf);
+    glBufferData(GL_ARRAY_BUFFER, sizeof(texCoords), texCoords, GL_STATIC_DRAW);
     glBindBuffer(GL_ARRAY_BUFFER, 0);
 
     glGenBuffers(1, &m_TextTexCoordBuf);
     glBindBuffer(GL_ARRAY_BUFFER, m_TextTexCoordBuf);
+    glBufferData(GL_ARRAY_BUFFER, sizeof(texCoords), texCoords, GL_STATIC_DRAW);
     glBindBuffer(GL_ARRAY_BUFFER, 0);
 
 #if defined( WNT )
@@ -1480,7 +1493,7 @@ int OpenGLRender::RenderTextShape()
         glUniform1i(m_TextTexID, 0);
         CHECK_GL_ERROR();
         //TODO: moggi: get rid fo GL_QUADS
-        glDrawArrays(GL_QUADS, 0, 3);
+        glDrawArrays(GL_QUADS, 0, 4);
         CHECK_GL_ERROR();
         glDisableVertexAttribArray(m_TextTexCoordID);
         CHECK_GL_ERROR();
commit 0106e8c0f48558212d7a9649f8f624add0549e5c
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Fri Feb 14 10:48:48 2014 +0100

    Fix GLEW debug stuff for Windows
    
    Conflicts:
    	chart2/source/view/main/OpenGLRender.hxx
    
    Change-Id: I5fd3df862b59a621af1e3f965abc9820dba08c3f

diff --git a/chart2/source/view/main/DummyXShape.cxx b/chart2/source/view/main/DummyXShape.cxx
index b8f4018..228cdac 100644
--- a/chart2/source/view/main/DummyXShape.cxx
+++ b/chart2/source/view/main/DummyXShape.cxx
@@ -1144,8 +1144,12 @@ int oglErrorHandler( Display* /*dpy*/, XErrorEvent* /*evnt*/ )
 
 namespace {
 
-void debug_callback(GLenum source, GLenum type, GLuint id,
-        GLenum severity, GLsizei , const GLchar* message, void* )
+extern "C" void
+#if defined _WIN32
+APIENTRY
+#endif
+debug_callback(GLenum source, GLenum type, GLuint id,
+        GLenum severity, GLsizei , const GLchar* message, GLvoid* )
 {
     SAL_WARN("chart2.opengl", "OpenGL debug message: source: " << source << ", type: "
             << type << ", id: " << id << ", severity: " << severity << " with message: " << message);
diff --git a/chart2/source/view/main/OpenGLRender.hxx b/chart2/source/view/main/OpenGLRender.hxx
index 32c91c5..a67309d 100755
--- a/chart2/source/view/main/OpenGLRender.hxx
+++ b/chart2/source/view/main/OpenGLRender.hxx
@@ -18,13 +18,7 @@
 #  include "postwin.h"
 #endif
 
-#if defined( MACOSX )
-#  include <OpenGL/gl.h>
-#  include <OpenGL/glu.h>
-#else
-#  include <GL/gl.h>
-#  include <GL/glu.h>
-#endif
+#include <GL/glew.h>
 
 #include <vcl/window.hxx>
 #include <vcl/syschild.hxx>
commit 37a7d8e68f23afc17a9f39542c9f7cfda9ce2a39
Author: Markus Mohrhard <markus.mohrhard at collabora.co.uk>
Date:   Thu Feb 13 04:39:21 2014 +0100

    add native OpenGL debug output for dbgutil builds
    
    depends on support of ARB_debug_output
    
    Change-Id: I8c96284377e2cb9d2ee06ddd4101c1de4d0fbe9f

diff --git a/chart2/source/view/main/DummyXShape.cxx b/chart2/source/view/main/DummyXShape.cxx
index d9c1a90..b8f4018 100644
--- a/chart2/source/view/main/DummyXShape.cxx
+++ b/chart2/source/view/main/DummyXShape.cxx
@@ -1140,6 +1140,21 @@ int oglErrorHandler( Display* /*dpy*/, XErrorEvent* /*evnt*/ )
 
 #endif
 
+#if DBG_UTIL
+
+namespace {
+
+void debug_callback(GLenum source, GLenum type, GLuint id,
+        GLenum severity, GLsizei , const GLchar* message, void* )
+{
+    SAL_WARN("chart2.opengl", "OpenGL debug message: source: " << source << ", type: "
+            << type << ", id: " << id << ", severity: " << severity << " with message: " << message);
+}
+
+}
+
+#endif
+
 bool DummyChart::initOpengl()
 {
     SAL_WARN("chart2.opengl", "DummyChart::initOpengl----start");
@@ -1253,6 +1268,16 @@ bool DummyChart::initOpengl()
 
     m_GLRender.InitOpenGL(GLWin);
 
+#if DBG_UTIL
+    // only enable debug output in dbgutil build
+    if( GLEW_ARB_debug_output )
+    {
+        glEnable(GL_DEBUG_OUTPUT);
+        glDebugMessageCallback(&debug_callback, NULL);
+    }
+
+#endif
+
     glEnable(GL_TEXTURE_2D);
     glEnable(GL_CULL_FACE);
     glCullFace(GL_BACK);
commit 5b58d9717eed97ba8e7644368adeea157f996448
Author: Markus Mohrhard <markus.mohrhard at collabora.co.uk>
Date:   Thu Feb 13 04:10:50 2014 +0100

    remove unused enum
    
    Change-Id: Ib5cc05f20fad673c015700657f02a07659e0c566

diff --git a/chart2/source/view/main/DummyXShape.cxx b/chart2/source/view/main/DummyXShape.cxx
index f701314..d9c1a90 100644
--- a/chart2/source/view/main/DummyXShape.cxx
+++ b/chart2/source/view/main/DummyXShape.cxx
@@ -41,25 +41,6 @@ using namespace com::sun::star;
 
 using namespace std;
 
-enum SymbolEnum { Symbol_Square=0
-                 , Symbol_Diamond
-                 , Symbol_DownArrow
-                 , Symbol_UpArrow
-                 , Symbol_RightArrow
-                 , Symbol_LeftArrow
-                 , Symbol_Bowtie
-                 , Symbol_Sandglass
-                 , Symbol_Circle
-                 , Symbol_Star
-                 , Symbol_X
-                 , Symbol_Plus
-                 , Symbol_Asterisk
-                 , Symbol_HorizontalBar
-                 , Symbol_VerticalBar
-                 , Symbol_COUNT
-};
-
-
 namespace chart {
 
 namespace dummy {


More information about the Libreoffice-commits mailing list