summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorArmin Le Grand <Armin.Le.Grand@Sun.COM>2009-09-22 18:14:05 +0200
committerArmin Le Grand <Armin.Le.Grand@Sun.COM>2009-09-22 18:14:05 +0200
commit7857f07d09265f58b2c17c4f619f4aad81b1c43d (patch)
treea88bc2ea43db41f9cb3a715651cfe77b477643f6 /vcl
parent1f0839c836781bc41f8c301b6262eabc978c90f8 (diff)
#i97509# continued matrix tooling and adapting the usages now to all the ooo code
Diffstat (limited to 'vcl')
-rw-r--r--vcl/aqua/source/gdi/salgdi.cxx4
-rw-r--r--vcl/os2/source/gdi/salgdi3.cxx6
-rw-r--r--vcl/source/gdi/region.cxx9
-rwxr-xr-xvcl/source/gdi/sallayout.cxx7
-rw-r--r--vcl/source/glyphs/gcach_ftyp.cxx4
-rw-r--r--vcl/unx/source/gdi/salgdi.cxx8
-rw-r--r--vcl/win/source/gdi/salgdi3.cxx6
7 files changed, 15 insertions, 29 deletions
diff --git a/vcl/aqua/source/gdi/salgdi.cxx b/vcl/aqua/source/gdi/salgdi.cxx
index e0905fe1d377..8d57d56a3667 100644
--- a/vcl/aqua/source/gdi/salgdi.cxx
+++ b/vcl/aqua/source/gdi/salgdi.cxx
@@ -1753,9 +1753,7 @@ BOOL AquaSalGraphics::GetGlyphOutline( long nGlyphId, basegfx::B2DPolyPolygon& r
GgoClosePathProc( &aGgoData );
if( mfFontScale != 1.0 ) {
- basegfx::B2DHomMatrix aScale;
- aScale.scale( +mfFontScale, +mfFontScale );
- rPolyPoly.transform( aScale );
+ rPolyPoly.transform(basegfx::tools::createScaleB2DHomMatrix(+mfFontScale, +mfFontScale));
}
return true;
}
diff --git a/vcl/os2/source/gdi/salgdi3.cxx b/vcl/os2/source/gdi/salgdi3.cxx
index 573fa7336fb0..b25feee266e4 100644
--- a/vcl/os2/source/gdi/salgdi3.cxx
+++ b/vcl/os2/source/gdi/salgdi3.cxx
@@ -1361,10 +1361,8 @@ BOOL Os2SalGraphics::GetGlyphOutline( long nIndex, ::basegfx::B2DPolyPolygon& rB
// rescaling needed for the PolyPolygon conversion
if( rB2DPolyPoly.count() )
{
- ::basegfx::B2DHomMatrix aMatrix;
- aMatrix.scale( 1.0/256, 1.0/256 );
- aMatrix.scale( mfFontScale, mfFontScale );
- rB2DPolyPoly.transform( aMatrix );
+ const double fFactor((1.0/256) * mfFontScale);
+ rB2DPolyPoly.transform(basegfx::tools::createScaleB2DHomMatrix(fFactor, fFactor));
}
return bRet;
diff --git a/vcl/source/gdi/region.cxx b/vcl/source/gdi/region.cxx
index b98712419cf1..9cced7de3651 100644
--- a/vcl/source/gdi/region.cxx
+++ b/vcl/source/gdi/region.cxx
@@ -49,6 +49,7 @@
#include <basegfx/matrix/b2dhommatrix.hxx>
#include <basegfx/polygon/b2dpolypolygontools.hxx>
#include <basegfx/range/b2drange.hxx>
+#include <basegfx/matrix/b2dhommatrixtools.hxx>
// =======================================================================
//
@@ -1300,9 +1301,7 @@ void Region::Move( long nHorzMove, long nVertMove )
mpImplRegion->mpPolyPoly->Move( nHorzMove, nVertMove );
else if( mpImplRegion->mpB2DPolyPoly )
{
- ::basegfx::B2DHomMatrix aTransform;
- aTransform.translate( nHorzMove, nVertMove );
- mpImplRegion->mpB2DPolyPoly->transform( aTransform );
+ mpImplRegion->mpB2DPolyPoly->transform(basegfx::tools::createTranslateB2DHomMatrix(nHorzMove, nVertMove));
}
else
{
@@ -1343,9 +1342,7 @@ void Region::Scale( double fScaleX, double fScaleY )
mpImplRegion->mpPolyPoly->Scale( fScaleX, fScaleY );
else if( mpImplRegion->mpB2DPolyPoly )
{
- ::basegfx::B2DHomMatrix aTransform;
- aTransform.scale( fScaleX, fScaleY );
- mpImplRegion->mpB2DPolyPoly->transform( aTransform );
+ mpImplRegion->mpB2DPolyPoly->transform(basegfx::tools::createScaleB2DHomMatrix(fScaleX, fScaleY));
}
else
{
diff --git a/vcl/source/gdi/sallayout.cxx b/vcl/source/gdi/sallayout.cxx
index 21ac05a498fc..b69a9c365f08 100755
--- a/vcl/source/gdi/sallayout.cxx
+++ b/vcl/source/gdi/sallayout.cxx
@@ -44,6 +44,7 @@
#include <vcl/sallayout.hxx>
#include <basegfx/polygon/b2dpolypolygon.hxx>
#include <basegfx/matrix/b2dhommatrix.hxx>
+#include <basegfx/matrix/b2dhommatrixtools.hxx>
#include <i18npool/lang.h>
#ifndef _TL_DEBUG_HXX
@@ -891,10 +892,8 @@ bool SalLayout::GetOutline( SalGraphics& rSalGraphics,
{
if( aPos.X() || aPos.Y() )
{
- ::basegfx::B2DHomMatrix aMatrix;
- aMatrix.translate( aPos.X(), aPos.Y() );
- aGlyphOutline.transform( aMatrix );
- }
+ aGlyphOutline.transform(basegfx::tools::createTranslateB2DHomMatrix(aPos.X(), aPos.Y()));
+ }
// insert outline at correct position
rVector.push_back( aGlyphOutline );
diff --git a/vcl/source/glyphs/gcach_ftyp.cxx b/vcl/source/glyphs/gcach_ftyp.cxx
index 712c2334b35c..820f3f0d74a9 100644
--- a/vcl/source/glyphs/gcach_ftyp.cxx
+++ b/vcl/source/glyphs/gcach_ftyp.cxx
@@ -2280,9 +2280,7 @@ bool FreetypeServerFont::GetGlyphOutline( int nGlyphIndex,
// convert to basegfx polypolygon
// TODO: get rid of the intermediate tools polypolygon
rB2DPolyPoly = aToolPolyPolygon.getB2DPolyPolygon();
- ::basegfx::B2DHomMatrix aMatrix;
- aMatrix.scale( +1.0/(1<<6), -1.0/(1<<6) );
- rB2DPolyPoly.transform( aMatrix );
+ rB2DPolyPoly.transform(basegfx::tools::createScaleB2DHomMatrix( +1.0/(1<<6), -1.0/(1<<6) ));
return true;
}
diff --git a/vcl/unx/source/gdi/salgdi.cxx b/vcl/unx/source/gdi/salgdi.cxx
index 4d3e40840a7b..d140610f7875 100644
--- a/vcl/unx/source/gdi/salgdi.cxx
+++ b/vcl/unx/source/gdi/salgdi.cxx
@@ -1506,9 +1506,7 @@ bool X11SalGraphics::drawPolyLine(const ::basegfx::B2DPolygon& rPolygon, const :
&& !basegfx::fTools::equalZero( rLineWidth.getY() ) )
{
// prepare for createAreaGeometry() with anisotropic linewidth
- basegfx::B2DHomMatrix aAnisoMatrix;
- aAnisoMatrix.scale( 1.0, rLineWidth.getX() / rLineWidth.getY() );
- aPolygon.transform( aAnisoMatrix );
+ aPolygon.transform(basegfx::tools::createScaleB2DHomMatrix(1.0, rLineWidth.getX() / rLineWidth.getY()));
}
// AW: reSegment no longer needed; new createAreaGeometry will remove exteme positions
@@ -1523,9 +1521,7 @@ bool X11SalGraphics::drawPolyLine(const ::basegfx::B2DPolygon& rPolygon, const :
&& !basegfx::fTools::equalZero( rLineWidth.getX() ) )
{
// postprocess createAreaGeometry() for anisotropic linewidth
- basegfx::B2DHomMatrix aAnisoMatrix;
- aAnisoMatrix.scale( 1.0, rLineWidth.getY() / rLineWidth.getX() );
- aPolygon.transform( aAnisoMatrix );
+ aPolygon.transform(basegfx::tools::createScaleB2DHomMatrix(1.0, rLineWidth.getY() / rLineWidth.getX()));
}
// temporarily adjust brush color to pen color
diff --git a/vcl/win/source/gdi/salgdi3.cxx b/vcl/win/source/gdi/salgdi3.cxx
index 73f4d8320acc..0da51ccc2de9 100644
--- a/vcl/win/source/gdi/salgdi3.cxx
+++ b/vcl/win/source/gdi/salgdi3.cxx
@@ -65,6 +65,7 @@
#include "basegfx/polygon/b2dpolygon.hxx"
#include "basegfx/polygon/b2dpolypolygon.hxx"
#include "basegfx/matrix/b2dhommatrix.hxx"
+#include <basegfx/matrix/b2dhommatrixtools.hxx>
#include "sft.hxx"
@@ -2480,9 +2481,8 @@ BOOL WinSalGraphics::GetGlyphOutline( long nIndex,
// rescaling needed for the PolyPolygon conversion
if( rB2DPolyPoly.count() )
{
- ::basegfx::B2DHomMatrix aMatrix;
- aMatrix.scale( mfFontScale/256, mfFontScale/256 );
- rB2DPolyPoly.transform( aMatrix );
+ const double fFactor(mfFontScale/256);
+ rB2DPolyPoly.transform(basegfx::tools::createScaleB2DHomMatrix(fFactor, fFactor));
}
return bRet;