diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-03-14 11:11:02 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-03-26 08:44:50 +0200 |
commit | bea081b5099786e5fcadddd72c247b9a9488286a (patch) | |
tree | dd165f81e850cb9bcfa23b713bd60e3fb26d21ee /vcl/source/outdev | |
parent | fix typo in dialog about rotation to standard orientation (diff) | |
download | core-bea081b5099786e5fcadddd72c247b9a9488286a.tar.gz core-bea081b5099786e5fcadddd72c247b9a9488286a.zip |
replace SalColor with Color
Change-Id: I615640a378a61cf6e44e84a647ce06bdd8a52807
Reviewed-on: https://gerrit.libreoffice.org/51239
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'vcl/source/outdev')
-rw-r--r-- | vcl/source/outdev/gradient.cxx | 14 | ||||
-rw-r--r-- | vcl/source/outdev/mask.cxx | 4 | ||||
-rw-r--r-- | vcl/source/outdev/outdevstate.cxx | 4 | ||||
-rw-r--r-- | vcl/source/outdev/pixel.cxx | 10 | ||||
-rw-r--r-- | vcl/source/outdev/text.cxx | 4 | ||||
-rw-r--r-- | vcl/source/outdev/textline.cxx | 10 |
6 files changed, 21 insertions, 25 deletions
diff --git a/vcl/source/outdev/gradient.cxx b/vcl/source/outdev/gradient.cxx index ca02fba67e96..71c6eb8b9b19 100644 --- a/vcl/source/outdev/gradient.cxx +++ b/vcl/source/outdev/gradient.cxx @@ -332,7 +332,7 @@ void OutputDevice::DrawLinearGradient( const tools::Rectangle& rRect, nGreen = static_cast<sal_uInt8>(nStartGreen); nBlue = static_cast<sal_uInt8>(nStartBlue); - mpGraphics->SetFillColor( MAKE_SALCOLOR( nRed, nGreen, nBlue ) ); + mpGraphics->SetFillColor( Color( nRed, nGreen, nBlue ) ); aBorderRect.SetBottom( static_cast<long>( aBorderRect.Top() + fBorder ) ); aRect.SetTop( aBorderRect.Bottom() ); @@ -394,7 +394,7 @@ void OutputDevice::DrawLinearGradient( const tools::Rectangle& rRect, fTempColor = static_cast<double>(nStartBlue) * (1.0-fAlpha) + static_cast<double>(nEndBlue) * fAlpha; nBlue = GetGradientColorValue(static_cast<long>(fTempColor)); - mpGraphics->SetFillColor( MAKE_SALCOLOR( nRed, nGreen, nBlue ) ); + mpGraphics->SetFillColor( Color( nRed, nGreen, nBlue ) ); // Polygon for this color step aRect.SetTop( static_cast<long>( fGradientLine + static_cast<double>(i) * fScanInc ) ); @@ -428,7 +428,7 @@ void OutputDevice::DrawLinearGradient( const tools::Rectangle& rRect, nGreen = GetGradientColorValue(nEndGreen); nBlue = GetGradientColorValue(nEndBlue); - mpGraphics->SetFillColor( MAKE_SALCOLOR( nRed, nGreen, nBlue ) ); + mpGraphics->SetFillColor( Color( nRed, nGreen, nBlue ) ); aRect.SetTop( static_cast<long>( fGradientLine + static_cast<double>(nSteps) * fScanInc ) ); aRect.SetBottom( static_cast<long>( fMirrorGradientLine - static_cast<double>(nSteps) * fScanInc ) ); @@ -517,7 +517,7 @@ void OutputDevice::DrawComplexGradient( const tools::Rectangle& rRect, sal_uInt8 nRed = static_cast<sal_uInt8>(nStartRed), nGreen = static_cast<sal_uInt8>(nStartGreen), nBlue = static_cast<sal_uInt8>(nStartBlue); bool bPaintLastPolygon( false ); // #107349# Paint last polygon only if loop has generated any output - mpGraphics->SetFillColor( MAKE_SALCOLOR( nRed, nGreen, nBlue ) ); + mpGraphics->SetFillColor( Color( nRed, nGreen, nBlue ) ); if( xPolyPoly ) { @@ -579,12 +579,12 @@ void OutputDevice::DrawComplexGradient( const tools::Rectangle& rRect, // full aPoly. Thus, here, we're painting the band before // the one painted in the window outdev path below. To get // matching colors, have to delay color setting here. - mpGraphics->SetFillColor( MAKE_SALCOLOR( nRed, nGreen, nBlue ) ); + mpGraphics->SetFillColor( Color( nRed, nGreen, nBlue ) ); } else { // #107349# Set fill color _before_ geometry painting - mpGraphics->SetFillColor( MAKE_SALCOLOR( nRed, nGreen, nBlue ) ); + mpGraphics->SetFillColor( Color( nRed, nGreen, nBlue ) ); ImplDrawPolygon( aPoly, pClixPolyPoly ); } @@ -607,7 +607,7 @@ void OutputDevice::DrawComplexGradient( const tools::Rectangle& rRect, nBlue = GetGradientColorValue( nEndBlue ); } - mpGraphics->SetFillColor( MAKE_SALCOLOR( nRed, nGreen, nBlue ) ); + mpGraphics->SetFillColor( Color( nRed, nGreen, nBlue ) ); ImplDrawPolygon( rPoly, pClixPolyPoly ); } } diff --git a/vcl/source/outdev/mask.cxx b/vcl/source/outdev/mask.cxx index 6c52a544d394..6a5e619ede8e 100644 --- a/vcl/source/outdev/mask.cxx +++ b/vcl/source/outdev/mask.cxx @@ -128,11 +128,11 @@ void OutputDevice::DrawDeviceMask( const Bitmap& rMask, const Color& rMaskColor, Bitmap aTmp( rMask ); aTmp.Mirror( nMirrFlags ); mpGraphics->DrawMask( aPosAry, *aTmp.ImplGetImpBitmap()->ImplGetSalBitmap(), - ImplColorToSal( rMaskColor ) , this); + rMaskColor, this); } else mpGraphics->DrawMask( aPosAry, *xImpBmp->ImplGetSalBitmap(), - ImplColorToSal( rMaskColor ), this ); + rMaskColor, this ); } } diff --git a/vcl/source/outdev/outdevstate.cxx b/vcl/source/outdev/outdevstate.cxx index fa4ee99a82a4..38698b210330 100644 --- a/vcl/source/outdev/outdevstate.cxx +++ b/vcl/source/outdev/outdevstate.cxx @@ -586,7 +586,7 @@ void OutputDevice::InitLineColor() else if( RasterOp::Invert == meRasterOp ) mpGraphics->SetROPLineColor( SalROPColor::Invert ); else - mpGraphics->SetLineColor( ImplColorToSal( maLineColor ) ); + mpGraphics->SetLineColor( maLineColor ); } else mpGraphics->SetLineColor(); @@ -608,7 +608,7 @@ void OutputDevice::InitFillColor() else if( RasterOp::Invert == meRasterOp ) mpGraphics->SetROPFillColor( SalROPColor::Invert ); else - mpGraphics->SetFillColor( ImplColorToSal( maFillColor ) ); + mpGraphics->SetFillColor( maFillColor ); } else mpGraphics->SetFillColor(); diff --git a/vcl/source/outdev/pixel.cxx b/vcl/source/outdev/pixel.cxx index afa4673cce33..04f35b41e777 100644 --- a/vcl/source/outdev/pixel.cxx +++ b/vcl/source/outdev/pixel.cxx @@ -33,7 +33,6 @@ Color OutputDevice::GetPixel( const Point& rPt ) const { - Color aColor; if ( mpGraphics || AcquireGraphics() ) @@ -45,10 +44,7 @@ Color OutputDevice::GetPixel( const Point& rPt ) const { const long nX = ImplLogicXToDevicePixel( rPt.X() ); const long nY = ImplLogicYToDevicePixel( rPt.Y() ); - const SalColor aSalCol = mpGraphics->GetPixel( nX, nY, this ); - aColor.SetRed( SALCOLOR_RED( aSalCol ) ); - aColor.SetGreen( SALCOLOR_GREEN( aSalCol ) ); - aColor.SetBlue( SALCOLOR_BLUE( aSalCol ) ); + aColor = mpGraphics->GetPixel( nX, nY, this ); } } return aColor; @@ -107,7 +103,7 @@ void OutputDevice::DrawPixel( const Point& rPt, const Color& rColor ) if ( mbOutputClipped ) return; - mpGraphics->DrawPixel( aPt.X(), aPt.Y(), ImplColorToSal( aColor ), this ); + mpGraphics->DrawPixel( aPt.X(), aPt.Y(), aColor, this ); if( mpAlphaVDev ) mpAlphaVDev->DrawPixel( rPt ); @@ -150,7 +146,7 @@ void OutputDevice::DrawPixel( const tools::Polygon& rPts, const Color* pColors ) for ( sal_uInt16 i = 0; i < nSize; i++ ) { const Point aPt( ImplLogicToDevicePixel( rPts[ i ] ) ); - mpGraphics->DrawPixel( aPt.X(), aPt.Y(), ImplColorToSal( pColors[ i ] ), this ); + mpGraphics->DrawPixel( aPt.X(), aPt.Y(), pColors[ i ], this ); } } } diff --git a/vcl/source/outdev/text.cxx b/vcl/source/outdev/text.cxx index 204feccc9da6..a3547b1bb491 100644 --- a/vcl/source/outdev/text.cxx +++ b/vcl/source/outdev/text.cxx @@ -69,7 +69,7 @@ void OutputDevice::ImplInitTextColor() if ( mbInitTextColor ) { - mpGraphics->SetTextColor( ImplColorToSal( GetTextColor() ) ); + mpGraphics->SetTextColor( GetTextColor() ); mbInitTextColor = false; } } @@ -145,7 +145,7 @@ void OutputDevice::ImplDrawTextBackground( const SalLayout& rSalLayout ) mpGraphics->SetLineColor(); mbInitLineColor = true; } - mpGraphics->SetFillColor( ImplColorToSal( GetTextFillColor() ) ); + mpGraphics->SetFillColor( GetTextFillColor() ); mbInitFillColor = true; ImplDrawTextRect( nX, nY, 0, -(mpFontInstance->mxFontMetric->GetAscent() + mnEmphasisAscent), diff --git a/vcl/source/outdev/textline.cxx b/vcl/source/outdev/textline.cxx index a15b788f8b01..bff62fe6e660 100644 --- a/vcl/source/outdev/textline.cxx +++ b/vcl/source/outdev/textline.cxx @@ -100,7 +100,7 @@ void OutputDevice::ImplDrawWaveLine( long nBaseX, long nBaseY, // If the height is 1 pixel, it's enough output a line if ( (nLineWidth == 1) && (nHeight == 1) ) { - mpGraphics->SetLineColor( ImplColorToSal( rColor ) ); + mpGraphics->SetLineColor( rColor ); mbInitLineColor = true; long nEndX = nStartX+nWidth; @@ -132,7 +132,7 @@ void OutputDevice::ImplDrawWaveLine( long nBaseX, long nBaseY, mpGraphics->SetLineColor(); mbInitLineColor = true; } - mpGraphics->SetFillColor( ImplColorToSal( rColor ) ); + mpGraphics->SetFillColor( rColor ); mbInitFillColor = true; bDrawPixAsRect = true; nPixWidth = nLineWidth; @@ -140,7 +140,7 @@ void OutputDevice::ImplDrawWaveLine( long nBaseX, long nBaseY, } else { - mpGraphics->SetLineColor( ImplColorToSal( rColor ) ); + mpGraphics->SetLineColor( rColor ); mbInitLineColor = true; nPixWidth = 1; nPixHeight = 1; @@ -350,7 +350,7 @@ void OutputDevice::ImplDrawStraightTextLine( long nBaseX, long nBaseY, mpGraphics->SetLineColor(); mbInitLineColor = true; } - mpGraphics->SetFillColor( ImplColorToSal( aColor ) ); + mpGraphics->SetFillColor( aColor ); mbInitFillColor = true; long nLeft = nDistX; @@ -557,7 +557,7 @@ void OutputDevice::ImplDrawStrikeoutLine( long nBaseX, long nBaseY, mpGraphics->SetLineColor(); mbInitLineColor = true; } - mpGraphics->SetFillColor( ImplColorToSal( aColor ) ); + mpGraphics->SetFillColor( aColor ); mbInitFillColor = true; const long& nLeft = nDistX; |