diff options
author | Jan-Marek Glogowski <glogow@fbihome.de> | 2019-06-21 13:29:35 +0200 |
---|---|---|
committer | Jan-Marek Glogowski <glogow@fbihome.de> | 2019-06-22 14:25:53 +0200 |
commit | 24c21375f9983428cabf46407943a2b2daa5a8f0 (patch) | |
tree | 5173e3064ac8ea6c6acdf1ded29ee00b8e108181 /vcl | |
parent | 7b8a0044a35067e792627b8545a7bb3622afb9e4 (diff) |
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@fbihome.de>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/source/outdev/gradient.cxx | 19 |
1 files changed, 5 insertions, 14 deletions
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 ) |