[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - vcl/source

Michael Meeks michael.meeks at collabora.com
Wed Sep 16 05:30:31 PDT 2015


 vcl/source/window/event.cxx  |   10 +++++++++-
 vcl/source/window/status.cxx |    6 ++++++
 2 files changed, 15 insertions(+), 1 deletion(-)

New commits:
commit f7554e3e6ff17c850f444bd58767e68e8741387a
Author: Michael Meeks <michael.meeks at collabora.com>
Date:   Tue Sep 15 23:42:52 2015 +0100

    tdf#94213 - calc re-size flicker turns out to be the status bar.
    
    Using vdev's associated with old contexts, is un-necessary and a
    recipe for context switching & hence flicker.
    
    Change-Id: I37ed967a7816e5ca0240908ab4793ce1e68570ee
    Reviewed-on: https://gerrit.libreoffice.org/18602
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Michael Meeks <michael.meeks at collabora.com>
    Reviewed-on: https://gerrit.libreoffice.org/18608
    Reviewed-by: Tor Lillqvist <tml at collabora.com>

diff --git a/vcl/source/window/event.cxx b/vcl/source/window/event.cxx
index 852cc0c..35c3e38 100644
--- a/vcl/source/window/event.cxx
+++ b/vcl/source/window/event.cxx
@@ -21,6 +21,7 @@
 #include <vcl/window.hxx>
 #include <vcl/dockwin.hxx>
 #include <vcl/layout.hxx>
+#include <vcl/opengl/OpenGLWrapper.hxx>
 
 #include <window.h>
 #include <svdata.hxx>
@@ -453,7 +454,14 @@ void Window::ImplCallResize()
 {
     mpWindowImpl->mbCallResize = false;
 
-    if( GetBackground().IsGradient() )
+    // OpenGL has a charming feature of black clearing the whole window
+    // some legacy code eg. the app-menu has the beautiful feature of
+    // avoiding re-paints when width doesn't change => invalidate all.
+    if( OpenGLWrapper::isVCLOpenGLEnabled() )
+        Invalidate();
+
+    // Normally we avoid blanking on re-size unless people might notice:
+    else if( GetBackground().IsGradient() )
         Invalidate();
 
     Resize();
diff --git a/vcl/source/window/status.cxx b/vcl/source/window/status.cxx
index e8e2aaf..76c2de3 100644
--- a/vcl/source/window/status.cxx
+++ b/vcl/source/window/status.cxx
@@ -27,6 +27,7 @@
 #include <vcl/status.hxx>
 #include <vcl/virdev.hxx>
 #include <vcl/settings.hxx>
+#include <vcl/opengl/OpenGLWrapper.hxx>
 
 #include <svdata.hxx>
 #include <window.h>
@@ -731,6 +732,11 @@ void StatusBar::Paint(vcl::RenderContext& rRenderContext, const Rectangle&)
             // Do offscreen only when we are not recording layout..
             bool bOffscreen = !rRenderContext.ImplIsRecordLayout();
 
+            // tdf#94213 - un-necessary virtual-device in GL mode
+            // causes context switch & hence flicker during sizing.
+            if( OpenGLWrapper::isVCLOpenGLEnabled() )
+                bOffscreen = false;
+
             for (sal_uInt16 i = 0; i < nItemCount; i++)
             {
                 ImplDrawItem(rRenderContext, bOffscreen, i, true, true);


More information about the Libreoffice-commits mailing list