diff options
author | Kurt Zenker <kz@openoffice.org> | 2008-06-24 10:53:19 +0000 |
---|---|---|
committer | Kurt Zenker <kz@openoffice.org> | 2008-06-24 10:53:19 +0000 |
commit | 94118ea64c99de65f4239ec862663d7df914096b (patch) | |
tree | 9737febe4396b47bff4fa6a905c47e609f27f153 /basebmp | |
parent | 6b423e1716037b4a1aba522b9c9c8e847a4bae67 (diff) |
INTEGRATION: CWS canvas05 (1.3.34); FILE MERGED
2008/04/21 07:51:10 thb 1.3.34.2: RESYNC: (1.3-1.4); FILE MERGED
2007/10/01 12:21:24 thb 1.3.34.1: #i80285# Merged nonzero winding rule feature from picom
Diffstat (limited to 'basebmp')
-rw-r--r-- | basebmp/inc/basebmp/polypolygonrenderer.hxx | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/basebmp/inc/basebmp/polypolygonrenderer.hxx b/basebmp/inc/basebmp/polypolygonrenderer.hxx index 0ca859177cf9..0a1bf3bb8448 100644 --- a/basebmp/inc/basebmp/polypolygonrenderer.hxx +++ b/basebmp/inc/basebmp/polypolygonrenderer.hxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: polypolygonrenderer.hxx,v $ - * $Revision: 1.4 $ + * $Revision: 1.5 $ * * This file is part of OpenOffice.org. * @@ -36,6 +36,7 @@ #include <basegfx/range/b2irange.hxx> #include <basegfx/polygon/b2dpolypolygon.hxx> #include <basegfx/polygon/b2dpolypolygontools.hxx> +#include <basegfx/polygon/b2dpolypolygonfillrule.hxx> #include <basegfx/numeric/ftools.hxx> #include <vigra/diff2d.hxx> @@ -149,7 +150,8 @@ namespace basebmp DestAccessor ad, T fillColor, const basegfx::B2IRange& rClipRect, - basegfx::B2DPolyPolygon const& rPoly ) + basegfx::B2DPolyPolygon const& rPoly, + basegfx::FillRule eFillRule ) { const sal_Int32 nClipX1( std::max((sal_Int32)0,rClipRect.getMinX()) ); const sal_Int32 nClipX2( rClipRect.getMaxX() ); @@ -236,6 +238,7 @@ namespace basebmp detail::VectorOfVertexPtr::iterator currVertex( pAET->begin() ); detail::VectorOfVertexPtr::iterator const lastVertex( pAET->end()-1 ); sal_uInt32 nCrossedEdges(0); + sal_Int32 nWindingNumber(0); while( currVertex != lastVertex ) { // TODO(P1): might be worth a try to extend the @@ -244,8 +247,17 @@ namespace basebmp detail::Vertex& rV1( **currVertex ); detail::Vertex const& rV2( **++currVertex ); - // even/odd fillrule - if( !(nCrossedEdges & 0x01) && + nWindingNumber += -1 + 2*rV1.mbDownwards; + + // calc fill status for both rules. might save a + // few percent runtime to specialize here... + const bool bEvenOddFill( + eFillRule == basegfx::FillRule_EVEN_ODD && !(nCrossedEdges & 0x01) ); + const bool bNonZeroWindingFill( + eFillRule == basegfx::FillRule_NONZERO_WINDING_NUMBER && nWindingNumber != 0 ); + + // is span visible? + if( (bEvenOddFill || bNonZeroWindingFill) && y >= nClipY1 && rV1.mnX < nClipX2_frac && rV2.mnX > nClipX1_frac ) |