[Libreoffice-commits] core.git: Branch 'libreoffice-5-1' - vcl/opengl

Michael Meeks michael.meeks at collabora.com
Tue Jan 12 17:55:19 PST 2016


 vcl/opengl/gdiimpl.cxx |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

New commits:
commit 6fa1b457fc90ca92a1e8e70d4446cd5462da3158
Author: Michael Meeks <michael.meeks at collabora.com>
Date:   Tue Jan 12 21:13:13 2016 +0000

    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 at libreoffice.org>
    Reviewed-by: Ashod Nakashian <ashnakash at gmail.com>

diff --git a/vcl/opengl/gdiimpl.cxx b/vcl/opengl/gdiimpl.cxx
index b7276ed..7bb2ae2 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();
     }
 };


More information about the Libreoffice-commits mailing list