diff options
author | Chris Sherlock <chris.sherlock79@gmail.com> | 2014-04-13 01:42:27 +1000 |
---|---|---|
committer | Chris Sherlock <chris.sherlock79@gmail.com> | 2014-04-13 04:12:21 +1000 |
commit | bb5c7d6a79309236d4f19bb2498f2e850f735a2f (patch) | |
tree | 0df2c6a4f033f66e1385dc5b3ef89d2ad22c09ab | |
parent | eb6bf90a87b50c60efb3df0f0659e7de3e250ba0 (diff) |
fdo#38844 Reduce XOR clipping for gradients
Removed XOR clipping version of ClipAndDrawGradientMetafile. Because it
has been removed, the other version isn't really needed in it's own
function so I've moved it back into DrawGradient.
Change-Id: Ib1519a019061c8c71183db63e5c11681bcad4cc4
-rw-r--r-- | include/vcl/outdev.hxx | 3 | ||||
-rw-r--r-- | include/vcl/print.hxx | 1 | ||||
-rw-r--r-- | vcl/source/gdi/outdev4.cxx | 26 | ||||
-rw-r--r-- | vcl/source/gdi/print.cxx | 10 |
4 files changed, 6 insertions, 34 deletions
diff --git a/include/vcl/outdev.hxx b/include/vcl/outdev.hxx index 596f6b3273a4..8dab29999693 100644 --- a/include/vcl/outdev.hxx +++ b/include/vcl/outdev.hxx @@ -841,9 +841,6 @@ protected: virtual void EmulateDrawTransparent( const PolyPolygon& rPolyPoly, sal_uInt16 nTransparencePercent ); void DrawInvisiblePolygon( const PolyPolygon& rPolyPoly ); - void ClipAndDrawGradient( Gradient &rGradient, const PolyPolygon &rPolyPoly ); - virtual void ClipAndDrawGradientMetafile ( const Gradient &rGradient, const PolyPolygon &rPolyPoly ); - private: typedef void ( OutputDevice::* FontUpdateHandler_t )( bool ); diff --git a/include/vcl/print.hxx b/include/vcl/print.hxx index b08e27b859f8..865767d92fef 100644 --- a/include/vcl/print.hxx +++ b/include/vcl/print.hxx @@ -274,7 +274,6 @@ public: protected: long ImplGetGradientStepCount( long nMinRect ) SAL_OVERRIDE; - virtual void ClipAndDrawGradientMetafile ( const Gradient &rGradient, const PolyPolygon &rPolyPoly ) SAL_OVERRIDE; virtual bool UsePolyPolygonForComplexGradient() SAL_OVERRIDE; void ScaleBitmap ( Bitmap&, SalTwoRect& ) SAL_OVERRIDE { }; diff --git a/vcl/source/gdi/outdev4.cxx b/vcl/source/gdi/outdev4.cxx index 6b76788b8227..0b1a0bd165c1 100644 --- a/vcl/source/gdi/outdev4.cxx +++ b/vcl/source/gdi/outdev4.cxx @@ -613,24 +613,6 @@ void OutputDevice::DrawGradient( const Rectangle& rRect, DrawGradient ( aPolyPoly, rGradient ); } -void OutputDevice::ClipAndDrawGradientMetafile ( const Gradient &rGradient, const PolyPolygon &rPolyPoly ) -{ - const Rectangle aBoundRect( rPolyPoly.GetBoundRect() ); - const bool bOldOutput = IsOutputEnabled(); - - EnableOutput( false ); - Push( PUSH_RASTEROP ); - SetRasterOp( ROP_XOR ); - DrawGradient( aBoundRect, rGradient ); - SetFillColor( COL_BLACK ); - SetRasterOp( ROP_0 ); - DrawPolyPolygon( rPolyPoly ); - SetRasterOp( ROP_XOR ); - DrawGradient( aBoundRect, rGradient ); - Pop(); - EnableOutput( bOldOutput ); -} - void OutputDevice::DrawGradient( const PolyPolygon& rPolyPoly, const Gradient& rGradient ) { @@ -666,9 +648,10 @@ void OutputDevice::DrawGradient( const PolyPolygon& rPolyPoly, if( mpMetaFile ) { + const Rectangle aBoundRect( rPolyPoly.GetBoundRect() ); + if ( rPolyPoly.IsRect() ) { - const Rectangle aBoundRect( rPolyPoly.GetBoundRect() ); mpMetaFile->AddAction( new MetaGradientAction( aBoundRect, aGradient ) ); } else @@ -676,7 +659,10 @@ void OutputDevice::DrawGradient( const PolyPolygon& rPolyPoly, mpMetaFile->AddAction( new MetaCommentAction( "XGRAD_SEQ_BEGIN" ) ); mpMetaFile->AddAction( new MetaGradientExAction( rPolyPoly, rGradient ) ); - ClipAndDrawGradientMetafile ( rGradient, rPolyPoly ); + Push( PUSH_CLIPREGION ); + IntersectClipRegion(Region(rPolyPoly)); + DrawGradient( aBoundRect, rGradient ); + Pop(); mpMetaFile->AddAction( new MetaCommentAction( "XGRAD_SEQ_END" ) ); } diff --git a/vcl/source/gdi/print.cxx b/vcl/source/gdi/print.cxx index 95fb0f113226..7adfcdef8bce 100644 --- a/vcl/source/gdi/print.cxx +++ b/vcl/source/gdi/print.cxx @@ -1812,14 +1812,4 @@ bool Printer::UsePolyPolygonForComplexGradient() return true; } -void Printer::ClipAndDrawGradientMetafile ( const Gradient &rGradient, const PolyPolygon &rPolyPoly ) -{ - const Rectangle aBoundRect( rPolyPoly.GetBoundRect() ); - - Push( PUSH_CLIPREGION ); - IntersectClipRegion(Region(rPolyPoly)); - DrawGradient( aBoundRect, rGradient ); - Pop(); -} - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |