Kaydet (Commit) 4c0bfbd4 authored tarafından Radek Doulik's avatar Radek Doulik Kaydeden (comit) Fridrich Strba

implemented EmfPlusRecordTypeSetClipRect record

(cherry picked from commit f2d9db4e)

Conflicts:
	cppcanvas/source/mtfrenderer/emfplus.cxx

Change-Id: I0778cf44a1f4e920e723c17c34f6de4f8eed2342
Reviewed-on: https://gerrit.libreoffice.org/2753Reviewed-by: 's avatarFridrich Strba <fridrich@documentfoundation.org>
Tested-by: 's avatarFridrich Strba <fridrich@documentfoundation.org>
üst 46d4224d
...@@ -72,6 +72,7 @@ ...@@ -72,6 +72,7 @@
#define EmfPlusRecordTypeResetWorldTransform 16427 #define EmfPlusRecordTypeResetWorldTransform 16427
#define EmfPlusRecordTypeMultiplyWorldTransform 16428 #define EmfPlusRecordTypeMultiplyWorldTransform 16428
#define EmfPlusRecordTypeSetPageTransform 16432 #define EmfPlusRecordTypeSetPageTransform 16432
#define EmfPlusRecordTypeSetClipRect 16434
#define EmfPlusRecordTypeSetClipPath 16435 #define EmfPlusRecordTypeSetClipPath 16435
#define EmfPlusRecordTypeSetClipRegion 16436 #define EmfPlusRecordTypeSetClipRegion 16436
#define EmfPlusRecordTypeDrawDriverString 16438 #define EmfPlusRecordTypeDrawDriverString 16438
...@@ -1697,30 +1698,58 @@ namespace cppcanvas ...@@ -1697,30 +1698,58 @@ namespace cppcanvas
aWorldTransform.eDx, aWorldTransform.eDy)); aWorldTransform.eDx, aWorldTransform.eDy));
break; 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: 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)); EMFP_DEBUG (printf ("EMF+\tpath in slot: %d\n", flags & 0xff));
EMFPPath& path = *(EMFPPath*) aObjects [flags & 0xff]; EMFPPath& path = *(EMFPPath*) aObjects [flags & 0xff];
::basegfx::B2DPolyPolygon& clipPoly (path.GetPolygon (*this)); ::basegfx::B2DPolyPolygon& clipPoly (path.GetPolygon (*this));
clipPoly.transform (rState.mapModeTransform); clipPoly.transform (rState.mapModeTransform);
updateClipping (clipPoly, rFactoryParms, false); updateClipping (clipPoly, rFactoryParms, combineMode == 1);
break; break;
} }
case EmfPlusRecordTypeSetClipRegion: { case EmfPlusRecordTypeSetClipRegion: {
int combineMode = (flags >> 8) & 0xf;
EMFP_DEBUG (printf ("EMF+ SetClipRegion\n")); 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]; EMFPRegion *region = (EMFPRegion*)aObjects [flags & 0xff];
// reset clip // reset clip
if (region && region->parts == 0 && region->initialState == EmfPlusRegionInitialStateInfinite) { if (region && region->parts == 0 && region->initialState == EmfPlusRegionInitialStateInfinite) {
updateClipping (::basegfx::B2DPolyPolygon (), rFactoryParms, false); updateClipping (::basegfx::B2DPolyPolygon (), rFactoryParms, combineMode == 1);
} else { } else {
EMFP_DEBUG (printf ("EMF+\tTODO\n")); EMFP_DEBUG (printf ("EMF+\tTODO\n"));
} }
break; break;
} }
case EmfPlusRecordTypeDrawDriverString: { case EmfPlusRecordTypeDrawDriverString: {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment