Kaydet (Commit) 04e08fa4 authored tarafından Chris Sherlock's avatar Chris Sherlock

fdo#74702 Refactor code to use ClipToPaintRegion()

There is a fair amount of code that should use ClipToPaintRegion().
Not only does this remove meOutDevType and decouples classes, but
we are using code, so code reuse FTW.

Change-Id: I05a2623b73f4a523230dc01d02db33a6df9911ab
Reviewed-on: https://gerrit.libreoffice.org/8810Reviewed-by: 's avatarChris Sherlock <chris.sherlock79@gmail.com>
Tested-by: 's avatarChris Sherlock <chris.sherlock79@gmail.com>
üst 9a0e6204
...@@ -852,13 +852,7 @@ void OutputDevice::DrawGradient( const PolyPolygon& rPolyPoly, ...@@ -852,13 +852,7 @@ void OutputDevice::DrawGradient( const PolyPolygon& rPolyPoly,
aDstRect.Intersection( aBoundRect ); aDstRect.Intersection( aBoundRect );
if( OUTDEV_WINDOW == meOutDevType ) ClipToPaintRegion( aDstRect );
{
const Region aPaintRgn( ( (Window*) this )->GetPaintRegion() );
if( !aPaintRgn.IsNull() )
aDstRect.Intersection( LogicToPixel( aPaintRgn ).GetBoundRect() );
}
if( !aDstRect.IsEmpty() ) if( !aDstRect.IsEmpty() )
{ {
......
...@@ -346,13 +346,7 @@ void OutputDevice::EmulateDrawTransparent ( const PolyPolygon& rPolyPoly, ...@@ -346,13 +346,7 @@ void OutputDevice::EmulateDrawTransparent ( const PolyPolygon& rPolyPoly,
aDstRect.Intersection( aPolyRect ); aDstRect.Intersection( aPolyRect );
if( OUTDEV_WINDOW == meOutDevType ) ClipToPaintRegion( aDstRect );
{
const Region aPaintRgn( ( (Window*) this )->GetPaintRegion() );
if( !aPaintRgn.IsNull() )
aDstRect.Intersection( LogicToPixel( aPaintRgn ).GetBoundRect() );
}
if( !aDstRect.IsEmpty() ) if( !aDstRect.IsEmpty() )
{ {
...@@ -632,13 +626,7 @@ void OutputDevice::DrawTransparent( const GDIMetaFile& rMtf, const Point& rPos, ...@@ -632,13 +626,7 @@ void OutputDevice::DrawTransparent( const GDIMetaFile& rMtf, const Point& rPos,
mpMetaFile = NULL; mpMetaFile = NULL;
aDstRect.Intersection( aOutRect ); aDstRect.Intersection( aOutRect );
if( OUTDEV_WINDOW == meOutDevType ) ClipToPaintRegion( aDstRect );
{
const Region aPaintRgn( ( (Window*) this )->GetPaintRegion() );
if( !aPaintRgn.IsNull() )
aDstRect.Intersection( LogicToPixel( aPaintRgn.GetBoundRect() ) );
}
if( !aDstRect.IsEmpty() ) if( !aDstRect.IsEmpty() )
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment