Kaydet (Commit) 8d6c1b69 authored tarafından Michael Meeks's avatar Michael Meeks Kaydeden (comit) Tor Lillqvist

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/21405Reviewed-by: 's avatarTor Lillqvist <tml@collabora.com>
Tested-by: 's avatarTor Lillqvist <tml@collabora.com>
üst ab95fb7a
...@@ -47,7 +47,8 @@ public: ...@@ -47,7 +47,8 @@ public:
: Idle( "gl idle swap" ) : Idle( "gl idle swap" )
, m_pImpl( pImpl ) , m_pImpl( pImpl )
{ {
SetPriority( SchedulerPriority::HIGHEST ); // We don't want to be swapping before we've painted.
SetPriority( SchedulerPriority::POST_PAINT );
} }
virtual ~OpenGLFlushIdle() virtual ~OpenGLFlushIdle()
{ {
...@@ -55,6 +56,7 @@ public: ...@@ -55,6 +56,7 @@ public:
virtual void Invoke() override virtual void Invoke() override
{ {
m_pImpl->doFlush(); m_pImpl->doFlush();
SetPriority( SchedulerPriority::HIGHEST );
Stop(); Stop();
} }
}; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment