vcl/source/window/paint.cxx |   15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)

New commits:
commit a6dc33e5b4af22ef150ca328ad67132e85ec3dbe
Author:     Caolán McNamara <caolan.mcnam...@collabora.com>
AuthorDate: Fri Aug 22 10:28:20 2025 +0100
Commit:     Caolán McNamara <caolan.mcnam...@collabora.com>
CommitDate: Fri Aug 22 13:10:23 2025 +0200

    Resolves: tdf#156297 restore copy area optimization
    
    This reverts commit 344d90b20bdf95e9888f916672bbe51a5d700d02.
    "tdf#152094 don't attempt scroll paint optimization for devices with a 
mapmode"
    
    It slows calc scroll down too much, and things have moved on with text
    placement otherwise, so this hack is possibly redundant anyway.
    
    Change-Id: Ic4337e71ddd38250a1e5e305acb97b3f1a93f20c
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/190054
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com>

diff --git a/vcl/source/window/paint.cxx b/vcl/source/window/paint.cxx
index 34514f5fe878..9ecd35cf39c3 100644
--- a/vcl/source/window/paint.cxx
+++ b/vcl/source/window/paint.cxx
@@ -1651,12 +1651,6 @@ void Window::ImplScroll( const tools::Rectangle& rRect,
     if ( !nHorzScroll && !nVertScroll )
         return;
 
-    // There will be no CopyArea() call below, so invalidate the whole visible
-    // area, not only the smaller one that was just scrolled in.
-    // Do this when we have a double buffer anyway, or (tdf#152094) the device 
has a map mode enabled which
-    // makes the conversion to pixel inaccurate
-    const bool bCopyExistingAreaAndElideInvalidate = 
!SupportsDoubleBuffering() && !GetOutDev()->IsMapModeEnabled();
-
     if ( mpWindowImpl->mpCursor )
         mpWindowImpl->mpCursor->ImplSuspend();
 
@@ -1704,8 +1698,13 @@ void Window::ImplScroll( const tools::Rectangle& rRect,
     tools::Rectangle aDestRect(aRectMirror);
     aDestRect.Move(bReMirror ? -nHorzScroll : nHorzScroll, nVertScroll);
     vcl::Region aWinInvalidateRegion(aRectMirror);
-    if (bCopyExistingAreaAndElideInvalidate)
+    if (!SupportsDoubleBuffering())
+    {
+        // There will be no CopyArea() call below, so invalidate the
+        // whole visible area, not only the smaller one that was just
+        // scrolled in.
         aWinInvalidateRegion.Exclude(aDestRect);
+    }
 
     aInvalidateRegion.Union(aWinInvalidateRegion);
 
@@ -1750,7 +1749,7 @@ void Window::ImplScroll( const tools::Rectangle& rRect,
         SalGraphics* pGraphics = ImplGetFrameGraphics();
         // The invalidation area contains the area what would be copied here,
         // so avoid copying in case of double buffering.
-        if (pGraphics && bCopyExistingAreaAndElideInvalidate)
+        if (pGraphics && !SupportsDoubleBuffering())
         {
             if( bReMirror )
             {

Reply via email to