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

Jan-Marek Glogowski (via logerrit) logerrit at kemper.freedesktop.org
Sat Jun 22 12:26:35 UTC 2019


 vcl/source/outdev/gradient.cxx |   19 +++++--------------
 1 file changed, 5 insertions(+), 14 deletions(-)

New commits:
commit 24c21375f9983428cabf46407943a2b2daa5a8f0
Author:     Jan-Marek Glogowski <glogow at fbihome.de>
AuthorDate: Fri Jun 21 13:29:35 2019 +0200
Commit:     Jan-Marek Glogowski <glogow at fbihome.de>
CommitDate: Sat Jun 22 14:25:53 2019 +0200

    tdf#125670 check graphics before output cliprect
    
    Brown paperbag fix. Caolan and me were so concerned about performance
    that we actually forgot about the intention of the original fix to
    ensure a valid graphics before checking the output clip rect, so in
    the end we re-introduced the bug.
    
    This basically reverts commit aeead1782ff1 ("Related: tdf#125670
    avoid possible performance issues for the general case"). The output
    clip rect is not needed for the metafile, as it is ignored.
    
    Change-Id: I68f4367cc3afbd659f691999b675a81a21258106
    Reviewed-on: https://gerrit.libreoffice.org/74550
    Tested-by: Jenkins
    Reviewed-by: Jan-Marek Glogowski <glogow at fbihome.de>

diff --git a/vcl/source/outdev/gradient.cxx b/vcl/source/outdev/gradient.cxx
index eb240b0f735c..7fc37b31c9ab 100644
--- a/vcl/source/outdev/gradient.cxx
+++ b/vcl/source/outdev/gradient.cxx
@@ -50,12 +50,6 @@ void OutputDevice::DrawGradient( const tools::PolyPolygon& rPolyPoly,
 {
     assert(!is_double_buffered_window());
 
-    if (mbInitClipRegion)
-        InitClipRegion();
-
-    if (mbOutputClipped && !mpMetaFile)
-        return;
-
     if ( rPolyPoly.Count() && rPolyPoly[ 0 ].GetSize() )
     {
         if ( mnDrawMode & ( DrawModeFlags::BlackGradient | DrawModeFlags::WhiteGradient | DrawModeFlags::SettingsGradient) )
@@ -100,23 +94,20 @@ void OutputDevice::DrawGradient( const tools::PolyPolygon& rPolyPoly,
                 if( !mpGraphics && !AcquireGraphics() )
                     return;
 
-                // secure clip region
-                Push( PushFlags::CLIPREGION );
-                IntersectClipRegion( aBoundRect );
-
                 if( mbInitClipRegion )
                     InitClipRegion();
 
                 if (mbOutputClipped)
-                {
-                    Pop();
                     return;
-                }
+
+                // secure clip region
+                Push( PushFlags::CLIPREGION );
+                IntersectClipRegion( aBoundRect );
 
                 // try to draw gradient natively
                 bDrawn = mpGraphics->DrawGradient( aClixPolyPoly, aGradient );
 
-                if( !bDrawn && !mbOutputClipped )
+                if (!bDrawn)
                 {
                     // draw gradients without border
                     if( mbLineColor || mbInitLineColor )


More information about the Libreoffice-commits mailing list