vcl/source/window/paint.cxx | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-)
New commits: commit 3fa6bed062d7fd840eb75c18390e0384695af827 Author: Caolán McNamara <caolan.mcnam...@collabora.com> AuthorDate: Fri Aug 22 10:28:20 2025 +0100 Commit: Xisco Fauli <xiscofa...@libreoffice.org> CommitDate: Fri Aug 22 15:00:06 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> (cherry picked from commit a6dc33e5b4af22ef150ca328ad67132e85ec3dbe) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/190061 Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org> diff --git a/vcl/source/window/paint.cxx b/vcl/source/window/paint.cxx index b024374a13f4..d635d25c4edc 100644 --- a/vcl/source/window/paint.cxx +++ b/vcl/source/window/paint.cxx @@ -1653,12 +1653,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(); @@ -1706,8 +1700,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); @@ -1752,7 +1751,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 ) {