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

Miklos Vajna vmiklos at collabora.co.uk
Mon Jul 6 01:36:14 PDT 2015


 sw/source/core/view/viewsh.cxx |   18 ++++--------------
 1 file changed, 4 insertions(+), 14 deletions(-)

New commits:
commit 55a968fa728f8ea968e9142aefde678780223eb2
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Fri Jul 3 17:52:44 2015 +0200

    SwViewShell::ImplEndAction: avoid direct PaintDesktop()
    
    With double-buffering enabled and typing quickly, one saw blinks in the
    text sometimes. The reason was that PaintDesktop() painted directly
    outside SwViewShell::Paint().
    
    The problem is more visible with VCL_DOUBLEBUFFERING_AVOID_PAINT=1,
    loading a simple document + pressing a key draw an unexpected white
    rectangle.
    
    Given that InvalidateWindows() already calls PaintDesktop() inside
    Paint() implicitly (via SwViewShell::Paint()), fix the problem by just
    avoiding the DLPrePaint2() + PaintDesktop() + DLPostPaint2() calls.
    
    Change-Id: Ib8ce26a0bdd526bf85d362f0e865dd61d29f6d11
    (cherry picked from commit c9175a1bd3249ad573ae6827bf19963a3ebe2fbc)

diff --git a/sw/source/core/view/viewsh.cxx b/sw/source/core/view/viewsh.cxx
index 3642d1e..9b96a58 100644
--- a/sw/source/core/view/viewsh.cxx
+++ b/sw/source/core/view/viewsh.cxx
@@ -405,20 +405,7 @@ void SwViewShell::ImplEndAction( const bool bIdleEnd )
                     }
                     if ( bPaint )
                     {
-                        // #i75172# begin DrawingLayer paint
-                        // need to do begin/end DrawingLayer preparation for each single rectangle of the
-                        // repaint region. I already tried to prepare only once for the whole Region. This
-                        // seems to work (and does technically) but fails with transparent objects. Since the
-                        // region given to BeginDarwLayers() defines the clip region for DrawingLayer paint,
-                        // transparent objects in the single rectangles will indeed be painted multiple times.
-                        DLPrePaint2(vcl::Region(aRect.SVRect()));
-
-                        if ( bPaintsFromSystem )
-                            PaintDesktop(*GetOut(), aRect);
-                        pCurrentLayout->GetCurrShell()->InvalidateWindows(aRect.SVRect());
-
-                        // #i75172# end DrawingLayer paint
-                        DLPostPaint2(true);
+                        InvalidateWindows(aRect.SVRect());
                     }
 
                     lcl_PaintTransparentFormControls(*this, aRect); // i#107365
commit fc3de7d134c2832b7f940e81d16042d171b402fc
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Fri Jul 3 11:52:17 2015 +0200

    SwViewShell::DLPrePaint2: fix missing clipping for the non-buffered case
    
    With this, if the sw window is small enough that the page shadow is
    supposed to be under the sidebar, we no longer paint the shadow over the
    sidebar.
    
    In the non-double-buffered case the output is a window, so
    SdrPaintWindow::PreparePreRenderDevice() does its own buffering, and
    clipping is taken care of when that buffer is copied to the window in
    SdrPreRenderDevice::OutputPreRenderDevice().
    
    This wasn't a problem before, as either the output was a non-screen
    device or UI elements were painted (like the sidebar), but never both at
    the same time.
    
    Change-Id: Ic02c814fc4deeea86c245c74bd69656533d9f835
    (cherry picked from commit 978033d5ed9f93f2d5d9a1ba44acf6b37bc13bfe)

diff --git a/sw/source/core/view/viewsh.cxx b/sw/source/core/view/viewsh.cxx
index 6e0a150..3642d1e 100644
--- a/sw/source/core/view/viewsh.cxx
+++ b/sw/source/core/view/viewsh.cxx
@@ -203,6 +203,9 @@ void SwViewShell::DLPrePaint2(const vcl::Region& rRegion)
             mpBufferedOut = mpOut;
             mpOut = &(mpTargetPaintWindow->GetTargetOutputDevice());
         }
+        else
+            // In case mpOut is used without buffering, need to set clipping.
+            mpOut->SetClipRegion(rRegion);
 
         // remember original paint MapMode for wrapped FlyFrame paints
         maPrePostMapMode = mpOut->GetMapMode();


More information about the Libreoffice-commits mailing list