summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorLouis-Francis Ratté-Boulianne <lfrb@collabora.com>2014-11-22 08:04:23 -0500
committerLouis-Francis Ratté-Boulianne <lfrb@collabora.com>2014-11-22 08:04:23 -0500
commit385dd7da3aa1c202ec70e2c3213b6b70ab772108 (patch)
treefb9849555905f58a66a9675e02d734c5aa8559b5 /vcl
parente26c8fdd1922282ef5f0ce97b503ef9d7bb9907b (diff)
vcl: Move the painting fence to the OpenGL context
Change-Id: I462e68a1ad7a56fafe57504959cf169a70665f81
Diffstat (limited to 'vcl')
-rw-r--r--vcl/inc/openglgdiimpl.hxx2
-rw-r--r--vcl/opengl/gdiimpl.cxx9
-rw-r--r--vcl/source/opengl/OpenGLContext.cxx1
3 files changed, 6 insertions, 6 deletions
diff --git a/vcl/inc/openglgdiimpl.hxx b/vcl/inc/openglgdiimpl.hxx
index a1cd14223909..74469032db07 100644
--- a/vcl/inc/openglgdiimpl.hxx
+++ b/vcl/inc/openglgdiimpl.hxx
@@ -35,8 +35,6 @@ class VCL_PLUGIN_PUBLIC OpenGLSalGraphicsImpl : public SalGraphicsImpl
{
protected:
- SalFrame* mpFrame;
- int mnPainting;
OpenGLContext* mpContext;
// clipping
diff --git a/vcl/opengl/gdiimpl.cxx b/vcl/opengl/gdiimpl.cxx
index 6e6ea5fece18..1151b730cc5c 100644
--- a/vcl/opengl/gdiimpl.cxx
+++ b/vcl/opengl/gdiimpl.cxx
@@ -228,7 +228,7 @@ void OpenGLSalGraphicsImpl::PostDraw()
{
if( mbOffscreen )
glBindFramebuffer( GL_FRAMEBUFFER, 0 );
- else if( mnPainting == 0 )
+ else if( mpContext->mnPainting == 0 )
glFlush();
if( mbUseScissor )
glDisable( GL_SCISSOR_TEST );
@@ -1872,15 +1872,16 @@ bool OpenGLSalGraphicsImpl::drawGradient(const tools::PolyPolygon& rPolyPoly,
void OpenGLSalGraphicsImpl::beginPaint()
{
- mnPainting++;
SAL_INFO( "vcl.opengl", "BEGIN PAINT " << this );
+ mpContext->mnPainting++;
}
void OpenGLSalGraphicsImpl::endPaint()
{
- mnPainting--;
SAL_INFO( "vcl.opengl", "END PAINT " << this );
- if( mnPainting == 0 )
+ mpContext->mnPainting--;
+ assert( mpContext->mnPainting >= 0 );
+ if( mpContext->mnPainting == 0 && !mbOffscreen )
{
mpContext->makeCurrent();
glFlush();
diff --git a/vcl/source/opengl/OpenGLContext.cxx b/vcl/source/opengl/OpenGLContext.cxx
index 9bbe1e2c85a6..caf3d3022293 100644
--- a/vcl/source/opengl/OpenGLContext.cxx
+++ b/vcl/source/opengl/OpenGLContext.cxx
@@ -53,6 +53,7 @@ OpenGLContext::OpenGLContext():
mbRequestLegacyContext(false),
mbUseDoubleBufferedRendering(true),
mbRequestVirtualDevice(false),
+ mnPainting(0),
mpPrevContext(NULL),
mpNextContext(NULL)
{