You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openoffice.apache.org by al...@apache.org on 2012/11/28 14:52:26 UTC

svn commit: r1414687 - in /openoffice/trunk/main/drawinglayer/source/processor2d: vclhelperbitmaprender.cxx vclprocessor2d.cxx

Author: alg
Date: Wed Nov 28 13:52:24 2012
New Revision: 1414687

URL: http://svn.apache.org/viewvc?rev=1414687&view=rev
Log:
#121387# 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

Modified:
    openoffice/trunk/main/drawinglayer/source/processor2d/vclhelperbitmaprender.cxx
    openoffice/trunk/main/drawinglayer/source/processor2d/vclprocessor2d.cxx

Modified: openoffice/trunk/main/drawinglayer/source/processor2d/vclhelperbitmaprender.cxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/drawinglayer/source/processor2d/vclhelperbitmaprender.cxx?rev=1414687&r1=1414686&r2=1414687&view=diff
==============================================================================
--- openoffice/trunk/main/drawinglayer/source/processor2d/vclhelperbitmaprender.cxx (original)
+++ openoffice/trunk/main/drawinglayer/source/processor2d/vclhelperbitmaprender.cxx Wed Nov 28 13:52:24 2012
@@ -74,12 +74,28 @@ namespace drawinglayer
 		{
 			// if rotated, create the unrotated output rectangle for the GraphicManager paint
             // #118824# Caution! When mirrored, adapt transformation accordingly
+            // #121387# 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);
 		}

Modified: openoffice/trunk/main/drawinglayer/source/processor2d/vclprocessor2d.cxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/drawinglayer/source/processor2d/vclprocessor2d.cxx?rev=1414687&r1=1414686&r2=1414687&view=diff
==============================================================================
--- openoffice/trunk/main/drawinglayer/source/processor2d/vclprocessor2d.cxx (original)
+++ openoffice/trunk/main/drawinglayer/source/processor2d/vclprocessor2d.cxx Wed Nov 28 13:52:24 2012
@@ -424,9 +424,14 @@ namespace drawinglayer
 				double fRotate, fShearX;
 				aLocalTransform.decompose(aScale, aTranslate, fRotate, fShearX);
 
-				if(!bForceUseOfOwnTransformer && basegfx::fTools::equalZero(fShearX))
+                // #121387# 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);
 					}
@@ -437,7 +442,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());