summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFridrich Štrba <fridrich.strba@bluewin.ch>2013-08-30 14:31:29 +0200
committerFridrich Štrba <fridrich.strba@bluewin.ch>2013-08-30 14:37:27 +0200
commit21ee132af1b888f50a9d916337011879570ca357 (patch)
treed9bb87b2f8bdd9fb5ca82963b02e704b0e7072c2
parentstartcenter: Add toggle to view templates in Start Center (diff)
downloadcore-21ee132af1b888f50a9d916337011879570ca357.tar.gz
core-21ee132af1b888f50a9d916337011879570ca357.zip
Revert some random work-in-progress that is most probably bitrotten
Revert "EMF+: aBaseTransform is a hardcoded identity matrix, don't bother with it" This reverts commit 2b700a710e44d2d09f45793f5f2448268e66d4fe. Revert "Pass also the bounding box in device units to the EMF+ part" This reverts commit f387c5da5a824df6cf2874155c13445a86804475.
-rw-r--r--cppcanvas/source/inc/implrenderer.hxx5
-rw-r--r--cppcanvas/source/mtfrenderer/emfplus.cxx15
-rw-r--r--cppcanvas/source/mtfrenderer/implrenderer.cxx5
-rw-r--r--vcl/source/filter/wmf/winmtf.cxx16
4 files changed, 28 insertions, 13 deletions
diff --git a/cppcanvas/source/inc/implrenderer.hxx b/cppcanvas/source/inc/implrenderer.hxx
index 63cce82fbab6..79a2967f88d6 100644
--- a/cppcanvas/source/inc/implrenderer.hxx
+++ b/cppcanvas/source/inc/implrenderer.hxx
@@ -286,6 +286,7 @@ static float GetSwapFloat( SvStream& rSt )
ActionVector maActions;
/* EMF+ */
+ XForm aBaseTransform;
XForm aWorldTransform;
EMFPObject* aObjects [256];
float fPageScale;
@@ -294,10 +295,6 @@ static float GetSwapFloat( SvStream& rSt )
sal_Int32 nHDPI;
sal_Int32 nVDPI;
/* EMF+ emf header info */
- sal_Int32 nBoundsLeft;
- sal_Int32 nBoundsTop;
- sal_Int32 nBoundsRight;
- sal_Int32 nBoundsBottom;
sal_Int32 nFrameLeft;
sal_Int32 nFrameTop;
sal_Int32 nFrameRight;
diff --git a/cppcanvas/source/mtfrenderer/emfplus.cxx b/cppcanvas/source/mtfrenderer/emfplus.cxx
index 384dd2c0555e..a88ae1277da2 100644
--- a/cppcanvas/source/mtfrenderer/emfplus.cxx
+++ b/cppcanvas/source/mtfrenderer/emfplus.cxx
@@ -865,6 +865,9 @@ namespace cppcanvas
x -= nFrameLeft;
y -= nFrameTop;
+ x *= aBaseTransform.eM11;
+ y *= aBaseTransform.eM22;
+
return ::basegfx::B2DPoint (x, y);
}
@@ -877,6 +880,9 @@ namespace cppcanvas
MapToDevice (w, h);
+ w *= aBaseTransform.eM11;
+ h *= aBaseTransform.eM22;
+
return ::basegfx::B2DSize (w, h);
}
@@ -927,6 +933,7 @@ namespace cppcanvas
::basegfx::B2DHomMatrix aTextureTransformation;
::basegfx::B2DHomMatrix aWorldTransformation;
+ ::basegfx::B2DHomMatrix aBaseTransformation;
rendering::Texture aTexture;
aWorldTransformation.set (0, 0, aWorldTransform.eM11);
@@ -936,6 +943,13 @@ namespace cppcanvas
aWorldTransformation.set (1, 1, aWorldTransform.eM22);
aWorldTransformation.set (1, 2, aWorldTransform.eDy);
+ aBaseTransformation.set (0, 0, aBaseTransform.eM11);
+ aBaseTransformation.set (0, 1, aBaseTransform.eM21);
+ aBaseTransformation.set (0, 2, aBaseTransform.eDx);
+ aBaseTransformation.set (1, 0, aBaseTransform.eM12);
+ aBaseTransformation.set (1, 1, aBaseTransform.eM22);
+ aBaseTransformation.set (1, 2, aBaseTransform.eDy);
+
if (brush->type == 4) {
aTextureTransformation.scale (brush->areaWidth, brush->areaHeight);
aTextureTransformation.translate (brush->areaX, brush->areaY);
@@ -962,6 +976,7 @@ namespace cppcanvas
aTextureTransformation.scale (100.0*nMmX/nPixX, 100.0*nMmY/nPixY);
aTextureTransformation.translate (-nFrameLeft, -nFrameTop);
aTextureTransformation *= rState.mapModeTransform;
+ aTextureTransformation *= aBaseTransformation;
aTexture.RepeatModeX = rendering::TexturingMode::CLAMP;
aTexture.RepeatModeY = rendering::TexturingMode::CLAMP;
diff --git a/cppcanvas/source/mtfrenderer/implrenderer.cxx b/cppcanvas/source/mtfrenderer/implrenderer.cxx
index 17c68c4e5072..c9489afd244c 100644
--- a/cppcanvas/source/mtfrenderer/implrenderer.cxx
+++ b/cppcanvas/source/mtfrenderer/implrenderer.cxx
@@ -1787,12 +1787,13 @@ namespace cppcanvas
SvMemoryStream rMF ((void*) pAct->GetData (), pAct->GetDataSize (), STREAM_READ);
- rMF >> nBoundsLeft >> nBoundsTop >> nBoundsRight >> nBoundsBottom;
- SAL_INFO ("cppcanvas.emf", "EMF+ picture bounds: " << nBoundsLeft << "," << nBoundsTop << " - " << nBoundsRight << "," << nBoundsBottom);
rMF >> nFrameLeft >> nFrameTop >> nFrameRight >> nFrameBottom;
SAL_INFO ("cppcanvas.emf", "EMF+ picture frame: " << nFrameLeft << "," << nFrameTop << " - " << nFrameRight << "," << nFrameBottom);
rMF >> nPixX >> nPixY >> nMmX >> nMmY;
SAL_INFO ("cppcanvas.emf", "EMF+ ref device pixel size: " << nPixX << "x" << nPixY << " mm size: " << nMmX << "x" << nMmY);
+
+ rMF >> aBaseTransform;
+ //aWorldTransform.Set (aBaseTransform);
}
}
break;
diff --git a/vcl/source/filter/wmf/winmtf.cxx b/vcl/source/filter/wmf/winmtf.cxx
index ff7fc2e43902..0972dcdc6f18 100644
--- a/vcl/source/filter/wmf/winmtf.cxx
+++ b/vcl/source/filter/wmf/winmtf.cxx
@@ -2233,24 +2233,26 @@ void WinMtfOutput::PassEMFPlusHeaderInfo()
EMFP_DEBUG(printf ("\t\t\tadd EMF_PLUS header info\n"));
SvMemoryStream mem;
- sal_Int32 nDevLeft, nDevRight, nDevTop, nDevBottom;
sal_Int32 nLeft, nRight, nTop, nBottom;
- nDevLeft = mrclBounds.Left();
- nDevRight = mrclBounds.Right();
- nDevTop = mrclBounds.Top();
- nDevBottom = mrclBounds.Bottom();
-
nLeft = mrclFrame.Left();
nTop = mrclFrame.Top();
nRight = mrclFrame.Right();
nBottom = mrclFrame.Bottom();
// emf header info
- mem << nDevLeft << nDevTop << nDevRight << nDevBottom;
mem << nLeft << nTop << nRight << nBottom;
mem << mnPixX << mnPixY << mnMillX << mnMillY;
+ float one, zero;
+
+ one = 1;
+ zero = 0;
+
+ // add transformation matrix to be used in vcl's metaact.cxx for
+ // rotate and scale operations
+ mem << one << zero << zero << one << zero << zero;
+
// need to flush the stream, otherwise GetEndOfData will return 0
// on windows where the function parameters are probably resolved in reverse order
mem.Flush();