summaryrefslogtreecommitdiff
path: root/vcl/source/outdev
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2020-07-31 20:58:30 +0100
committerCaolán McNamara <caolanm@redhat.com>2020-08-01 16:11:05 +0200
commit6beec0ec54975aa02e391c223633a42f6f5afe0e (patch)
treebd05a030ba7a034b68cbc53ea19adfeaa5b47b6e /vcl/source/outdev
parente6b0def979c8e6076f2548a2f4c376867c9e7fdc (diff)
tdf#135325 previews missing content drawn via DrawTransformedBitmapEx
Typically in these OutputDevice methods, the record-to-metafile case the MetaFile is already written to before the test against mbOutputClipped to determine that output to the current device would result in no visual output (due to the output being outside the bounds of the device). In this case the metafile is written after the test, so we must continue past mbOutputClipped if recording to a metafile. It's typical to record with a device of nominal size and play back later against something of a totally different size. Change-Id: Id1249b10f919165582f7de65b4cdc4d48074abaa Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99900 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'vcl/source/outdev')
-rw-r--r--vcl/source/outdev/bitmap.cxx13
1 files changed, 11 insertions, 2 deletions
diff --git a/vcl/source/outdev/bitmap.cxx b/vcl/source/outdev/bitmap.cxx
index 83b625d828cb..83c1843a5300 100644
--- a/vcl/source/outdev/bitmap.cxx
+++ b/vcl/source/outdev/bitmap.cxx
@@ -1213,7 +1213,17 @@ void OutputDevice::DrawTransformedBitmapEx(
if ( mbInitClipRegion )
InitClipRegion();
- if ( mbOutputClipped )
+ const bool bMetafile(nullptr != mpMetaFile);
+ /*
+ tdf#135325 typically in these OutputDevice methods the in
+ record-to-metafile case MetaFile is already written to before the test
+ against mbOutputClipped to determine that output to the current device
+ would result in no visual output. In this case the metafile is written
+ after the test, so we must continue past mbOutputClipped if recording to
+ a metafile. It's typical to record with a device of nominal size and
+ play back later against something of a totally different size.
+ */
+ if (mbOutputClipped && !bMetafile)
return;
#ifdef DO_TIME_TEST
@@ -1233,7 +1243,6 @@ void OutputDevice::DrawTransformedBitmapEx(
static bool bAllowPreferDirectPaint(true);
const bool bInvert(RasterOp::Invert == meRasterOp);
const bool bBitmapChangedColor(mnDrawMode & (DrawModeFlags::BlackBitmap | DrawModeFlags::WhiteBitmap | DrawModeFlags::GrayBitmap ));
- const bool bMetafile(nullptr != mpMetaFile);
const bool bTryDirectPaint(!bInvert && !bBitmapChangedColor && !bMetafile);
if(bAllowPreferDirectPaint && bTryDirectPaint)