diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2016-12-05 12:47:37 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2016-12-07 10:34:17 +0000 |
commit | a08cb3b52ea4a071ce8eb5a1786ea45fd211ab78 (patch) | |
tree | 0667c60e438b660211a3df83c1b411e055b1de61 /vcl/win | |
parent | 62283fed204e05e3f30a8ae703762d7f96c4e88a (diff) |
convert PolyFlags to scoped enum
and remove the XPolyFlags enum, which has the same values and was being
converted to PolyFlags anyhow
Change-Id: Iaead84933c79a7603698a4e50257dd944df89c41
Reviewed-on: https://gerrit.libreoffice.org/31627
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'vcl/win')
-rw-r--r-- | vcl/win/gdi/gdiimpl.cxx | 32 | ||||
-rw-r--r-- | vcl/win/gdi/gdiimpl.hxx | 6 | ||||
-rw-r--r-- | vcl/win/gdi/salfont.cxx | 16 | ||||
-rw-r--r-- | vcl/win/gdi/salgdi.cxx | 6 |
4 files changed, 30 insertions, 30 deletions
diff --git a/vcl/win/gdi/gdiimpl.cxx b/vcl/win/gdi/gdiimpl.cxx index 82c03ff2fe44..9c054665d0c0 100644 --- a/vcl/win/gdi/gdiimpl.cxx +++ b/vcl/win/gdi/gdiimpl.cxx @@ -74,7 +74,7 @@ namespace { // #100127# draw an array of points which might also contain bezier control points -void ImplRenderPath( HDC hdc, sal_uLong nPoints, const SalPoint* pPtAry, const BYTE* pFlgAry ) +void ImplRenderPath( HDC hdc, sal_uLong nPoints, const SalPoint* pPtAry, const PolyFlags* pFlgAry ) { if( nPoints ) { @@ -88,7 +88,7 @@ void ImplRenderPath( HDC hdc, sal_uLong nPoints, const SalPoint* pPtAry, const B for( i=1; i<nPoints; ++i, ++pPtAry, ++pFlgAry ) { - if( *pFlgAry != POLY_CONTROL ) + if( *pFlgAry != PolyFlags::Control ) { LineTo( hdc, pPtAry->mnX, pPtAry->mnY ); } @@ -105,10 +105,10 @@ void ImplRenderPath( HDC hdc, sal_uLong nPoints, const SalPoint* pPtAry, const B // might also contain bezier control points for the PolyDraw() GDI method // Make sure pWinPointAry and pWinFlagAry are big enough void ImplPreparePolyDraw( bool bCloseFigures, - sal_uLong nPoly, + sal_uLong nPoly, const sal_uInt32* pPoints, const SalPoint* const* pPtAry, - const BYTE* const* pFlgAry, + const PolyFlags* const* pFlgAry, POINT* pWinPointAry, BYTE* pWinFlagAry ) { @@ -116,7 +116,7 @@ void ImplPreparePolyDraw( bool bCloseFigures, for( nCurrPoly=0; nCurrPoly<nPoly; ++nCurrPoly ) { const POINT* pCurrPoint = reinterpret_cast<const POINT*>( *pPtAry++ ); - const BYTE* pCurrFlag = *pFlgAry++; + const PolyFlags* pCurrFlag = *pFlgAry++; const sal_uInt32 nCurrPoints = *pPoints++; const bool bHaveFlagArray( pCurrFlag ); sal_uLong nCurrPoint; @@ -134,11 +134,11 @@ void ImplPreparePolyDraw( bool bCloseFigures, if( bHaveFlagArray && ( nCurrPoint + 2 ) < nCurrPoints ) { - BYTE P4( pCurrFlag[ 2 ] ); + PolyFlags P4( pCurrFlag[ 2 ] ); - if( ( POLY_CONTROL == pCurrFlag[ 0 ] ) && - ( POLY_CONTROL == pCurrFlag[ 1 ] ) && - ( POLY_NORMAL == P4 || POLY_SMOOTH == P4 || POLY_SYMMTR == P4 ) ) + if( ( PolyFlags::Control == pCurrFlag[ 0 ] ) && + ( PolyFlags::Control == pCurrFlag[ 1 ] ) && + ( PolyFlags::Normal == P4 || PolyFlags::Smooth == P4 || PolyFlags::Symmetric == P4 ) ) { // control point one *pWinPointAry++ = *pCurrPoint++; @@ -1792,7 +1792,7 @@ void WinSalGraphicsImpl::drawPolyPolygon( sal_uInt32 nPoly, const sal_uInt32* pP delete [] pWinPointAryAry; } -bool WinSalGraphicsImpl::drawPolyLineBezier( sal_uInt32 nPoints, const SalPoint* pPtAry, const BYTE* pFlgAry ) +bool WinSalGraphicsImpl::drawPolyLineBezier( sal_uInt32 nPoints, const SalPoint* pPtAry, const PolyFlags* pFlgAry ) { static_assert( sizeof( POINT ) == sizeof( SalPoint ), "must be the same size" ); @@ -1801,7 +1801,7 @@ bool WinSalGraphicsImpl::drawPolyLineBezier( sal_uInt32 nPoints, const SalPoint* return true; } -bool WinSalGraphicsImpl::drawPolygonBezier( sal_uInt32 nPoints, const SalPoint* pPtAry, const BYTE* pFlgAry ) +bool WinSalGraphicsImpl::drawPolygonBezier( sal_uInt32 nPoints, const SalPoint* pPtAry, const PolyFlags* pFlgAry ) { static_assert( sizeof( POINT ) == sizeof( SalPoint ), "must be the same size" ); @@ -1846,7 +1846,7 @@ bool WinSalGraphicsImpl::drawPolygonBezier( sal_uInt32 nPoints, const SalPoint* } bool WinSalGraphicsImpl::drawPolyPolygonBezier( sal_uInt32 nPoly, const sal_uInt32* pPoints, - const SalPoint* const* pPtAry, const BYTE* const* pFlgAry ) + const SalPoint* const* pPtAry, const PolyFlags* const* pFlgAry ) { static_assert( sizeof( POINT ) == sizeof( SalPoint ), "must be the same size" ); @@ -1855,10 +1855,10 @@ bool WinSalGraphicsImpl::drawPolyPolygonBezier( sal_uInt32 nPoly, const sal_uInt for( nCurrPoly=0, nTotalPoints=0; nCurrPoly<nPoly; ++nCurrPoly ) nTotalPoints += *pCurrPoints++; - POINT aStackAry1[SAL_POLY_STACKBUF]; - BYTE aStackAry2[SAL_POLY_STACKBUF]; - POINT* pWinPointAry; - BYTE* pWinFlagAry; + POINT aStackAry1[SAL_POLY_STACKBUF]; + BYTE aStackAry2[SAL_POLY_STACKBUF]; + POINT* pWinPointAry; + BYTE* pWinFlagAry; if( nTotalPoints > SAL_POLY_STACKBUF ) { pWinPointAry = new POINT[ nTotalPoints ]; diff --git a/vcl/win/gdi/gdiimpl.hxx b/vcl/win/gdi/gdiimpl.hxx index f8f0ae4b1991..e8235c79f746 100644 --- a/vcl/win/gdi/gdiimpl.hxx +++ b/vcl/win/gdi/gdiimpl.hxx @@ -117,18 +117,18 @@ public: virtual bool drawPolyLineBezier( sal_uInt32 nPoints, const SalPoint* pPtAry, - const sal_uInt8* pFlgAry ) override; + const PolyFlags* pFlgAry ) override; virtual bool drawPolygonBezier( sal_uInt32 nPoints, const SalPoint* pPtAry, - const sal_uInt8* pFlgAry ) override; + const PolyFlags* pFlgAry ) override; virtual bool drawPolyPolygonBezier( sal_uInt32 nPoly, const sal_uInt32* pPoints, const SalPoint* const* pPtAry, - const sal_uInt8* const* pFlgAry ) override; + const PolyFlags* const* pFlgAry ) override; // CopyArea --> No RasterOp, but ClipRegion virtual void copyArea( diff --git a/vcl/win/gdi/salfont.cxx b/vcl/win/gdi/salfont.cxx index 301260477888..fef9bbf27723 100644 --- a/vcl/win/gdi/salfont.cxx +++ b/vcl/win/gdi/salfont.cxx @@ -1416,7 +1416,7 @@ bool WinSalGraphics::GetGlyphOutline( sal_GlyphId aGlyphId, // TODO: avoid tools polygon by creating B2DPolygon directly int nPtSize = 512; Point* pPoints = new Point[ nPtSize ]; - BYTE* pFlags = new BYTE[ nPtSize ]; + PolyFlags* pFlags = new PolyFlags[ nPtSize ]; TTPOLYGONHEADER* pHeader = reinterpret_cast<TTPOLYGONHEADER*>(pData); while( reinterpret_cast<BYTE*>(pHeader) < pData+nSize2 ) @@ -1432,7 +1432,7 @@ bool WinSalGraphics::GetGlyphOutline( sal_GlyphId aGlyphId, long nX = IntTimes256FromFixed( pHeader->pfxStart.x ); long nY = IntTimes256FromFixed( pHeader->pfxStart.y ); pPoints[ nPnt ] = Point( nX, nY ); - pFlags[ nPnt++ ] = POLY_NORMAL; + pFlags[ nPnt++ ] = PolyFlags::Normal; bool bHasOfflinePoints = false; TTPOLYCURVE* pCurve = reinterpret_cast<TTPOLYCURVE*>( pHeader + 1 ); @@ -1443,10 +1443,10 @@ bool WinSalGraphics::GetGlyphOutline( sal_GlyphId aGlyphId, if( nPtSize < nNeededSize ) { Point* pOldPoints = pPoints; - BYTE* pOldFlags = pFlags; + PolyFlags* pOldFlags = pFlags; nPtSize = 2 * nNeededSize; pPoints = new Point[ nPtSize ]; - pFlags = new BYTE[ nPtSize ]; + pFlags = new PolyFlags[ nPtSize ]; for( sal_uInt16 i = 0; i < nPnt; ++i ) { pPoints[ i ] = pOldPoints[ i ]; @@ -1465,7 +1465,7 @@ bool WinSalGraphics::GetGlyphOutline( sal_GlyphId aGlyphId, nY = IntTimes256FromFixed( pCurve->apfx[ i ].y ); ++i; pPoints[ nPnt ] = Point( nX, nY ); - pFlags[ nPnt ] = POLY_NORMAL; + pFlags[ nPnt ] = PolyFlags::Normal; ++nPnt; } } @@ -1485,7 +1485,7 @@ bool WinSalGraphics::GetGlyphOutline( sal_GlyphId aGlyphId, nX = pPoints[ nPnt-1 ].X() + 2 * aControlP.X(); nY = pPoints[ nPnt-1 ].Y() + 2 * aControlP.Y(); pPoints[ nPnt+0 ] = Point( (2*nX+3)/6, (2*nY+3)/6 ); - pFlags[ nPnt+0 ] = POLY_CONTROL; + pFlags[ nPnt+0 ] = PolyFlags::Control; // calculate endpoint of segment nX = IntTimes256FromFixed( pCurve->apfx[ i ].x ); @@ -1508,14 +1508,14 @@ bool WinSalGraphics::GetGlyphOutline( sal_GlyphId aGlyphId, } pPoints[ nPnt+2 ] = Point( nX, nY ); - pFlags[ nPnt+2 ] = POLY_NORMAL; + pFlags[ nPnt+2 ] = PolyFlags::Normal; // calculate second cubic control point // P1 = 1/3 * (PEnd + 2 * PQControl) nX = pPoints[ nPnt+2 ].X() + 2 * aControlP.X(); nY = pPoints[ nPnt+2 ].Y() + 2 * aControlP.Y(); pPoints[ nPnt+1 ] = Point( (2*nX+3)/6, (2*nY+3)/6 ); - pFlags[ nPnt+1 ] = POLY_CONTROL; + pFlags[ nPnt+1 ] = PolyFlags::Control; nPnt += 3; } diff --git a/vcl/win/gdi/salgdi.cxx b/vcl/win/gdi/salgdi.cxx index 4c63eeaade00..50cfdb771bd6 100644 --- a/vcl/win/gdi/salgdi.cxx +++ b/vcl/win/gdi/salgdi.cxx @@ -799,18 +799,18 @@ void WinSalGraphics::drawPolyPolygon( sal_uInt32 nPoly, const sal_uInt32* pPoint mpImpl->drawPolyPolygon( nPoly, pPoints, pPtAry ); } -bool WinSalGraphics::drawPolyLineBezier( sal_uInt32 nPoints, const SalPoint* pPtAry, const BYTE* pFlgAry ) +bool WinSalGraphics::drawPolyLineBezier( sal_uInt32 nPoints, const SalPoint* pPtAry, const PolyFlags* pFlgAry ) { return mpImpl->drawPolyLineBezier( nPoints, pPtAry, pFlgAry ); } -bool WinSalGraphics::drawPolygonBezier( sal_uInt32 nPoints, const SalPoint* pPtAry, const BYTE* pFlgAry ) +bool WinSalGraphics::drawPolygonBezier( sal_uInt32 nPoints, const SalPoint* pPtAry, const PolyFlags* pFlgAry ) { return mpImpl->drawPolygonBezier( nPoints, pPtAry, pFlgAry ); } bool WinSalGraphics::drawPolyPolygonBezier( sal_uInt32 nPoly, const sal_uInt32* pPoints, - const SalPoint* const* pPtAry, const BYTE* const* pFlgAry ) + const SalPoint* const* pPtAry, const PolyFlags* const* pFlgAry ) { return mpImpl->drawPolyPolygonBezier( nPoly, pPoints, pPtAry, pFlgAry ); } |