[Libreoffice-commits] core.git: 2 commits - include/vcl vcl/source
Chris Sherlock
chris.sherlock79 at gmail.com
Mon Apr 28 05:29:06 PDT 2014
include/vcl/outdev.hxx | 15 ++++----
include/vcl/print.hxx | 2 -
vcl/source/gdi/print.cxx | 2 -
vcl/source/outdev/line.cxx | 69 ------------------------------------
vcl/source/outdev/mask.cxx | 4 +-
vcl/source/outdev/outdevstate.cxx | 71 ++++++++++++++++++++++++++++++++++++++
6 files changed, 83 insertions(+), 80 deletions(-)
New commits:
commit 9a89946c95234b19ded1cecdd50bc1ddbd8f8fcb
Author: Chris Sherlock <chris.sherlock79 at gmail.com>
Date: Mon Apr 28 22:05:43 2014 +1000
VCL: Move line functions into state areas
Change-Id: I4a92c66892fbb9687b9e7c521c770150b75229b0
diff --git a/include/vcl/outdev.hxx b/include/vcl/outdev.hxx
index 51b40aa..9cc34e8 100644
--- a/include/vcl/outdev.hxx
+++ b/include/vcl/outdev.hxx
@@ -570,6 +570,11 @@ public:
void SetOutDevViewType( OutDevViewType eOutDevViewType ) { meOutDevViewType=eOutDevViewType; }
OutDevViewType GetOutDevViewType() const { return meOutDevViewType; }
+ void SetLineColor();
+ void SetLineColor( const Color& rColor );
+ const Color& GetLineColor() const { return maLineColor; }
+ bool IsLineColor() const { return mbLineColor; }
+
void SetFillColor();
void SetFillColor( const Color& rColor );
const Color& GetFillColor() const { return maFillColor; }
@@ -586,6 +591,8 @@ public:
private:
+ SAL_DLLPRIVATE void InitLineColor();
+
SAL_DLLPRIVATE void InitFillColor();
///@}
@@ -669,13 +676,7 @@ public:
void DrawLine( const Point& rStartPt, const Point& rEndPt,
const LineInfo& rLineInfo );
- void SetLineColor();
- void SetLineColor( const Color& rColor );
- const Color& GetLineColor() const { return maLineColor; }
- bool IsLineColor() const { return mbLineColor; }
-
private:
- SAL_DLLPRIVATE void InitLineColor();
/** Helper for line geometry paint with support for graphic expansion (pattern and fat_to_area)
*/
diff --git a/vcl/source/outdev/line.cxx b/vcl/source/outdev/line.cxx
index ea987fa..752bad4 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 228620a..15c5dd6 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();
commit 2fc8e17a017a0f68b5cc6a55e61e100da9d8e4eb
Author: Chris Sherlock <chris.sherlock79 at gmail.com>
Date: Mon Apr 28 22:00:10 2014 +1000
VCL: Rename ApplyMask to DrawDeviceMask in OutputDevice
Change-Id: I3392294f8144a9f3124ada972934bb0452c6e13b
diff --git a/include/vcl/outdev.hxx b/include/vcl/outdev.hxx
index a22d407..51b40aa 100644
--- a/include/vcl/outdev.hxx
+++ b/include/vcl/outdev.hxx
@@ -1472,7 +1472,7 @@ public:
protected:
- virtual void ApplyMask ( const Bitmap& rMask, const Color& rMaskColor,
+ virtual void DrawDeviceMask ( const Bitmap& rMask, const Color& rMaskColor,
const Point& rDestPt, const Size& rDestSize,
const Point& rSrcPtPixel, const Size& rSrcSizePixel );
///@}
diff --git a/include/vcl/print.hxx b/include/vcl/print.hxx
index 605c21a..01c3430 100644
--- a/include/vcl/print.hxx
+++ b/include/vcl/print.hxx
@@ -270,7 +270,7 @@ protected:
void SetSelfAsQueuePrinter( bool bQueuePrinter ) { mbIsQueuePrinter = bQueuePrinter; }
bool IsQueuePrinter() const { return mbIsQueuePrinter; }
- virtual void ApplyMask ( const Bitmap& rMask, const Color& rMaskColor,
+ virtual void DrawDeviceMask ( const Bitmap& rMask, const Color& rMaskColor,
const Point& rDestPt, const Size& rDestSize,
const Point& rSrcPtPixel, const Size& rSrcSizePixel ) SAL_OVERRIDE;
diff --git a/vcl/source/gdi/print.cxx b/vcl/source/gdi/print.cxx
index bf2066d..1132d87a 100644
--- a/vcl/source/gdi/print.cxx
+++ b/vcl/source/gdi/print.cxx
@@ -801,7 +801,7 @@ void Printer::ImplInitDisplay( const Window* pWindow )
mnDPIY = mpDisplayDev->mnDPIY;
}
-void Printer::ApplyMask( const Bitmap& rMask, const Color& rMaskColor,
+void Printer::DrawDeviceMask( const Bitmap& rMask, const Color& rMaskColor,
const Point& rDestPt, const Size& rDestSize,
const Point& rSrcPtPixel, const Size& rSrcSizePixel )
{
diff --git a/vcl/source/outdev/mask.cxx b/vcl/source/outdev/mask.cxx
index 8ce7dfc..d1c6b7e 100644
--- a/vcl/source/outdev/mask.cxx
+++ b/vcl/source/outdev/mask.cxx
@@ -91,11 +91,11 @@ void OutputDevice::DrawMask( const Point& rDestPt, const Size& rDestSize,
if ( mbOutputClipped )
return;
- ApplyMask( rBitmap, rMaskColor, rDestPt, rDestSize, rSrcPtPixel, rSrcSizePixel );
+ DrawDeviceMask( rBitmap, rMaskColor, rDestPt, rDestSize, rSrcPtPixel, rSrcSizePixel );
}
-void OutputDevice::ApplyMask( const Bitmap& rMask, const Color& rMaskColor,
+void OutputDevice::DrawDeviceMask( const Bitmap& rMask, const Color& rMaskColor,
const Point& rDestPt, const Size& rDestSize,
const Point& rSrcPtPixel, const Size& rSrcSizePixel )
{
More information about the Libreoffice-commits
mailing list