[Libreoffice-commits] core.git: chart2/source
Markus Mohrhard
markus.mohrhard at collabora.co.uk
Wed Feb 19 00:27:41 CET 2014
chart2/source/view/main/OpenGLRender.cxx | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)
New commits:
commit 54e66cba3b7691ce4acf7fac947241058faf0fc3
Author: Markus Mohrhard <markus.mohrhard at collabora.co.uk>
Date: Tue Feb 18 23:33:38 2014 +0100
avoid calling glew repeatedly
This saves us about 10% of the rendering time.
Change-Id: I3ea7f1849500b025830b44c5175d79ad04aff362
diff --git a/chart2/source/view/main/OpenGLRender.cxx b/chart2/source/view/main/OpenGLRender.cxx
index 83d68bd..9b4cd8d 100755
--- a/chart2/source/view/main/OpenGLRender.cxx
+++ b/chart2/source/view/main/OpenGLRender.cxx
@@ -84,6 +84,7 @@ int static checkGLError(const char *file, int line)
return retCode;
}
+static bool bGlewInit = false;
#define CHECK_GL_ERROR() checkGLError(__FILE__, __LINE__)
@@ -235,11 +236,16 @@ GLfloat texCoords[] = {
int OpenGLRender::InitOpenGL(GLWindow aWindow)
{
glWin = aWindow;
- glewExperimental = GL_TRUE;
- if (glewInit() != GLEW_OK)
+ if(!bGlewInit)
{
- SAL_WARN("chart2.opengl", "Failed to initialize GLEW");
- return -1;
+ glewExperimental = GL_TRUE;
+ if (glewInit() != GLEW_OK)
+ {
+ SAL_WARN("chart2.opengl", "Failed to initialize GLEW");
+ return -1;
+ }
+ else
+ bGlewInit = true;
}
// These guys don't just check support but setup the vtables.
More information about the Libreoffice-commits
mailing list