diff options
Diffstat (limited to 'canvas')
-rw-r--r-- | canvas/source/vcl/canvashelper.cxx | 14 | ||||
-rw-r--r-- | canvas/source/vcl/canvashelper_texturefill.cxx | 18 | ||||
-rw-r--r-- | canvas/source/vcl/impltools.cxx | 14 | ||||
-rw-r--r-- | canvas/source/vcl/impltools.hxx | 4 | ||||
-rw-r--r-- | canvas/source/vcl/spritehelper.cxx | 2 |
5 files changed, 24 insertions, 28 deletions
diff --git a/canvas/source/vcl/canvashelper.cxx b/canvas/source/vcl/canvashelper.cxx index a62057ce4a30..5cc5f3c42b73 100644 --- a/canvas/source/vcl/canvashelper.cxx +++ b/canvas/source/vcl/canvashelper.cxx @@ -266,7 +266,7 @@ namespace vclcanvas const ::basegfx::B2DPolyPolygon& rPolyPoly( ::basegfx::unotools::b2DPolyPolygonFromXPolyPolygon2D(xPolyPolygon) ); - const ::basegfx::B2DPolyPolygon aPolyPoly( tools::mapPolyPolygon( rPolyPoly, viewState, renderState ) ); + const ::tools::PolyPolygon aPolyPoly( tools::mapPolyPolygon( rPolyPoly, viewState, renderState ) ); if( rPolyPoly.isClosed() ) { @@ -284,9 +284,9 @@ namespace vclcanvas // DrawPolygon(), and open ones via DrawPolyLine(): // closed polygons will simply already contain the // closing segment. - sal_uInt32 nSize( aPolyPoly.count() ); + sal_uInt16 nSize( aPolyPoly.Count() ); - for( sal_uInt32 i=0; i<nSize; ++i ) + for( sal_uInt16 i=0; i<nSize; ++i ) { mpOutDevProvider->getOutDev().DrawPolyLine( aPolyPoly[i] ); @@ -476,7 +476,7 @@ namespace vclcanvas ::basegfx::B2DPolyPolygon aB2DPolyPoly( ::basegfx::unotools::b2DPolyPolygonFromXPolyPolygon2D(xPolyPolygon)); aB2DPolyPoly.setClosed(true); // ensure closed poly, otherwise VCL does not fill - const ::basegfx::B2DPolyPolygon aPolyPoly( tools::mapPolyPolygon( + const ::tools::PolyPolygon aPolyPoly( tools::mapPolyPolygon( aB2DPolyPoly, viewState, renderState ) ); const bool bSourceAlpha( renderState.CompositeOperation == rendering::CompositeOperation::SOURCE ); @@ -486,10 +486,8 @@ namespace vclcanvas } else { - const double dTransparency( (nTransparency + 128) / 255.0 ); - basegfx::B2DHomMatrix aIdentityMatrix; - aIdentityMatrix.identity(); - mpOutDevProvider->getOutDev().DrawTransparent( aIdentityMatrix, aPolyPoly, dTransparency ); + const int nTransPercent( (nTransparency * 100 + 128) / 255 ); // normal rounding, no truncation here + mpOutDevProvider->getOutDev().DrawTransparent( aPolyPoly, static_cast<sal_uInt16>(nTransPercent) ); } if( mp2ndOutDevProvider ) diff --git a/canvas/source/vcl/canvashelper_texturefill.cxx b/canvas/source/vcl/canvashelper_texturefill.cxx index b0b0ef3770d5..9cb8dd8abd99 100644 --- a/canvas/source/vcl/canvashelper_texturefill.cxx +++ b/canvas/source/vcl/canvashelper_texturefill.cxx @@ -437,7 +437,7 @@ namespace vclcanvas OutputDevice* p2ndOutDev, const ::canvas::ParametricPolyPolygon::Values& rValues, const std::vector< ::Color >& rColors, - const ::basegfx::B2DPolyPolygon& rPoly, + const ::tools::PolyPolygon& rPoly, const rendering::ViewState& viewState, const rendering::RenderState& renderState, const rendering::Texture& texture, @@ -466,8 +466,8 @@ namespace vclcanvas // determine maximal bound rect of texture-filled // polygon - const ::basegfx::B2DRectangle aPolygonDeviceRectOrig( - rPoly.getB2DRange() ); + const ::tools::Rectangle aPolygonDeviceRectOrig( + rPoly.GetBoundRect() ); if( tools::isRectangle( rPoly ) ) { @@ -482,7 +482,7 @@ namespace vclcanvas // twice for XOR rOutDev.Push( PushFlags::CLIPREGION ); - rOutDev.IntersectClipRegion( ::tools::Rectangle(aPolygonDeviceRectOrig) ); + rOutDev.IntersectClipRegion( aPolygonDeviceRectOrig ); doGradientFill( rOutDev, rValues, rColors, @@ -570,7 +570,7 @@ namespace vclcanvas tools::OutDevStateKeeper aStateKeeper( mpProtectedOutDevProvider ); const int nTransparency( setupOutDevState( viewState, renderState, IGNORE_COLOR ) ); - ::basegfx::B2DPolyPolygon aPolyPoly( tools::mapPolyPolygon( + ::tools::PolyPolygon aPolyPoly( tools::mapPolyPolygon( ::basegfx::unotools::b2DPolyPolygonFromXPolyPolygon2D(xPolyPolygon), viewState, renderState ) ); @@ -636,7 +636,7 @@ namespace vclcanvas // determine maximal bound rect of texture-filled // polygon const ::tools::Rectangle aPolygonDeviceRect( - aPolyPoly.getB2DRange() ); + aPolyPoly.GetBoundRect() ); // first of all, determine whether we have a @@ -945,10 +945,8 @@ namespace vclcanvas // shift output to origin of VDev const ::Point aOutPos( aPt - aPolygonDeviceRect.TopLeft() ); - basegfx::B2DHomMatrix aTranslateMatrix; - aTranslateMatrix.translate( -aPolygonDeviceRect.Left(), - -aPolygonDeviceRect.Top() ); - aPolyPoly.transform( aTranslateMatrix ); + aPolyPoly.Translate( ::Point( -aPolygonDeviceRect.Left(), + -aPolygonDeviceRect.Top() ) ); const vcl::Region aPolyClipRegion( aPolyPoly ); diff --git a/canvas/source/vcl/impltools.cxx b/canvas/source/vcl/impltools.cxx index b8341b401a05..754a34ce0806 100644 --- a/canvas/source/vcl/impltools.cxx +++ b/canvas/source/vcl/impltools.cxx @@ -134,20 +134,20 @@ namespace vclcanvas::tools return true; } - bool isRectangle( const ::basegfx::B2DPolyPolygon& rPolyPoly ) + bool isRectangle( const ::tools::PolyPolygon& rPolyPoly ) { // exclude some cheap cases first - if( rPolyPoly.count() != 1 ) + if( rPolyPoly.Count() != 1 ) return false; - const ::basegfx::B2DPolygon& rPoly( rPolyPoly[0] ); + const ::tools::Polygon& rPoly( rPolyPoly[0] ); - sal_uInt16 nCount( rPoly.count() ); + sal_uInt16 nCount( rPoly.GetSize() ); if( nCount < 4 ) return false; // delegate to basegfx - return ::basegfx::utils::isRectangle( rPoly ); + return ::basegfx::utils::isRectangle( rPoly.getB2DPolygon() ); } @@ -168,7 +168,7 @@ namespace vclcanvas::tools return vcl::unotools::pointFromB2DPoint( aPoint ); } - ::basegfx::B2DPolyPolygon mapPolyPolygon( const ::basegfx::B2DPolyPolygon& rPoly, + ::tools::PolyPolygon mapPolyPolygon( const ::basegfx::B2DPolyPolygon& rPoly, const rendering::ViewState& rViewState, const rendering::RenderState& rRenderState ) { @@ -181,7 +181,7 @@ namespace vclcanvas::tools aTemp.transform( aMatrix ); - return aTemp; + return ::tools::PolyPolygon( aTemp ); } ::BitmapEx transformBitmap( const BitmapEx& rBitmap, diff --git a/canvas/source/vcl/impltools.hxx b/canvas/source/vcl/impltools.hxx index a97211e3e7cb..028ea1174f3c 100644 --- a/canvas/source/vcl/impltools.hxx +++ b/canvas/source/vcl/impltools.hxx @@ -92,7 +92,7 @@ namespace vclcanvas @return true, if the polygon is a rectangle. */ - bool isRectangle( const ::basegfx::B2DPolyPolygon& rPolyPoly ); + bool isRectangle( const ::tools::PolyPolygon& rPolyPoly ); // Little helper to encapsulate locking into policy class @@ -164,7 +164,7 @@ namespace vclcanvas const css::rendering::ViewState& rViewState, const css::rendering::RenderState& rRenderState ); - ::basegfx::B2DPolyPolygon mapPolyPolygon( const ::basegfx::B2DPolyPolygon& rPoly, + ::tools::PolyPolygon mapPolyPolygon( const ::basegfx::B2DPolyPolygon& rPoly, const css::rendering::ViewState& rViewState, const css::rendering::RenderState& rRenderState ); diff --git a/canvas/source/vcl/spritehelper.cxx b/canvas/source/vcl/spritehelper.cxx index d25d06a49168..e52bb211020c 100644 --- a/canvas/source/vcl/spritehelper.cxx +++ b/canvas/source/vcl/spritehelper.cxx @@ -266,7 +266,7 @@ namespace vclcanvas rTargetSurface.SetLineColor( Color( 0,255,0 ) ); rTargetSurface.SetFillColor(); - rTargetSurface.DrawPolyPolygon(aClipPoly); // #i76339# + rTargetSurface.DrawPolyPolygon(::tools::PolyPolygon(aClipPoly)); // #i76339# } vcl::Region aClipRegion( aClipPoly ); |