Hi,
I have submitted a patch for review:
https://gerrit.libreoffice.org/2754
To pull it, you can do:
git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/54/2754/1
implemented EmfPlusRecordTypeSetClipRect record
(cherry picked from commit f2d9db4ef951d04c63733b08dd8746c196dd5f05)
Conflicts:
cppcanvas/source/mtfrenderer/emfplus.cxx
Change-Id: I0778cf44a1f4e920e723c17c34f6de4f8eed2342
Reviewed-on: https://gerrit.libreoffice.org/2753
Reviewed-by: Fridrich Strba <fridrich@documentfoundation.org>
Tested-by: Fridrich Strba <fridrich@documentfoundation.org>
(cherry picked from commit 4c0bfbd4126e377e06d6a48c2bfcc56ffa422740)
---
M cppcanvas/source/mtfrenderer/emfplus.cxx
1 file changed, 34 insertions(+), 5 deletions(-)
diff --git a/cppcanvas/source/mtfrenderer/emfplus.cxx b/cppcanvas/source/mtfrenderer/emfplus.cxx
index de5c480..491b085 100644
--- a/cppcanvas/source/mtfrenderer/emfplus.cxx
+++ b/cppcanvas/source/mtfrenderer/emfplus.cxx
@@ -72,6 +72,7 @@
#define EmfPlusRecordTypeResetWorldTransform 16427
#define EmfPlusRecordTypeMultiplyWorldTransform 16428
#define EmfPlusRecordTypeSetPageTransform 16432
+#define EmfPlusRecordTypeSetClipRect 16434
#define EmfPlusRecordTypeSetClipPath 16435
#define EmfPlusRecordTypeSetClipRegion 16436
#define EmfPlusRecordTypeDrawDriverString 16438
@@ -1697,30 +1698,58 @@
aWorldTransform.eDx, aWorldTransform.eDy));
break;
}
+ case EmfPlusRecordTypeSetClipRect:
+ {
+ int combineMode = (flags >> 8) & 0xf;
+
+ EMFP_DEBUG (printf ("EMF+ SetClipRect combine mode: %d\n", combineMode));
+ EMFP_DEBUG (if ( combineMode > 1 ) printf ("EMF+ TODO combine mode >
1\n"));
+
+ float dx, dy, dw, dh;
+
+ ReadRectangle (rMF, dx, dy, dw, dh, false);
+
+ EMFP_DEBUG (printf ("EMF+ RectData: %f,%f %fx%f\n", dx, dy, dw, dh));
+
+ B2DPoint mappedPoint (Map (dx, dy));
+ B2DSize mappedSize( MapSize (dw, dh));
+
+ ::basegfx::B2DPolyPolygon polyPolygon( ::basegfx::B2DPolygon(
::basegfx::tools::createPolygonFromRect( ::basegfx::B2DRectangle( mappedPoint.getX(),
mappedPoint.getY(),
+
mappedPoint.getX() + mappedSize.getX(),
+
mappedPoint.getY() + mappedSize.getY() ) ) ) );
+
+ updateClipping (polyPolygon, rFactoryParms, combineMode == 1);
+
+ break;
+ }
case EmfPlusRecordTypeSetClipPath:
{
- EMFP_DEBUG (printf ("EMF+ SetClipPath\n"));
+ int combineMode = (flags >> 8) & 0xf;
+
+ EMFP_DEBUG (printf ("EMF+ SetClipPath combine mode: %d\n", combineMode));
EMFP_DEBUG (printf ("EMF+\tpath in slot: %d\n", flags & 0xff));
EMFPPath& path = *(EMFPPath*) aObjects [flags & 0xff];
::basegfx::B2DPolyPolygon& clipPoly (path.GetPolygon (*this));
clipPoly.transform (rState.mapModeTransform);
- updateClipping (clipPoly, rFactoryParms, false);
+ updateClipping (clipPoly, rFactoryParms, combineMode == 1);
break;
}
case EmfPlusRecordTypeSetClipRegion: {
+ int combineMode = (flags >> 8) & 0xf;
+
EMFP_DEBUG (printf ("EMF+ SetClipRegion\n"));
- EMFP_DEBUG (printf ("EMF+\tregion in slot: %d combine mode: %d\n", flags &
0xff, (flags & 0xff00) >> 8));
+ EMFP_DEBUG (printf ("EMF+\tregion in slot: %d combine mode: %d\n", flags &
0xff, combineMode));
EMFPRegion *region = (EMFPRegion*)aObjects [flags & 0xff];
// reset clip
if (region && region->parts == 0 && region->initialState ==
EmfPlusRegionInitialStateInfinite) {
- updateClipping (::basegfx::B2DPolyPolygon (), rFactoryParms, false);
+ updateClipping (::basegfx::B2DPolyPolygon (), rFactoryParms, combineMode
== 1);
} else {
EMFP_DEBUG (printf ("EMF+\tTODO\n"));
- }
+ }
break;
}
case EmfPlusRecordTypeDrawDriverString: {
--
To view, visit https://gerrit.libreoffice.org/2754
To unsubscribe, visit https://gerrit.libreoffice.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I0778cf44a1f4e920e723c17c34f6de4f8eed2342
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: libreoffice-4-0-2
Gerrit-Owner: Fridrich Strba <fridrich@documentfoundation.org>
Gerrit-Reviewer: Radek DoulĂk <rodo@novell.com>
Context
- [PATCH libreoffice-4-0-2] implemented EmfPlusRecordTypeSetClipRect record · Fridrich Strba (via Code Review)
Privacy Policy |
Impressum (Legal Info) |
Copyright information: Unless otherwise specified, all text and images
on this website are licensed under the
Creative Commons Attribution-Share Alike 3.0 License.
This does not include the source code of LibreOffice, which is
licensed under the Mozilla Public License (
MPLv2).
"LibreOffice" and "The Document Foundation" are
registered trademarks of their corresponding registered owners or are
in actual use as trademarks in one or more countries. Their respective
logos and icons are also subject to international copyright laws. Use
thereof is explained in our
trademark policy.