summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@collabora.com>2016-01-12 21:02:01 +0000
committerTor Lillqvist <tml@collabora.com>2016-01-12 22:02:00 +0000
commit8d6c1b6981f01bbc0057234f53fd139e87a5f010 (patch)
tree13aaeb573ecf06214a8c7a9bc76d2a93d518089f
parentab95fb7a19d7847dd1cbfad0059cc175a809a50f (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/21405 Reviewed-by: Tor Lillqvist <tml@collabora.com> Tested-by: Tor Lillqvist <tml@collabora.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 d01d66b85f23..73804c7e39e2 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 );
}
virtual ~OpenGLFlushIdle()
{
@@ -55,6 +56,7 @@ public:
virtual void Invoke() override
{
m_pImpl->doFlush();
+ SetPriority( SchedulerPriority::HIGHEST );
Stop();
}
};