[Libreoffice-commits] core.git: vcl/source

Miklos Vajna vmiklos at collabora.co.uk
Fri Jul 31 09:28:33 PDT 2015


 vcl/source/window/paint.cxx |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

New commits:
commit 43ac95ab64980ed958ba144c33971f897791d15f
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Fri Jul 31 18:01:13 2015 +0200

    tdf#92982 vcl rendercontext: handle empty repaint rect in PaintHelper
    
    Empty repaint rectangle means the whole window, while Erase() is a NOP
    in case of an empty rectangle.
    
    This fixes the sidebar rendering artifacts the screenshot shows in the
    bugreport.
    
    Change-Id: I12e35ceb0aa529d65b7acf01d8cdb719101adebe

diff --git a/vcl/source/window/paint.cxx b/vcl/source/window/paint.cxx
index 9a4ca08..b707a54 100644
--- a/vcl/source/window/paint.cxx
+++ b/vcl/source/window/paint.cxx
@@ -114,8 +114,12 @@ void PaintHelper::StartBufferedPaint()
 
     // Instead of creating a new VirtualDevice, just erase the area we'll be
     // painting over, as VirtualDevice::ImplInitVirDev() would do.
+    // The painted area is m_aPaintRect, or in case it's empty, then the whole window.
     pFrameData->mpBuffer->SetBackground(Wallpaper(Color(COL_WHITE)));
-    pFrameData->mpBuffer->Erase(m_aPaintRect);
+    if (m_aPaintRect.IsEmpty())
+        pFrameData->mpBuffer->Erase(Rectangle(Point(0, 0), m_pWindow->GetOutputSize()));
+    else
+        pFrameData->mpBuffer->Erase(m_aPaintRect);
 
     pFrameData->mbInBufferedPaint = true;
     m_bCreatedBuffer = true;


More information about the Libreoffice-commits mailing list