diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2015-07-07 14:11:51 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2015-07-08 08:11:03 +0200 |
commit | bc1dcbe0b6489f955fffbd23f8c7b21e81eb8678 (patch) | |
tree | 111f83c552269c3f7845e21dc7f7fcbd0491c1b4 /vcl/source | |
parent | 050c4f9ceca3046159f7a24d3d5abf8ec4e47fb3 (diff) |
vcl rendercontext: avoid CopyArea() in Window::ImplScroll()
Direct CopyArea() does more harm than good in case of double buffering:
to avoid touching the window directly, just invalidate the whole area
and avoid copying.
Change-Id: I678c5b0a38fc089675fd030d2da4132684a5d6a6
(cherry picked from commit f3f2a4fc8565ca558d89cdf6377df7f9f8592616)
Diffstat (limited to 'vcl/source')
-rw-r--r-- | vcl/source/window/paint.cxx | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/vcl/source/window/paint.cxx b/vcl/source/window/paint.cxx index 7b006286e2df..4a6fb2ef114d 100644 --- a/vcl/source/window/paint.cxx +++ b/vcl/source/window/paint.cxx @@ -1563,7 +1563,11 @@ void Window::ImplScroll( const Rectangle& rRect, Rectangle aDestRect( aRectMirror ); aDestRect.Move( bReMirror ? -nHorzScroll : nHorzScroll, nVertScroll ); vcl::Region aWinInvalidateRegion( aRectMirror ); - aWinInvalidateRegion.Exclude( aDestRect ); + 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 ); } @@ -1609,7 +1613,9 @@ void Window::ImplScroll( const Rectangle& rRect, // rendering is all there is. SalGraphics* pGraphics = ImplGetFrameGraphics(); - if ( pGraphics ) + // The invalidation area contains the area what would be copied here, + // so avoid copying in case of double buffering. + if (pGraphics && !SupportsDoubleBuffering()) { if( bReMirror ) { |