diff options
author | Dmitriy Shilin <dshil@fastmail.com> | 2018-12-14 08:13:53 +0300 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2018-12-17 19:32:04 +0100 |
commit | 5bc0cbc77f0a8be6b241e644bdac56989a0974a4 (patch) | |
tree | 0b8fea6aac2a256968445d353ef6d11263cff11b /vcl/win | |
parent | 06e022e7e3329d8e469b8cbf860cd4916db908e5 (diff) |
vcl/win/gdi: merge ImplRenderPath into drawPolyLineBezier
Change-Id: I6e0a5d81bc155c8ad3603c4451a557f8412245bd
Reviewed-on: https://gerrit.libreoffice.org/65139
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'vcl/win')
-rw-r--r-- | vcl/win/gdi/gdiimpl.cxx | 58 |
1 files changed, 30 insertions, 28 deletions
diff --git a/vcl/win/gdi/gdiimpl.cxx b/vcl/win/gdi/gdiimpl.cxx index 1f161619589a..eecd9f350164 100644 --- a/vcl/win/gdi/gdiimpl.cxx +++ b/vcl/win/gdi/gdiimpl.cxx @@ -65,33 +65,6 @@ 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 PolyFlags* pFlgAry ) -{ - if( nPoints ) - { - // TODO: profile whether the following options are faster: - // a) look ahead and draw consecutive bezier or line segments by PolyBezierTo/PolyLineTo resp. - // b) convert our flag array to window's and use PolyDraw - - MoveToEx( hdc, pPtAry->mnX, pPtAry->mnY, nullptr ); - ++pPtAry; ++pFlgAry; - - for( sal_uLong i=1; i<nPoints; ++i, ++pPtAry, ++pFlgAry ) - { - if( *pFlgAry != PolyFlags::Control ) - { - LineTo( hdc, pPtAry->mnX, pPtAry->mnY ); - } - else if( nPoints - i > 2 ) - { - PolyBezierTo( hdc, reinterpret_cast<const POINT*>(pPtAry), 3 ); - i += 2; pPtAry += 2; pFlgAry += 2; - } - } - } -} - // #100127# Fill point and flag memory from array of points which // might also contain bezier control points for the PolyDraw() GDI method // Make sure pWinPointAry and pWinFlagAry are big enough @@ -1763,7 +1736,36 @@ bool WinSalGraphicsImpl::drawPolyLineBezier( sal_uInt32 nPoints, const SalPoint* { static_assert( sizeof( POINT ) == sizeof( SalPoint ), "must be the same size" ); - ImplRenderPath( mrParent.getHDC(), nPoints, pPtAry, pFlgAry ); + // #100127# draw an array of points which might also contain bezier control points + if (!nPoints) + return true; + + const HDC hdc = mrParent.getHDC(); + + // TODO: profile whether the following options are faster: + // a) look ahead and draw consecutive bezier or line segments by PolyBezierTo/PolyLineTo resp. + // b) convert our flag array to window's and use PolyDraw + MoveToEx(hdc, pPtAry->mnX, pPtAry->mnY, nullptr); + ++pPtAry; + ++pFlgAry; + + for(sal_uInt32 i = 1; i < nPoints; ++i) + { + if(*pFlgAry != PolyFlags::Control) + { + LineTo(hdc, pPtAry->mnX, pPtAry->mnY); + } + else if(nPoints - i > 2) + { + PolyBezierTo(hdc, reinterpret_cast<const POINT*>(pPtAry), 3); + i += 2; + pPtAry += 2; + pFlgAry += 2; + } + + ++pPtAry; + ++pFlgAry; + } return true; } |