[Libreoffice-commits] core.git: Branch 'private/moggi/opengl-3D-bar-rendering' - 3 commits - chart2/source vcl/source
Markus Mohrhard
markus.mohrhard at collabora.co.uk
Mon Mar 31 01:56:42 PDT 2014
chart2/source/view/main/3DChartObjects.hxx | 71 -----------------------------
chart2/source/view/main/OpenGLRender.cxx | 21 --------
vcl/source/opengl/OpenGLContext.cxx | 18 +++----
3 files changed, 10 insertions(+), 100 deletions(-)
New commits:
commit 0105c27a93dcb91dcd1eeb3f1a7c4d7f7692f28a
Author: Markus Mohrhard <markus.mohrhard at collabora.co.uk>
Date: Mon Mar 31 10:53:57 2014 +0200
remove file
Change-Id: I74d1116ae0d5f99bcfbbe67ec1ecbe1a5a89ad8f
diff --git a/chart2/source/view/main/3DChartObjects.hxx b/chart2/source/view/main/3DChartObjects.hxx
deleted file mode 100644
index ec56ad8..0000000
--- a/chart2/source/view/main/3DChartObjects.hxx
+++ /dev/null
@@ -1,71 +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/.
- */
-
-#include <glm/glm.hpp>
-
-#include <tools/color.hxx>
-#include <vcl/bitmapex.hxx>
-
-namespace chart {
-
-namespace opengl3D {
-
-class Renderable3DObject
-{
-public:
-
- virtual ~Renderable3DObject() {};
-
- virtual void render() {}
-};
-
-class Bar : public Renderable3DObject
-{
-public:
- Bar( const glm::mat4& rPosition );
-private:
- bool mbRoundedCorners;
- glm::mat4 maPos;
- Color maColor; // RGBA fill color
- sal_Int32 nUniqueId;
-};
-
-class Line : public Renderable3DObject
-{
-private:
- glm::vec3 maPosBegin;
- glm::vec3 maPosEnd;
- Color maLineColor; // RGBA line color
- sal_Int32 nUniqueId;
-};
-
-class Text : public Renderable3DObject
-{
-private:
- BitmapEx maText;
- glm::vec3 maTopLeft;
- glm::vec3 maBottomRight;
- sal_Int32 nUniqueId;
-};
-
-class Rectangle : public Renderable3DObject
-{
-private:
- glm::vec3 maTopLeft;
- glm::vec3 maBottomRight;
- sal_Int32 nUniqueId;
- Color maColor; // RGBA fill color
- Color maLineColor; // RGBA line color
-};
-
-}
-
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit 5c6081b09cabc5cd32835fbdee6c4af5fe683095
Author: Markus Mohrhard <markus.mohrhard at collabora.co.uk>
Date: Mon Mar 31 04:03:12 2014 +0200
OSL_TRACE to SAL_INFO in opengl code
Change-Id: I7bdefec1cf941d1a51b7777639c0979387e1b436
diff --git a/vcl/source/opengl/OpenGLContext.cxx b/vcl/source/opengl/OpenGLContext.cxx
index 560ff03..06920fa 100644
--- a/vcl/source/opengl/OpenGLContext.cxx
+++ b/vcl/source/opengl/OpenGLContext.cxx
@@ -336,7 +336,7 @@ bool OpenGLContext::init( Window* pParent )
GL_TRUE);
if( m_aGLWin.ctx == NULL )
{
- OSL_TRACE("unable to create GLX context");
+ SAL_INFO("vcl.opengl", "unable to create GLX context");
return false;
}
#endif
@@ -384,7 +384,7 @@ bool OpenGLContext::init( Window* pParent )
#elif defined( UNX )
if( !glXMakeCurrent( m_aGLWin.dpy, m_aGLWin.win, m_aGLWin.ctx ) )
{
- OSL_TRACE("unable to select current GLX context");
+ SAL_INFO("vcl.opengl", "unable to select current GLX context");
return false;
}
@@ -392,10 +392,10 @@ bool OpenGLContext::init( Window* pParent )
double nGLXVersion = 0;
if( glXQueryVersion( m_aGLWin.dpy, &glxMajor, &glxMinor ) )
nGLXVersion = glxMajor + 0.1*glxMinor;
- OSL_TRACE("available GLX version: %f", nGLXVersion);
+ SAL_INFO("vcl.opengl", "available GLX version: %f", nGLXVersion);
m_aGLWin.GLExtensions = glGetString( GL_EXTENSIONS );
- OSL_TRACE("available GL extensions: %s", m_aGLWin.GLExtensions);
+ SAL_INFO("vcl.opengl", "available GL extensions: %s", m_aGLWin.GLExtensions);
if( m_aGLWin.HasGLXExtension("GLX_SGI_swap_control" ) )
{
@@ -417,9 +417,9 @@ bool OpenGLContext::init( Window* pParent )
XSync(m_aGLWin.dpy, false);
if( errorTriggered )
- OSL_TRACE("error when trying to set swap interval, NVIDIA or Mesa bug?");
+ SAL_INFO("vcl.opengl", "error when trying to set swap interval, NVIDIA or Mesa bug?");
else
- OSL_TRACE("set swap interval to 1 (enable vsync)");
+ SAL_INFO("vcl.opengl", "set swap interval to 1 (enable vsync)");
// restore the error handler
XSetErrorHandler( oldHandler );
@@ -514,7 +514,7 @@ bool OpenGLContext::initWindow()
m_aGLWin.win = sysData->aWindow;
- OSL_TRACE("parent window: %d", m_aGLWin.win);
+ SAL_INFO("vcl.opengl", "parent window: %d", m_aGLWin.win);
XWindowAttributes xattr;
XGetWindowAttributes( m_aGLWin.dpy, m_aGLWin.win, &xattr );
@@ -577,7 +577,7 @@ bool OpenGLContext::initWindow()
{
SystemWindowData winData;
winData.nSize = sizeof(winData);
- OSL_TRACE("using VisualID %08X", vi->visualid);
+ SAL_INFO("vcl.opengl", "using VisualID %08X", vi->visualid);
winData.pVisual = (void*)(vi->visual);
m_pChildWindow.reset(new SystemChildWindow(m_pWindow.get(), 0, &winData, false));
pChildSysData = m_pChildWindow->GetSystemData();
@@ -596,7 +596,7 @@ bool OpenGLContext::initWindow()
m_aGLWin.win = pChildSysData->aWindow;
m_aGLWin.vi = vi;
m_aGLWin.GLXExtensions = glXQueryExtensionsString( m_aGLWin.dpy, m_aGLWin.screen );
- OSL_TRACE("available GLX extensions: %s", m_aGLWin.GLXExtensions);
+ SAL_INFO("vcl.opengl", "available GLX extensions: %s", m_aGLWin.GLXExtensions);
return true;
}
commit 86a4e128f7c8e2f68958b66431fd9cde98842483
Author: Markus Mohrhard <markus.mohrhard at collabora.co.uk>
Date: Mon Mar 31 03:57:31 2014 +0200
no need to swap buffers in the offscreen rendering
Change-Id: Ibe25afaa71acc0a0c8995c6f0644eb08fe8920cf
diff --git a/chart2/source/view/main/OpenGLRender.cxx b/chart2/source/view/main/OpenGLRender.cxx
index 76c19cb..a0f7573 100755
--- a/chart2/source/view/main/OpenGLRender.cxx
+++ b/chart2/source/view/main/OpenGLRender.cxx
@@ -327,14 +327,6 @@ int OpenGLRender::InitOpenGL(GLWindow aWindow)
glBufferData(GL_ARRAY_BUFFER, sizeof(texCoords), texCoords, GL_STATIC_DRAW);
glBindBuffer(GL_ARRAY_BUFFER, 0);
-#if defined( WNT )
- SwapBuffers(glWin.hDC);
-#elif defined( MACOSX )
-
-#elif defined( UNX )
- glXSwapBuffers(glWin.dpy, glWin.win);
-#endif
- glFlush();
glEnable(GL_LIGHTING);
GLfloat light_direction[] = { 0.0 , 0.0 , 1.0 };
GLfloat materialDiffuse[] = { 1.0 , 1.0 , 1.0 , 1.0};
@@ -569,14 +561,6 @@ void OpenGLRender::renderToBitmap()
mxRenderTarget->setPosition(awt::Point(0,0));
#endif
glBindFramebuffer(GL_FRAMEBUFFER, 0);
-#if defined( WNT )
- SwapBuffers(glWin.hDC);
-#elif defined( MACOSX )
-
-#elif defined( UNX )
- glXSwapBuffers(glWin.dpy, glWin.win);
-#endif
- glFlush();
}
int OpenGLRender::CreateTextureObj(int width, int height)
@@ -946,7 +930,6 @@ int OpenGLRender::RectangleShapePoint(float x, float y, float directionX, float
return 0;
}
-
int OpenGLRender::RenderRectangleShape(bool bBorder, bool bFill)
{
size_t listNum = m_RectangleShapePointList.size();
@@ -1057,7 +1040,6 @@ int OpenGLRender::RenderRectangleShape(bool bBorder, bool bFill)
return 0;
}
-
int OpenGLRender::CreateTextTexture(const BitmapEx& rBitmapEx, const awt::Point&, const awt::Size& aSize, long rotation,
const drawing::HomogenMatrix3& rTrans)
{
@@ -1484,5 +1466,4 @@ int OpenGLRender::RenderSymbol2DShape(float x, float y, float , float , sal_Int3
return 0;
}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* iim:set shiftwidth=4 softtabstop=4 expandtab: */
More information about the Libreoffice-commits
mailing list