diff options
author | Armin Le Grand <alg@apache.org> | 2012-11-28 12:52:24 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2013-06-12 17:16:53 +0100 |
commit | 829d31c122afe13df3463fe905fff4a9e93d13db (patch) | |
tree | 5cfbd11d1888feb0c9dc3b9d47a064ab035eb7ae /drawinglayer | |
parent | c856a390abbf278a6c4c80f36c8e64d15554a1ae (diff) |
Resolves: #i121387# Corrected RenderBitmapPrimitive2D_GraphicManager...
to correctly handle cases with combinations of mirroring and rotation, also
changed VclProcessor2D::RenderBitmapPrimitive2D to use own bitmapEx renderer
for these cases for better quality
(cherry picked from commit b8cf3355071035085c705a65558cd4a6cefe8f47)
Change-Id: I3f0c61db9c776299e9ee866c4e54d9c6ac431a31
Diffstat (limited to 'drawinglayer')
-rw-r--r-- | drawinglayer/source/processor2d/vclhelperbitmaprender.cxx | 20 | ||||
-rw-r--r-- | drawinglayer/source/processor2d/vclprocessor2d.cxx | 11 |
2 files changed, 26 insertions, 5 deletions
diff --git a/drawinglayer/source/processor2d/vclhelperbitmaprender.cxx b/drawinglayer/source/processor2d/vclhelperbitmaprender.cxx index 3cd0bfb7caa8..f1aa08cbb05b 100644 --- a/drawinglayer/source/processor2d/vclhelperbitmaprender.cxx +++ b/drawinglayer/source/processor2d/vclhelperbitmaprender.cxx @@ -67,12 +67,28 @@ namespace drawinglayer { // if rotated, create the unrotated output rectangle for the GraphicManager paint // #118824# Caution! When mirrored, adapt transformation accordingly + // #i121387# Also need to adapt position when mirror and rotation is combined + if(bMirrorX || bMirrorY) + { + const basegfx::B2DHomMatrix aRot(basegfx::tools::createRotateB2DHomMatrix(fRotate)); + + if(bMirrorX) + { + aTranslate += aRot * basegfx::B2DVector(aScale.getX(), 0.0); + } + + if(bMirrorY) + { + aTranslate += aRot * basegfx::B2DVector(0.0, aScale.getY()); + } + } + const basegfx::B2DHomMatrix aSimpleObjectMatrix( basegfx::tools::createScaleTranslateB2DHomMatrix( fabs(aScale.getX()), fabs(aScale.getY()), - bMirrorX ? aTranslate.getX() - fabs(aScale.getX()): aTranslate.getX(), - bMirrorY ? aTranslate.getY() - fabs(aScale.getY()): aTranslate.getY())); + aTranslate.getX(), + aTranslate.getY())); aOutlineRange.transform(aSimpleObjectMatrix); } diff --git a/drawinglayer/source/processor2d/vclprocessor2d.cxx b/drawinglayer/source/processor2d/vclprocessor2d.cxx index 9741bc8e6b6d..bdf451ef0bb8 100644 --- a/drawinglayer/source/processor2d/vclprocessor2d.cxx +++ b/drawinglayer/source/processor2d/vclprocessor2d.cxx @@ -450,9 +450,14 @@ namespace drawinglayer double fRotate, fShearX; aLocalTransform.decompose(aScale, aTranslate, fRotate, fShearX); - if(!bForceUseOfOwnTransformer && basegfx::fTools::equalZero(fShearX)) + // #i121387# when mirrored and rotated, avoid the GraphicManager output which has low quality + const bool bRotated(basegfx::fTools::equalZero(fRotate)); + const bool bSheared(basegfx::fTools::equalZero(fShearX)); + const bool bMirroredAndRotated(bRotated && (aScale.getX() < 0.0 || aScale.getY() < 0.0)); + + if(!bForceUseOfOwnTransformer && !bSheared && !bMirroredAndRotated) { - if(!bUseGraphicManager && basegfx::fTools::equalZero(fRotate)) + if(!bUseGraphicManager && !bRotated) { RenderBitmapPrimitive2D_BitmapEx(*mpOutputDevice, aBitmapEx, aLocalTransform); } @@ -463,7 +468,7 @@ namespace drawinglayer } else { - if(!aBitmapEx.IsTransparent() && (!basegfx::fTools::equalZero(fShearX) || !basegfx::fTools::equalZero(fRotate))) + if(!aBitmapEx.IsTransparent() && (bSheared || bRotated)) { // parts will be uncovered, extend aBitmapEx with a mask bitmap const Bitmap aContent(aBitmapEx.GetBitmap()); |