diff options
author | Chris Sherlock <chris.sherlock79@gmail.com> | 2014-04-28 22:05:43 +1000 |
---|---|---|
committer | Chris Sherlock <chris.sherlock79@gmail.com> | 2014-04-28 22:27:11 +1000 |
commit | 9a89946c95234b19ded1cecdd50bc1ddbd8f8fcb (patch) | |
tree | b1135ac06545174035f1e89c4483c4fe1d0861b0 /vcl/source/outdev | |
parent | 2fc8e17a017a0f68b5cc6a55e61e100da9d8e4eb (diff) |
VCL: Move line functions into state areas
Change-Id: I4a92c66892fbb9687b9e7c521c770150b75229b0
Diffstat (limited to 'vcl/source/outdev')
-rw-r--r-- | vcl/source/outdev/line.cxx | 69 | ||||
-rw-r--r-- | vcl/source/outdev/outdevstate.cxx | 71 |
2 files changed, 71 insertions, 69 deletions
diff --git a/vcl/source/outdev/line.cxx b/vcl/source/outdev/line.cxx index ea987fa56918..752bad4c3f68 100644 --- a/vcl/source/outdev/line.cxx +++ b/vcl/source/outdev/line.cxx @@ -145,75 +145,6 @@ void OutputDevice::DrawLine( const Point& rStartPt, const Point& rEndPt ) mpAlphaVDev->DrawLine( rStartPt, rEndPt ); } -void OutputDevice::SetLineColor() -{ - - if ( mpMetaFile ) - mpMetaFile->AddAction( new MetaLineColorAction( Color(), false ) ); - - if ( mbLineColor ) - { - mbInitLineColor = true; - mbLineColor = false; - maLineColor = Color( COL_TRANSPARENT ); - } - - if( mpAlphaVDev ) - mpAlphaVDev->SetLineColor(); -} - -void OutputDevice::SetLineColor( const Color& rColor ) -{ - - Color aColor = ImplDrawModeToColor( rColor ); - - if( mpMetaFile ) - mpMetaFile->AddAction( new MetaLineColorAction( aColor, true ) ); - - if( ImplIsColorTransparent( aColor ) ) - { - if ( mbLineColor ) - { - mbInitLineColor = true; - mbLineColor = false; - maLineColor = Color( COL_TRANSPARENT ); - } - } - else - { - if( maLineColor != aColor ) - { - mbInitLineColor = true; - mbLineColor = true; - maLineColor = aColor; - } - } - - if( mpAlphaVDev ) - mpAlphaVDev->SetLineColor( COL_BLACK ); -} - -void OutputDevice::InitLineColor() -{ - DBG_TESTSOLARMUTEX(); - - if( mbLineColor ) - { - if( ROP_0 == meRasterOp ) - mpGraphics->SetROPLineColor( SAL_ROP_0 ); - else if( ROP_1 == meRasterOp ) - mpGraphics->SetROPLineColor( SAL_ROP_1 ); - else if( ROP_INVERT == meRasterOp ) - mpGraphics->SetROPLineColor( SAL_ROP_INVERT ); - else - mpGraphics->SetLineColor( ImplColorToSal( maLineColor ) ); - } - else - mpGraphics->SetLineColor(); - - mbInitLineColor = false; -} - void OutputDevice::PaintLineGeometryWithEvtlExpand( const LineInfo& rInfo, basegfx::B2DPolyPolygon aLinePolyPolygon) diff --git a/vcl/source/outdev/outdevstate.cxx b/vcl/source/outdev/outdevstate.cxx index 228620a48ad9..15c5dd682e4b 100644 --- a/vcl/source/outdev/outdevstate.cxx +++ b/vcl/source/outdev/outdevstate.cxx @@ -415,6 +415,54 @@ void OutputDevice::SetFillColor( const Color& rColor ) mpAlphaVDev->SetFillColor( COL_BLACK ); } +void OutputDevice::SetLineColor() +{ + + if ( mpMetaFile ) + mpMetaFile->AddAction( new MetaLineColorAction( Color(), false ) ); + + if ( mbLineColor ) + { + mbInitLineColor = true; + mbLineColor = false; + maLineColor = Color( COL_TRANSPARENT ); + } + + if( mpAlphaVDev ) + mpAlphaVDev->SetLineColor(); +} + +void OutputDevice::SetLineColor( const Color& rColor ) +{ + + Color aColor = ImplDrawModeToColor( rColor ); + + if( mpMetaFile ) + mpMetaFile->AddAction( new MetaLineColorAction( aColor, true ) ); + + if( ImplIsColorTransparent( aColor ) ) + { + if ( mbLineColor ) + { + mbInitLineColor = true; + mbLineColor = false; + maLineColor = Color( COL_TRANSPARENT ); + } + } + else + { + if( maLineColor != aColor ) + { + mbInitLineColor = true; + mbLineColor = true; + maLineColor = aColor; + } + } + + if( mpAlphaVDev ) + mpAlphaVDev->SetLineColor( COL_BLACK ); +} + void OutputDevice::SetBackground() { @@ -546,6 +594,29 @@ void OutputDevice::SetFont( const Font& rNewFont ) } } + +void OutputDevice::InitLineColor() +{ + DBG_TESTSOLARMUTEX(); + + if( mbLineColor ) + { + if( ROP_0 == meRasterOp ) + mpGraphics->SetROPLineColor( SAL_ROP_0 ); + else if( ROP_1 == meRasterOp ) + mpGraphics->SetROPLineColor( SAL_ROP_1 ); + else if( ROP_INVERT == meRasterOp ) + mpGraphics->SetROPLineColor( SAL_ROP_INVERT ); + else + mpGraphics->SetLineColor( ImplColorToSal( maLineColor ) ); + } + else + mpGraphics->SetLineColor(); + + mbInitLineColor = false; +} + + void OutputDevice::InitFillColor() { DBG_TESTSOLARMUTEX(); |