summaryrefslogtreecommitdiff
path: root/svtools
diff options
context:
space:
mode:
authorEike Rathke <erack@apache.org>2011-09-10 21:47:32 +0000
committerEike Rathke <erack@apache.org>2011-09-10 21:47:32 +0000
commit385620adb6a48b9d457d316013bdee535faa4f4c (patch)
treeef765f79e551417c410b89156fd53d97a4ce6811 /svtools
parente099c585e6307e3c3c494822e3db7468c83801e4 (diff)
impress212: #i112506# clipping against bezier curves takes too much time
# User sj <sj@openoffice.org>
Diffstat (limited to 'svtools')
-rw-r--r--svtools/source/filter/wmf/winmtf.cxx19
1 files changed, 11 insertions, 8 deletions
diff --git a/svtools/source/filter/wmf/winmtf.cxx b/svtools/source/filter/wmf/winmtf.cxx
index 30fc670ac22f..8ce0425732c4 100644
--- a/svtools/source/filter/wmf/winmtf.cxx
+++ b/svtools/source/filter/wmf/winmtf.cxx
@@ -82,8 +82,11 @@ void WinMtfClipPath::ExcludeClipRect( const Rectangle& rRect )
void WinMtfClipPath::SetClipPath( const PolyPolygon& rPolyPolygon, sal_Int32 nClippingMode )
{
- if ( !rPolyPolygon.Count() )
- aPolyPoly = rPolyPolygon;
+ PolyPolygon aSimplePoly;
+ if ( rPolyPolygon.Count() && rPolyPolygon[ 0 ].HasFlags() )
+ rPolyPolygon.AdaptiveSubdivide( aSimplePoly, 100 );
+ if ( !aSimplePoly.Count() )
+ aPolyPoly = aSimplePoly;
else if ( nDepth < WIN_MTF_MAX_CLIP_DEPTH )
{
nDepth++;
@@ -102,28 +105,28 @@ void WinMtfClipPath::SetClipPath( const PolyPolygon& rPolyPolygon, sal_Int32 nCl
// rPolyPolygon. Thus, we can save us the unnecessary
// clipper call.
if( aPolyPoly.Count() )
- aPolyPoly.GetUnion( rPolyPolygon, aNewClipPath );
+ aPolyPoly.GetUnion( aSimplePoly, aNewClipPath );
break;
case RGN_XOR :
// TODO:
// #115345# Cannot handle this case, for the time being
- aPolyPoly.GetXOR( rPolyPolygon, aNewClipPath );
+ aPolyPoly.GetXOR( aSimplePoly, aNewClipPath );
break;
case RGN_DIFF :
// TODO:
// #115345# Cannot handle this case, for the time being
- aPolyPoly.GetDifference( rPolyPolygon, aNewClipPath );
+ aPolyPoly.GetDifference( aSimplePoly, aNewClipPath );
break;
case RGN_AND :
// #115345# Clip becomes rPolyPolygon, when ANDing
// with an arbitrary rPolyPolygon
if( aPolyPoly.Count() )
- aPolyPoly.GetIntersection( rPolyPolygon, aNewClipPath );
+ aPolyPoly.GetIntersection( aSimplePoly, aNewClipPath );
else
- aNewClipPath = rPolyPolygon;
+ aNewClipPath = aSimplePoly;
break;
case RGN_COPY :
- aNewClipPath = rPolyPolygon;
+ aNewClipPath = aSimplePoly;
break;
}
aPolyPoly = aNewClipPath;