summaryrefslogtreecommitdiff
path: root/vcl/source/opengl/OpenGLContext.cxx
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2016-04-28 14:55:45 +0900
committerTomaž Vajngerl <quikee@gmail.com>2016-04-30 03:06:49 +0000
commitba0a5708803d899de4c40cfe2c1697ae83b4827a (patch)
tree2001952d455e7a0258a49a858f4a1f5339053f1a /vcl/source/opengl/OpenGLContext.cxx
parent02a8589553b5ce0e57a7ee9e66327376125b4378 (diff)
opengl: track state of active and bound textures in context
Add TextureState which is responsible to track the state of texture binding (and unbinding) and changing the current active texture unit. This is necessary because all GL calls reset the internal state without checking what the current state actually is and this can accumulate to a large amount of overhead. We also unbound the textures (glBindTexture with 0 as ID) after every operation which is also a major unneeded overhead which is fixed by this commit. Change-Id: I770a6a744c0c41850c576b928f027375962088aa Reviewed-on: https://gerrit.libreoffice.org/24503 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'vcl/source/opengl/OpenGLContext.cxx')
-rw-r--r--vcl/source/opengl/OpenGLContext.cxx3
1 files changed, 3 insertions, 0 deletions
diff --git a/vcl/source/opengl/OpenGLContext.cxx b/vcl/source/opengl/OpenGLContext.cxx
index 2b1e6bead8cd..b5881fe18c90 100644
--- a/vcl/source/opengl/OpenGLContext.cxx
+++ b/vcl/source/opengl/OpenGLContext.cxx
@@ -41,6 +41,8 @@
#include <opengl/texture.hxx>
#include <opengl/zone.hxx>
+#include "opengl/RenderState.hxx"
+
using namespace com::sun::star;
#define MAX_FRAMEBUFFER_COUNT 30
@@ -74,6 +76,7 @@ OpenGLContext::OpenGLContext():
mpFirstFramebuffer(nullptr),
mpLastFramebuffer(nullptr),
mpCurrentProgram(nullptr),
+ mpRenderState(new RenderState),
mnPainting(0),
mpPrevContext(nullptr),
mpNextContext(nullptr)