summaryrefslogtreecommitdiff
path: root/vcl/source
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2022-08-03 09:44:03 +0200
committerXisco Fauli <xiscofauli@libreoffice.org>2022-08-08 15:59:24 +0200
commit8a3548eb859553a930a6120105cd30b3cc0ffeb3 (patch)
treea60636c881b484ca684d51ac7984c0066c86e430 /vcl/source
parentb87c3e7ecb7e9f1914cc81a1758f9f2aa5170f78 (diff)
tdf#149943 vcl: fix pixelated PDF export and print for a rotated image
The bugdoc has a barcode which looks good in Writer, but it's quite blurry in the PDF export result. This is a problem since commit dd4a67084853a030bf4b9f1f85d728620e0604a5 (vcl: avoid downscale && upscale in DrawTransformedBitmapEx(), 2019-10-08), where the motivation was to not downscale a bitmap in case it has a larger amount of pixels but a smaller logic size. This went wrong here and resulted in a blurry bitmap for a not so small image. Fix the problem by mostly reverting the above commit, because it's no longer necessary: 68549e00d5e23aa22bc974a8151d93cd948444b3 (vcl, BitmapEx transformed draw: special-case simple rotations, 2019-10-10) already made sure that the rotation case doesn't use scaling from the transform. testTdf128630 has been adapted to pass again (after manually verifying that the bugdoc export result is still OK), now the bad case there simply produces a smaller bitmap. (cherry picked from commit 7c94d7267bc8b5f43185204ab4953c4b188214bf) Change-Id: Ib28881c129a0cf037a96eecd065e5cadede97051 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137743 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Signed-off-by: Xisco Fauli <xiscofauli@libreoffice.org> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137950
Diffstat (limited to 'vcl/source')
-rw-r--r--vcl/source/outdev/bitmapex.cxx10
1 files changed, 0 insertions, 10 deletions
diff --git a/vcl/source/outdev/bitmapex.cxx b/vcl/source/outdev/bitmapex.cxx
index 7855d1ae5613..bf84bb35d963 100644
--- a/vcl/source/outdev/bitmapex.cxx
+++ b/vcl/source/outdev/bitmapex.cxx
@@ -624,19 +624,9 @@ void OutputDevice::DrawTransformedBitmapEx(
aTransformed = BitmapEx(aContent, aMaskBmp);
}
- // Remove scaling from aFulltransform: we transform due to shearing or rotation, scaling
- // will happen according to aDestSize.
basegfx::B2DVector aFullScale, aFullTranslate;
double fFullRotate, fFullShearX;
aFullTransform.decompose(aFullScale, aFullTranslate, fFullRotate, fFullShearX);
- // Require positive scaling, negative scaling would loose horizontal or vertical flip.
- if (aFullScale.getX() > 0 && aFullScale.getY() > 0)
- {
- basegfx::B2DHomMatrix aTransform = basegfx::utils::createScaleB2DHomMatrix(
- rOriginalSizePixel.getWidth() / aFullScale.getX(),
- rOriginalSizePixel.getHeight() / aFullScale.getY());
- aFullTransform *= aTransform;
- }
double fSourceRatio = 1.0;
if (rOriginalSizePixel.getHeight() != 0)