summaryrefslogtreecommitdiff
path: root/vcl/source/opengl
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2016-04-28 14:55:45 +0900
committerDavid Tardon <dtardon@redhat.com>2016-05-06 07:07:14 +0000
commit75667b6c68e7c9c288c74623e4925a2de42f2d6f (patch)
treeb4e03320982f51547f0ffad15133ce86badb4479 /vcl/source/opengl
parentd80e87a91f25f78239d36ab4a4550173e8d6184b (diff)
opengl: combined commits for state tracking
Includes commits: opengl: track state of active and bound textures in context ba0a5708803d899de4c40cfe2c1697ae83b4827a opengl: track the state of scissor test and the dimensions 51e953a3579fb91f30f7f0d6159b737684976959 opengl: track the state of stencil test b8f0e6452cc019744c44997c92831d94086b35b7 opengl: sync scissor and stencil state, generic capability state a57d048f88ba6cac3ce1550e2a8a143a8887eb05 opengl: track the state of glViewport 540fee2dc7553152914f7f1d8a41921e765087ef Change-Id: I770a6a744c0c41850c576b928f027375962088aa Reviewed-on: https://gerrit.libreoffice.org/24508 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Meeks <michael.meeks@collabora.com> Reviewed-by: David Tardon <dtardon@redhat.com>
Diffstat (limited to 'vcl/source/opengl')
-rw-r--r--vcl/source/opengl/OpenGLContext.cxx8
1 files changed, 6 insertions, 2 deletions
diff --git a/vcl/source/opengl/OpenGLContext.cxx b/vcl/source/opengl/OpenGLContext.cxx
index a00947649aaf..1ac5f4d55918 100644
--- a/vcl/source/opengl/OpenGLContext.cxx
+++ b/vcl/source/opengl/OpenGLContext.cxx
@@ -40,6 +40,8 @@
#include <opengl/texture.hxx>
#include <opengl/zone.hxx>
+#include "opengl/RenderState.hxx"
+
using namespace com::sun::star;
#define MAX_FRAMEBUFFER_COUNT 30
@@ -73,6 +75,7 @@ OpenGLContext::OpenGLContext():
mpFirstFramebuffer(nullptr),
mpLastFramebuffer(nullptr),
mpCurrentProgram(nullptr),
+ mpRenderState(new RenderState),
mnPainting(0),
mpPrevContext(nullptr),
mpNextContext(nullptr)
@@ -1225,6 +1228,7 @@ void OpenGLContext::reset()
// reset the clip region
maClipRegion.SetEmpty();
+ mpRenderState.reset(new RenderState);
// destroy all framebuffers
if( mpLastFramebuffer )
@@ -1679,8 +1683,8 @@ OpenGLFramebuffer* OpenGLContext::AcquireFramebuffer( const OpenGLTexture& rText
assert( pFramebuffer );
BindFramebuffer( pFramebuffer );
pFramebuffer->AttachTexture( rTexture );
- glViewport( 0, 0, rTexture.GetWidth(), rTexture.GetHeight() );
- CHECK_GL_ERROR();
+
+ state()->viewport(Rectangle(Point(), Size(rTexture.GetWidth(), rTexture.GetHeight())));
return pFramebuffer;
}