[Libreoffice-commits] core.git: include/vcl vcl/source
Chris Sherlock
chris.sherlock79 at gmail.com
Sat Apr 12 11:16:29 PDT 2014
include/vcl/outdev.hxx | 3 ---
include/vcl/print.hxx | 1 -
vcl/source/gdi/outdev4.cxx | 26 ++++++--------------------
vcl/source/gdi/print.cxx | 10 ----------
4 files changed, 6 insertions(+), 34 deletions(-)
New commits:
commit bb5c7d6a79309236d4f19bb2498f2e850f735a2f
Author: Chris Sherlock <chris.sherlock79 at gmail.com>
Date: Sun Apr 13 01:42:27 2014 +1000
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
diff --git a/include/vcl/outdev.hxx b/include/vcl/outdev.hxx
index 596f6b3..8dab299 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 b08e27b..865767d 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 6b76788..0b1a0bd 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 95fb0f1..7adfcde 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: */
More information about the Libreoffice-commits
mailing list