[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - vcl/source
Miklos Vajna
vmiklos at collabora.co.uk
Tue Jul 7 23:26:59 PDT 2015
vcl/source/window/paint.cxx | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
New commits:
commit bc1dcbe0b6489f955fffbd23f8c7b21e81eb8678
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Tue Jul 7 14:11:51 2015 +0200
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)
diff --git a/vcl/source/window/paint.cxx b/vcl/source/window/paint.cxx
index 7b00628..4a6fb2e 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 )
{
More information about the Libreoffice-commits
mailing list