diff options
author | Michael Meeks <michael.meeks@collabora.com> | 2015-09-16 09:17:37 +0100 |
---|---|---|
committer | Michael Meeks <michael.meeks@collabora.com> | 2015-09-16 09:50:43 +0000 |
commit | bfceb557efcd607ef018ae35fc73f8d61a9b9a4e (patch) | |
tree | 7f46254e93f12bc3b96cb49fa52afa97a855c2e3 /vcl/opengl | |
parent | 4af40495b7dcdac3add67c634dde75c896e370d9 (diff) |
GL paint-flushing guard re-work.
Unfortunately, since we can have 2x SalGraphics' on a OutputDevice,
and one of these can be a printer - things got very confused around
which context to glFlush. This de-tangles the various reference-counts.
Change-Id: I1062be0b02a91fc9009deaa3ec29c5dbb227df20
Reviewed-on: https://gerrit.libreoffice.org/18604
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Michael Meeks <michael.meeks@collabora.com>
Diffstat (limited to 'vcl/opengl')
-rw-r--r-- | vcl/opengl/gdiimpl.cxx | 28 |
1 files changed, 5 insertions, 23 deletions
diff --git a/vcl/opengl/gdiimpl.cxx b/vcl/opengl/gdiimpl.cxx index c092f0317b1b..e92d86480c9e 100644 --- a/vcl/opengl/gdiimpl.cxx +++ b/vcl/opengl/gdiimpl.cxx @@ -1862,30 +1862,12 @@ bool OpenGLSalGraphicsImpl::drawGradient(const tools::PolyPolygon& rPolyPoly, return true; } -void OpenGLSalGraphicsImpl::beginPaint() +OpenGLContext *OpenGLSalGraphicsImpl::beginPaint() { - if( !AcquireContext() ) - return; - - mpContext->mnPainting++; -} - -void OpenGLSalGraphicsImpl::endPaint() -{ - if( !AcquireContext() ) - return; - - mpContext->mnPainting--; - assert( mpContext->mnPainting >= 0 ); - if( mpContext->mnPainting == 0 && !mbOffscreen ) - { - mpContext->makeCurrent(); - mpContext->AcquireDefaultFramebuffer(); - glFlush(); - mpContext->swapBuffers(); - - CHECK_GL_ERROR(); - } + if( mbOffscreen || !AcquireContext() ) + return NULL; + else + return mpContext.get(); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |