summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@collabora.com>2016-01-12 21:13:13 +0000
committerAshod Nakashian <ashnakash@gmail.com>2016-01-13 01:54:54 +0000
commit6fa1b457fc90ca92a1e8e70d4446cd5462da3158 (patch)
tree95b9e1808f52c149798688ade583b6929136fb95
parentc205c0fb4720f684001c96f3d79ad8ba90659363 (diff)
tdf#96385 - opengl: dynamically adjust priority of swap buffers.
Initially we start with a very low priority, so that the lame bits of code that do eg. focus, and cursor rendering before the document is visible do not cause a swap, flash. Then after we've processed a REPAINT priority idle (hopefully our first paint) we adjust the swap priority to highest. Essentially a fusion of Tor's approach and mine. Change-Id: Ib9b78a18fb9359ac8c3dee1cfeb30177c08fe162 Reviewed-on: https://gerrit.libreoffice.org/21410 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
-rw-r--r--vcl/opengl/gdiimpl.cxx4
1 files changed, 3 insertions, 1 deletions
diff --git a/vcl/opengl/gdiimpl.cxx b/vcl/opengl/gdiimpl.cxx
index b7276edc34ca..7bb2ae21cdf2 100644
--- a/vcl/opengl/gdiimpl.cxx
+++ b/vcl/opengl/gdiimpl.cxx
@@ -47,7 +47,8 @@ public:
: Idle( "gl idle swap" )
, m_pImpl( pImpl )
{
- SetPriority( SchedulerPriority::HIGHEST );
+ // We don't want to be swapping before we've painted.
+ SetPriority( SchedulerPriority::POST_PAINT );
}
~OpenGLFlushIdle()
{
@@ -55,6 +56,7 @@ public:
virtual void Invoke() override
{
m_pImpl->doFlush();
+ SetPriority( SchedulerPriority::HIGHEST );
Stop();
}
};