summaryrefslogtreecommitdiff
path: root/drawinglayer
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2019-03-29 14:32:20 +0000
committerCaolán McNamara <caolanm@redhat.com>2019-03-29 20:19:28 +0100
commitb1f961e3a459d2772f12da556ab74fa635d6a46a (patch)
tree8aa3162b14fd33bbabecf1a28dbec7e7382b9e70 /drawinglayer
parent11fe18ea21974e4fdc01a3f4a455725cec8ce11a (diff)
tdf#115843 avoid using transparent virtualdevice when 100% opaque
which for the common case avoids the narrowing of hidpi outputdevices through non-hidpi bitmaps Change-Id: Ibdc004a0946e8cb118818e58a01e5791c869353a Reviewed-on: https://gerrit.libreoffice.org/69930 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'drawinglayer')
-rw-r--r--drawinglayer/source/processor2d/vclprocessor2d.cxx45
1 files changed, 24 insertions, 21 deletions
diff --git a/drawinglayer/source/processor2d/vclprocessor2d.cxx b/drawinglayer/source/processor2d/vclprocessor2d.cxx
index 64f73b135efc..361f7a5bd5a3 100644
--- a/drawinglayer/source/processor2d/vclprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclprocessor2d.cxx
@@ -729,29 +729,32 @@ namespace drawinglayer
// back to old OutDev
mpOutputDevice = pLastOutputDevice;
- // draw mask
- if(getOptionsDrawinglayer().IsAntiAliasing())
+ // if the mask fills the whole area we can skip
+ // creating a transparent vd and filling it.
+ if (!basegfx::utils::isRectangle(aMask))
{
- // with AA, use 8bit AlphaMask to get nice borders
- VirtualDevice& rTransparence = aBufferDevice.getTransparence();
- rTransparence.SetLineColor();
- rTransparence.SetFillColor(COL_BLACK);
- rTransparence.DrawPolyPolygon(aMask);
-
- // dump buffer to outdev
- aBufferDevice.paint();
- }
- else
- {
- // No AA, use 1bit mask
- VirtualDevice& rMask = aBufferDevice.getMask();
- rMask.SetLineColor();
- rMask.SetFillColor(COL_BLACK);
- rMask.DrawPolyPolygon(aMask);
-
- // dump buffer to outdev
- aBufferDevice.paint();
+ // draw mask
+ if(getOptionsDrawinglayer().IsAntiAliasing())
+ {
+ // with AA, use 8bit AlphaMask to get nice borders
+ VirtualDevice& rTransparence = aBufferDevice.getTransparence();
+ rTransparence.SetLineColor();
+ rTransparence.SetFillColor(COL_BLACK);
+ rTransparence.DrawPolyPolygon(aMask);
+ }
+ else
+ {
+ // No AA, use 1bit mask
+ VirtualDevice& rMask = aBufferDevice.getMask();
+ rMask.SetLineColor();
+ rMask.SetFillColor(COL_BLACK);
+ rMask.DrawPolyPolygon(aMask);
+ }
}
+
+ // dump buffer to outdev
+ aBufferDevice.paint();
+
}
}
}