diff options
author | Chris Sherlock <chris.sherlock79@gmail.com> | 2014-04-17 01:45:58 +1000 |
---|---|---|
committer | Chris Sherlock <chris.sherlock79@gmail.com> | 2014-04-17 02:41:13 +1000 |
commit | 2024224a4ee351841f50a6f7b8a267f605a17096 (patch) | |
tree | f6f3ff8343609ccb1707b141c3deefff413018ac /vcl/source | |
parent | e1f9e73893e3d5760dab45b9322eca9fb8ce7ac4 (diff) |
Move bezier functions
Move ImplSubdivideBezier(Polygon) to Polygon as a static function.
Move ImplSubdivideBezier(PolyPolygon) to PolyPolygon as a static function.
Change-Id: I0d006a8a2d3a8d9ba1aec913ceecb38507e4dd2f
Diffstat (limited to 'vcl/source')
-rw-r--r-- | vcl/source/outdev/bezier.cxx | 20 | ||||
-rw-r--r-- | vcl/source/outdev/polygon.cxx | 6 | ||||
-rw-r--r-- | vcl/source/outdev/polyline.cxx | 4 |
3 files changed, 5 insertions, 25 deletions
diff --git a/vcl/source/outdev/bezier.cxx b/vcl/source/outdev/bezier.cxx index f60eb57d6139..5046f65e3876 100644 --- a/vcl/source/outdev/bezier.cxx +++ b/vcl/source/outdev/bezier.cxx @@ -19,23 +19,3 @@ #include <vcl/outdev.hxx> #include <tools/poly.hxx> - -Polygon ImplSubdivideBezier( const Polygon& rPoly ) -{ - Polygon aPoly; - - // #100127# Use adaptive subdivide instead of fixed 25 segments - rPoly.AdaptiveSubdivide( aPoly ); - - return aPoly; -} - -PolyPolygon ImplSubdivideBezier( const PolyPolygon& rPolyPoly ) -{ - sal_uInt16 i, nPolys = rPolyPoly.Count(); - PolyPolygon aPolyPoly( nPolys ); - for( i=0; i<nPolys; ++i ) - aPolyPoly.Insert( ImplSubdivideBezier( rPolyPoly.GetObject(i) ) ); - - return aPolyPoly; -} diff --git a/vcl/source/outdev/polygon.cxx b/vcl/source/outdev/polygon.cxx index 312625dfd850..74026755b166 100644 --- a/vcl/source/outdev/polygon.cxx +++ b/vcl/source/outdev/polygon.cxx @@ -219,7 +219,7 @@ void OutputDevice::DrawPolygon( const Polygon& rPoly ) const sal_uInt8* pFlgAry = aPoly.GetConstFlagAry(); if( !mpGraphics->DrawPolygonBezier( nPoints, pPtAry, pFlgAry, this ) ) { - aPoly = ImplSubdivideBezier(aPoly); + aPoly = Polygon::SubdivideBezier(aPoly); pPtAry = (const SalPoint*)aPoly.GetConstPointAry(); mpGraphics->DrawPolygon( aPoly.GetSize(), pPtAry, this ); } @@ -373,7 +373,7 @@ void OutputDevice::ImplDrawPolyPolygon( sal_uInt16 nPoly, const PolyPolygon& rPo { if( !mpGraphics->DrawPolygonBezier( *pPointAry, *pPointAryAry, *pFlagAryAry, this ) ) { - Polygon aPoly = ImplSubdivideBezier( rPolyPoly.GetObject( last ) ); + Polygon aPoly = Polygon::SubdivideBezier( rPolyPoly.GetObject( last ) ); mpGraphics->DrawPolygon( aPoly.GetSize(), (const SalPoint*)aPoly.GetConstPointAry(), this ); } } @@ -389,7 +389,7 @@ void OutputDevice::ImplDrawPolyPolygon( sal_uInt16 nPoly, const PolyPolygon& rPo { if( !mpGraphics->DrawPolyPolygonBezier( j, pPointAry, pPointAryAry, pFlagAryAry, this ) ) { - PolyPolygon aPolyPoly = ImplSubdivideBezier( rPolyPoly ); + PolyPolygon aPolyPoly = PolyPolygon::SubdivideBezier( rPolyPoly ); ImplDrawPolyPolygon( aPolyPoly.Count(), aPolyPoly ); } } diff --git a/vcl/source/outdev/polyline.cxx b/vcl/source/outdev/polyline.cxx index 26693376a25b..b9da23e110d1 100644 --- a/vcl/source/outdev/polyline.cxx +++ b/vcl/source/outdev/polyline.cxx @@ -87,7 +87,7 @@ void OutputDevice::DrawPolyLine( const Polygon& rPoly ) const sal_uInt8* pFlgAry = aPoly.GetConstFlagAry(); if( !mpGraphics->DrawPolyLineBezier( nPoints, pPtAry, pFlgAry, this ) ) { - aPoly = ImplSubdivideBezier(aPoly); + aPoly = Polygon::SubdivideBezier(aPoly); pPtAry = (const SalPoint*)aPoly.GetConstPointAry(); mpGraphics->DrawPolyLine( aPoly.GetSize(), pPtAry, this ); } @@ -277,7 +277,7 @@ void OutputDevice::ImplDrawPolyLineWithLineInfo(const Polygon& rPoly, const Line // NO way to find out there that it's a curve. if( aPoly.HasFlags() ) { - aPoly = ImplSubdivideBezier( aPoly ); + aPoly = Polygon::SubdivideBezier( aPoly ); nPoints = aPoly.GetSize(); } |