incubator-ooo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From er...@apache.org
Subject svn commit: r1167632 - /incubator/ooo/trunk/main/svtools/source/filter/wmf/winmtf.cxx
Date Sat, 10 Sep 2011 22:47:33 GMT
Author: erack
Date: Sat Sep 10 22:47:32 2011
New Revision: 1167632

URL: http://svn.apache.org/viewvc?rev=1167632&view=rev
Log:
impress212: #i112506# clipping against bezier curves takes too much time

# User sj <sj@openoffice.org>

Modified:
    incubator/ooo/trunk/main/svtools/source/filter/wmf/winmtf.cxx

Modified: incubator/ooo/trunk/main/svtools/source/filter/wmf/winmtf.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/svtools/source/filter/wmf/winmtf.cxx?rev=1167632&r1=1167631&r2=1167632&view=diff
==============================================================================
--- incubator/ooo/trunk/main/svtools/source/filter/wmf/winmtf.cxx (original)
+++ incubator/ooo/trunk/main/svtools/source/filter/wmf/winmtf.cxx Sat Sep 10 22:47:32 2011
@@ -82,8 +82,11 @@ void WinMtfClipPath::ExcludeClipRect( co
 
 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 
                 // 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;



Mime
View raw message