summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2016-06-24 16:42:45 +0800
committerCaolán McNamara <caolanm@redhat.com>2016-06-26 20:11:37 +0000
commit24c3838b5fd2005d9df902c9a7d03fcba78adbe4 (patch)
tree3e16682a970c94a57f64b888d529f0a7ec0c62af
parent6d3a5d8aa07e575c153316a9725f36c43abd0bca (diff)
tdf#100411 start the flush timer when batching (PostBatchDraw)
When we batch a draw command we need to start the flush timer (if not already started) as otherwise it could happen that we won't flush the offscreen texture at the correct time or at all. This fixes a problem with drawing of pop-up "help" text. (cherry picked from commit e1296e295e7d4f1104d2c90b1f51d52251358bea) Change-Id: I6afcf173c3ac517ed0612cd413d95e28c19faa81 Reviewed-on: https://gerrit.libreoffice.org/26630 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r--vcl/inc/openglgdiimpl.hxx2
-rw-r--r--vcl/opengl/gdiimpl.cxx10
2 files changed, 12 insertions, 0 deletions
diff --git a/vcl/inc/openglgdiimpl.hxx b/vcl/inc/openglgdiimpl.hxx
index df7b9e9e617a..20372689d92e 100644
--- a/vcl/inc/openglgdiimpl.hxx
+++ b/vcl/inc/openglgdiimpl.hxx
@@ -169,6 +169,8 @@ public:
// operations to do after painting
void PostDraw();
+ void PostBatchDraw();
+
protected:
bool AcquireContext(bool bForceCreate = false);
bool ReleaseContext();
diff --git a/vcl/opengl/gdiimpl.cxx b/vcl/opengl/gdiimpl.cxx
index 188db65bfeb0..1422c6a85f34 100644
--- a/vcl/opengl/gdiimpl.cxx
+++ b/vcl/opengl/gdiimpl.cxx
@@ -249,6 +249,15 @@ void OpenGLSalGraphicsImpl::PostDraw()
OpenGLZone::leave();
}
+void OpenGLSalGraphicsImpl::PostBatchDraw()
+{
+ if (IsOffscreen())
+ return;
+
+ if (!mpFlush->IsActive())
+ mpFlush->Start();
+}
+
void OpenGLSalGraphicsImpl::ApplyProgramMatrices(float fPixelOffset)
{
mpProgram->ApplyMatrix(GetWidth(), GetHeight(), fPixelOffset);
@@ -1519,6 +1528,7 @@ void OpenGLSalGraphicsImpl::DrawMask( OpenGLTexture& rMask, SalColor nMaskColor,
void OpenGLSalGraphicsImpl::DeferredTextDraw(OpenGLTexture& rTexture, SalColor aMaskColor, const SalTwoRect& rPosAry)
{
mpAccumulatedTextures->insert(rTexture, aMaskColor, rPosAry);
+ PostBatchDraw();
}
void OpenGLSalGraphicsImpl::FlushDeferredDrawing()