From e8e94a05fcc4906e06f0f283432b73470974d588 Mon Sep 17 00:00:00 2001 From: Jan Holesovsky Date: Wed, 24 Apr 2013 16:15:19 +0200 Subject: fdo#59259: Suppress the expensive parts when we are only writing to metafile. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When we are launching the printing dialog, we first draw the page using drawinglayer to a metafile, and then render the metafile. Unfortunately, here we did the real operation of allocating large bitmaps, and destroying them again; all that just to throw all that away at the end of the operation. The preview sets the mbOutput to false correctly, so we can just skip the expensive parts. Change-Id: Ice77d83100eba339602bbdf374fec8546d4d1e12 Reviewed-on: https://gerrit.libreoffice.org/3597 Reviewed-by: Fridrich Strba Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara --- vcl/source/gdi/outdev6.cxx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/vcl/source/gdi/outdev6.cxx b/vcl/source/gdi/outdev6.cxx index 46eb689356ff..85f6ce5f70da 100644 --- a/vcl/source/gdi/outdev6.cxx +++ b/vcl/source/gdi/outdev6.cxx @@ -614,6 +614,9 @@ void OutputDevice::DrawTransparent( const GDIMetaFile& rMtf, const Point& rPos, if( mpMetaFile ) mpMetaFile->AddAction( new MetaFloatTransparentAction( rMtf, rPos, rSize, rTransparenceGradient ) ); + if ( !IsDeviceOutputNecessary() ) + return; + if( ( rTransparenceGradient.GetStartColor() == aBlack && rTransparenceGradient.GetEndColor() == aBlack ) || ( mnDrawMode & ( DRAWMODE_NOTRANSPARENCY ) ) ) { -- cgit v1.2.3