summaryrefslogtreecommitdiff
path: root/vcl/source/window
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2022-11-23 17:29:56 +0000
committerCaolán McNamara <caolanm@redhat.com>2022-11-23 21:13:50 +0100
commit96880f5af713a55d87556af30a08b5f09f00ba48 (patch)
tree74b8b75396217b682b52a0add97087f139fb4a17 /vcl/source/window
parent9c2e77152c3b824153ef5451ababe58dc5ce981c (diff)
tdf#152094 don't attempt scroll paint optimization for devices with a mapmode
Change-Id: I446cf9ee62faf564143d25db60643c9b6cd8e3d9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143188 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'vcl/source/window')
-rw-r--r--vcl/source/window/paint.cxx15
1 files changed, 8 insertions, 7 deletions
diff --git a/vcl/source/window/paint.cxx b/vcl/source/window/paint.cxx
index 40172ade6a9e..a70f1c0e4004 100644
--- a/vcl/source/window/paint.cxx
+++ b/vcl/source/window/paint.cxx
@@ -1645,6 +1645,12 @@ 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();
@@ -1692,13 +1698,8 @@ void Window::ImplScroll( const tools::Rectangle& rRect,
tools::Rectangle aDestRect(aRectMirror);
aDestRect.Move(bReMirror ? -nHorzScroll : nHorzScroll, nVertScroll);
vcl::Region aWinInvalidateRegion(aRectMirror);
- 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.
+ if (bCopyExistingAreaAndElideInvalidate)
aWinInvalidateRegion.Exclude(aDestRect);
- }
aInvalidateRegion.Union(aWinInvalidateRegion);
@@ -1743,7 +1744,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 && !SupportsDoubleBuffering())
+ if (pGraphics && bCopyExistingAreaAndElideInvalidate)
{
if( bReMirror )
{