Kaydet (Commit) 94d92d00 authored tarafından Noel Grandin's avatar Noel Grandin

convert basegfx::FillRule to scoped enum

and drop unused NONZERO_WINDING_NUMBER value

Change-Id: If2a8f01934796eaf9a343113387b775fd169ccb9
üst d4917e99
...@@ -669,7 +669,7 @@ namespace ...@@ -669,7 +669,7 @@ namespace
col), col),
rBounds, rBounds,
aPoly, aPoly,
basegfx::FillRule_EVEN_ODD ); basegfx::FillRule::EvenOdd );
if( mpDamage ) if( mpDamage )
{ {
......
...@@ -227,7 +227,6 @@ namespace basebmp ...@@ -227,7 +227,6 @@ namespace basebmp
detail::VectorOfVertexPtr::iterator currVertex( pAET->begin() ); detail::VectorOfVertexPtr::iterator currVertex( pAET->begin() );
detail::VectorOfVertexPtr::iterator const lastVertex( pAET->end()-1 ); detail::VectorOfVertexPtr::iterator const lastVertex( pAET->end()-1 );
sal_uInt32 nCrossedEdges(0); sal_uInt32 nCrossedEdges(0);
sal_Int32 nWindingNumber(0);
while( currVertex != lastVertex ) while( currVertex != lastVertex )
{ {
// TODO(P1): might be worth a try to extend the // TODO(P1): might be worth a try to extend the
...@@ -236,17 +235,13 @@ namespace basebmp ...@@ -236,17 +235,13 @@ namespace basebmp
detail::Vertex& rV1( **currVertex ); detail::Vertex& rV1( **currVertex );
detail::Vertex const& rV2( **++currVertex ); detail::Vertex const& rV2( **++currVertex );
nWindingNumber += -1 + 2*int(rV1.mbDownwards);
// calc fill status for both rules. might save a // calc fill status for both rules. might save a
// few percent runtime to specialize here... // few percent runtime to specialize here...
const bool bEvenOddFill( const bool bEvenOddFill(
eFillRule == basegfx::FillRule_EVEN_ODD && !(nCrossedEdges & 0x01) ); eFillRule == basegfx::FillRule::EvenOdd && !(nCrossedEdges & 0x01) );
const bool bNonZeroWindingFill(
eFillRule == basegfx::FillRule_NONZERO_WINDING_NUMBER && nWindingNumber != 0 );
// is span visible? // is span visible?
if( (bEvenOddFill || bNonZeroWindingFill) && if( bEvenOddFill &&
y >= nClipY1 && y >= nClipY1 &&
rV1.mnX < nClipX2_frac && rV1.mnX < nClipX2_frac &&
rV2.mnX > nClipX1_frac ) rV2.mnX > nClipX1_frac )
......
...@@ -31,21 +31,13 @@ namespace basegfx ...@@ -31,21 +31,13 @@ namespace basegfx
The fill rule determines which areas are inside, and which are The fill rule determines which areas are inside, and which are
outside the poly-polygon. outside the poly-polygon.
*/ */
enum FillRule enum class FillRule
{ {
/** Areas, for which a scanline has crossed an odd number of /** Areas, for which a scanline has crossed an odd number of
vertices, are regarded 'inside', the remainder 'outside' vertices, are regarded 'inside', the remainder 'outside'
of the poly-polygon. of the poly-polygon.
*/ */
FillRule_EVEN_ODD, EvenOdd
/** For each edge a scanline crosses, a current winding number
is updated. Downward edges count +1, upward edges count
-1. If the total accumulated winding number for one area
is not zero, this area is regarded 'inside', otherwise,
'outside'.
*/
FillRule_NONZERO_WINDING_NUMBER
}; };
} }
......
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