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

Miklos Vajna vmiklos at collabora.co.uk
Mon Aug 10 09:24:22 PDT 2015


 vcl/source/gdi/impanmvw.cxx |   23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

New commits:
commit cd064472ce4ff9d1dd6720c32fde22f36eb232f4
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Mon Aug 10 16:44:03 2015 +0200

    tdf#93325 ImplAnimView rendercontext: stop painting animgifs directly
    
    Change-Id: I34fb235a2e44eb510a630fb8dbcc2ec68cf96b79
    Reviewed-on: https://gerrit.libreoffice.org/17624
    Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>
    Tested-by: Jenkins <ci at libreoffice.org>

diff --git a/vcl/source/gdi/impanmvw.cxx b/vcl/source/gdi/impanmvw.cxx
index 4794cd4..2b28b3c 100644
--- a/vcl/source/gdi/impanmvw.cxx
+++ b/vcl/source/gdi/impanmvw.cxx
@@ -18,6 +18,7 @@
  */
 
 #include "impanmvw.hxx"
+#include <window.h>
 #include <vcl/virdev.hxx>
 #include <vcl/window.hxx>
 #include <tools/helpers.hxx>
@@ -154,6 +155,15 @@ void ImplAnimView::getPosSize( const AnimationBitmap& rAnm, Point& rPosPix, Size
 void ImplAnimView::drawToPos( sal_uLong nPos )
 {
     VclPtr<vcl::RenderContext> pRenderContext = mpOut;
+
+    std::unique_ptr<PaintBufferGuard> pGuard;
+    if (mpOut->GetOutDevType() == OUTDEV_WINDOW)
+    {
+        vcl::Window* pWindow = static_cast<vcl::Window*>(mpOut.get());
+        pGuard.reset(new PaintBufferGuard(pWindow->ImplGetWindowImpl()->mpFrameData, pWindow));
+        pRenderContext = pGuard->GetRenderContext();
+    }
+
     ScopedVclPtrInstance<VirtualDevice> aVDev;
     std::unique_ptr<vcl::Region> xOldClip(!maClip.IsNull() ? new vcl::Region( pRenderContext->GetClipRegion() ) : NULL);
 
@@ -167,6 +177,8 @@ void ImplAnimView::drawToPos( sal_uLong nPos )
         pRenderContext->SetClipRegion( maClip );
 
     pRenderContext->DrawOutDev( maDispPt, maDispSz, Point(), maSzPix, *aVDev.get() );
+    if (pGuard)
+        pGuard->SetPaintRect(Rectangle(maDispPt, maDispSz));
 
     if (xOldClip)
         pRenderContext->SetClipRegion(*xOldClip);
@@ -175,6 +187,15 @@ void ImplAnimView::drawToPos( sal_uLong nPos )
 void ImplAnimView::draw( sal_uLong nPos, VirtualDevice* pVDev )
 {
     VclPtr<vcl::RenderContext> pRenderContext = mpOut;
+
+    std::unique_ptr<PaintBufferGuard> pGuard;
+    if (!pVDev && mpOut->GetOutDevType() == OUTDEV_WINDOW)
+    {
+        vcl::Window* pWindow = static_cast<vcl::Window*>(mpOut.get());
+        pGuard.reset(new PaintBufferGuard(pWindow->ImplGetWindowImpl()->mpFrameData, pWindow));
+        pRenderContext = pGuard->GetRenderContext();
+    }
+
     Rectangle aOutRect( pRenderContext->PixelToLogic( Point() ), pRenderContext->GetOutputSize() );
 
     // check, if output lies out of display
@@ -268,6 +289,8 @@ void ImplAnimView::draw( sal_uLong nPos, VirtualDevice* pVDev )
                 pRenderContext->SetClipRegion( maClip );
 
             pRenderContext->DrawOutDev( maDispPt, maDispSz, Point(), maSzPix, *pDev );
+            if (pGuard)
+                pGuard->SetPaintRect(Rectangle(maDispPt, maDispSz));
 
             if( xOldClip)
             {


More information about the Libreoffice-commits mailing list