diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2015-08-11 17:39:58 +0200 |
---|---|---|
committer | Tor Lillqvist <tml@collabora.com> | 2015-08-12 08:52:48 +0000 |
commit | 05bbeebc44c34f4f8938840f96a52afeb4ac49a5 (patch) | |
tree | d563e4ca689cb544f62947555fd5fb315d45aaa8 | |
parent | 806eb2861e2417f9ab4121565f5f857bc86144ca (diff) |
tdf#93364 vcl rendercontext: fix area that is painted in PaintBuffer()
Usually the topmost window of a paint hierarchy has a paint rectangle
that covers the paint rectangle of all its children, but this is not
necessarly true in every case. One example is the cursor travelling
described in the bug report, where the topmost DockingAreaWindow only
paints a few buttons on the toolbar, and then even if children are
painted correctly to the frame-level persistent buffer, only the
DockingAreaWindow part of the buffer is copied to the screen.
Fix this by building an union rectangle that covers all areas in a
buffered paint run, and then paint that rectangle from the buffer, not
just the paint rectangle of the topmost parent.
Change-Id: Ib0b30413d83c4b3fdec27fa7ddad16c21fd094b6
(cherry picked from commit 7305941b150097123eab664f9ec9e5f3909a5c52)
Reviewed-on: https://gerrit.libreoffice.org/17664
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Tor Lillqvist <tml@collabora.com>
Tested-by: Tor Lillqvist <tml@collabora.com>
-rw-r--r-- | vcl/inc/window.h | 1 | ||||
-rw-r--r-- | vcl/source/window/paint.cxx | 5 |
2 files changed, 5 insertions, 1 deletions
diff --git a/vcl/inc/window.h b/vcl/inc/window.h index 213e2154b9a7..67d5f94d3c24 100644 --- a/vcl/inc/window.h +++ b/vcl/inc/window.h @@ -177,6 +177,7 @@ struct ImplFrameData bool mbInternalDragGestureRecognizer; VclPtr<VirtualDevice> mpBuffer; ///< Buffer for the double-buffering bool mbInBufferedPaint; ///< PaintHelper is in the process of painting into this buffer. + Rectangle maBufferedRect; ///< Rectangle in the buffer that has to be painted to the screen. }; struct ImplAccessibleInfos diff --git a/vcl/source/window/paint.cxx b/vcl/source/window/paint.cxx index 19f5cdcea419..bc0050a6d58d 100644 --- a/vcl/source/window/paint.cxx +++ b/vcl/source/window/paint.cxx @@ -228,6 +228,7 @@ void PaintHelper::StartBufferedPaint() assert(!pFrameData->mbInBufferedPaint); pFrameData->mbInBufferedPaint = true; + pFrameData->maBufferedRect = Rectangle(); m_bStartedBufferedPaint = true; } @@ -238,7 +239,7 @@ void PaintHelper::PaintBuffer() assert(m_bStartedBufferedPaint); PaintBufferGuard aGuard(pFrameData, m_pWindow); - aGuard.SetPaintRect(m_aPaintRect); + aGuard.SetPaintRect(pFrameData->maBufferedRect); } void PaintHelper::DoPaint(const vcl::Region* pRegion) @@ -290,6 +291,7 @@ void PaintHelper::DoPaint(const vcl::Region* pRegion) m_pWindow->PushPaintHelper(this, *pFrameData->mpBuffer.get()); m_pWindow->Paint(*pFrameData->mpBuffer.get(), m_aPaintRect); + pFrameData->maBufferedRect.Union(m_aPaintRect); } else { @@ -551,6 +553,7 @@ PaintHelper::~PaintHelper() { PaintBuffer(); pFrameData->mbInBufferedPaint = false; + pFrameData->maBufferedRect = Rectangle(); } // #98943# draw toolbox selection |