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/headless/svpgdi.cxx | |
parent | a488c7ad2763b944713997911c1ddb0315d8c93f (diff) |
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/headless/svpgdi.cxx')
-rw-r--r-- | vcl/headless/svpgdi.cxx | 88 |
1 files changed, 44 insertions, 44 deletions
diff --git a/vcl/headless/svpgdi.cxx b/vcl/headless/svpgdi.cxx index 2d9694cc7a88..487796755ec5 100644 --- a/vcl/headless/svpgdi.cxx +++ b/vcl/headless/svpgdi.cxx @@ -522,9 +522,9 @@ bool SvpSalGraphics::drawAlphaRect(long nX, long nY, long nWidth, long nHeight, if (m_aFillColor != SALCOLOR_NONE) { - cairo_set_source_rgba(cr, SALCOLOR_RED(m_aFillColor)/255.0, - SALCOLOR_GREEN(m_aFillColor)/255.0, - SALCOLOR_BLUE(m_aFillColor)/255.0, + cairo_set_source_rgba(cr, m_aFillColor.GetRed()/255.0, + m_aFillColor.GetGreen()/255.0, + m_aFillColor.GetBlue()/255.0, fTransparency); if (m_aLineColor == SALCOLOR_NONE) @@ -535,9 +535,9 @@ bool SvpSalGraphics::drawAlphaRect(long nX, long nY, long nWidth, long nHeight, if (m_aLineColor != SALCOLOR_NONE) { - cairo_set_source_rgba(cr, SALCOLOR_RED(m_aLineColor)/255.0, - SALCOLOR_GREEN(m_aLineColor)/255.0, - SALCOLOR_BLUE(m_aLineColor)/255.0, + cairo_set_source_rgba(cr, m_aLineColor.GetRed()/255.0, + m_aLineColor.GetGreen()/255.0, + m_aLineColor.GetBlue()/255.0, fTransparency); extents = getClippedStrokeDamage(cr); @@ -553,8 +553,8 @@ bool SvpSalGraphics::drawAlphaRect(long nX, long nY, long nWidth, long nHeight, SvpSalGraphics::SvpSalGraphics() : m_pSurface(nullptr) , m_fScale(1.0) - , m_aLineColor(MAKE_SALCOLOR(0x00, 0x00, 0x00)) - , m_aFillColor(MAKE_SALCOLOR(0xFF, 0xFF, 0XFF)) + , m_aLineColor(Color(0x00, 0x00, 0x00)) + , m_aFillColor(Color(0xFF, 0xFF, 0XFF)) , m_ePaintMode(PaintMode::Over) , m_aTextRenderImpl(*this) { @@ -607,9 +607,9 @@ void SvpSalGraphics::SetLineColor() m_aLineColor = SALCOLOR_NONE; } -void SvpSalGraphics::SetLineColor( SalColor nSalColor ) +void SvpSalGraphics::SetLineColor( Color nColor ) { - m_aLineColor = nSalColor; + m_aLineColor = nColor; } void SvpSalGraphics::SetFillColor() @@ -617,9 +617,9 @@ void SvpSalGraphics::SetFillColor() m_aFillColor = SALCOLOR_NONE; } -void SvpSalGraphics::SetFillColor( SalColor nSalColor ) +void SvpSalGraphics::SetFillColor( Color nColor ) { - m_aFillColor = nSalColor; + m_aFillColor = nColor; } void SvpSalGraphics::SetXORMode(bool bSet ) @@ -632,13 +632,13 @@ void SvpSalGraphics::SetROPLineColor( SalROPColor nROPColor ) switch( nROPColor ) { case SalROPColor::N0: - m_aLineColor = MAKE_SALCOLOR(0, 0, 0); + m_aLineColor = Color(0, 0, 0); break; case SalROPColor::N1: - m_aLineColor = MAKE_SALCOLOR(0xff, 0xff, 0xff); + m_aLineColor = Color(0xff, 0xff, 0xff); break; case SalROPColor::Invert: - m_aLineColor = MAKE_SALCOLOR(0xff, 0xff, 0xff); + m_aLineColor = Color(0xff, 0xff, 0xff); break; } } @@ -648,13 +648,13 @@ void SvpSalGraphics::SetROPFillColor( SalROPColor nROPColor ) switch( nROPColor ) { case SalROPColor::N0: - m_aFillColor = MAKE_SALCOLOR(0, 0, 0); + m_aFillColor = Color(0, 0, 0); break; case SalROPColor::N1: - m_aFillColor = MAKE_SALCOLOR(0xff, 0xff, 0xff); + m_aFillColor = Color(0xff, 0xff, 0xff); break; case SalROPColor::Invert: - m_aFillColor = MAKE_SALCOLOR(0xff, 0xff, 0xff); + m_aFillColor = Color(0xff, 0xff, 0xff); break; } } @@ -667,14 +667,14 @@ void SvpSalGraphics::drawPixel( long nX, long nY ) } } -void SvpSalGraphics::drawPixel( long nX, long nY, SalColor nSalColor ) +void SvpSalGraphics::drawPixel( long nX, long nY, Color nColor ) { - SalColor aOrigFillColor = m_aFillColor; - SalColor aOrigLineColor = m_aLineColor; + Color aOrigFillColor = m_aFillColor; + Color aOrigLineColor = m_aLineColor; basegfx::B2DPolygon aRect = basegfx::utils::createPolygonFromRect(basegfx::B2DRectangle(nX, nY, nX+1, nY+1)); m_aLineColor = SALCOLOR_NONE; - m_aFillColor = nSalColor; + m_aFillColor = nColor; drawPolyPolygon(basegfx::B2DPolyPolygon(aRect)); @@ -685,8 +685,8 @@ void SvpSalGraphics::drawPixel( long nX, long nY, SalColor nSalColor ) void SvpSalGraphics::drawRect( long nX, long nY, long nWidth, long nHeight ) { // because of the -1 hack we have to do fill and draw separately - SalColor aOrigFillColor = m_aFillColor; - SalColor aOrigLineColor = m_aLineColor; + Color aOrigFillColor = m_aFillColor; + Color aOrigLineColor = m_aLineColor; m_aFillColor = SALCOLOR_NONE; m_aLineColor = SALCOLOR_NONE; @@ -939,9 +939,9 @@ bool SvpSalGraphics::drawPolyLine( } } - cairo_set_source_rgba(cr, SALCOLOR_RED(m_aLineColor)/255.0, - SALCOLOR_GREEN(m_aLineColor)/255.0, - SALCOLOR_BLUE(m_aLineColor)/255.0, + cairo_set_source_rgba(cr, m_aLineColor.GetRed()/255.0, + m_aLineColor.GetGreen()/255.0, + m_aLineColor.GetBlue()/255.0, 1.0-fTransparency); cairo_set_line_join(cr, eCairoLineJoin); @@ -1034,9 +1034,9 @@ bool SvpSalGraphics::drawPolyPolygon(const basegfx::B2DPolyPolygon& rPolyPoly, d if (m_aFillColor != SALCOLOR_NONE) { - cairo_set_source_rgba(cr, SALCOLOR_RED(m_aFillColor)/255.0, - SALCOLOR_GREEN(m_aFillColor)/255.0, - SALCOLOR_BLUE(m_aFillColor)/255.0, + cairo_set_source_rgba(cr, m_aFillColor.GetRed()/255.0, + m_aFillColor.GetGreen()/255.0, + m_aFillColor.GetBlue()/255.0, 1.0-fTransparency); if (m_aLineColor == SALCOLOR_NONE) @@ -1047,9 +1047,9 @@ bool SvpSalGraphics::drawPolyPolygon(const basegfx::B2DPolyPolygon& rPolyPoly, d if (m_aLineColor != SALCOLOR_NONE) { - cairo_set_source_rgba(cr, SALCOLOR_RED(m_aLineColor)/255.0, - SALCOLOR_GREEN(m_aLineColor)/255.0, - SALCOLOR_BLUE(m_aLineColor)/255.0, + cairo_set_source_rgba(cr, m_aLineColor.GetRed()/255.0, + m_aLineColor.GetGreen()/255.0, + m_aLineColor.GetBlue()/255.0, 1.0-fTransparency); extents = getClippedStrokeDamage(cr); @@ -1062,18 +1062,18 @@ bool SvpSalGraphics::drawPolyPolygon(const basegfx::B2DPolyPolygon& rPolyPoly, d return true; } -void SvpSalGraphics::applyColor(cairo_t *cr, SalColor aColor) +void SvpSalGraphics::applyColor(cairo_t *cr, Color aColor) { if (cairo_surface_get_content(m_pSurface) == CAIRO_CONTENT_COLOR_ALPHA) { - cairo_set_source_rgba(cr, SALCOLOR_RED(aColor)/255.0, - SALCOLOR_GREEN(aColor)/255.0, - SALCOLOR_BLUE(aColor)/255.0, + cairo_set_source_rgba(cr, aColor.GetRed()/255.0, + aColor.GetGreen()/255.0, + aColor.GetBlue()/255.0, 1.0); } else { - double fSet = aColor == sal_uInt32(COL_BLACK) ? 1.0 : 0.0; + double fSet = aColor == COL_BLACK ? 1.0 : 0.0; cairo_set_source_rgba(cr, 1, 1, 1, fSet); cairo_set_operator(cr, CAIRO_OPERATOR_SOURCE); } @@ -1226,7 +1226,7 @@ static sal_uInt8 premultiply(sal_uInt8 c, sal_uInt8 a) void SvpSalGraphics::drawMask( const SalTwoRect& rTR, const SalBitmap& rSalBitmap, - SalColor nMaskColor ) + Color nMaskColor ) { /** creates an image from the given rectangle, replacing all black pixels * with nMaskColor and make all other full transparent */ @@ -1244,9 +1244,9 @@ void SvpSalGraphics::drawMask( const SalTwoRect& rTR, sal_uInt8 r = unpremultiply(data[SVP_CAIRO_RED], data[SVP_CAIRO_ALPHA]); if (r == 0 && g == 0 && b == 0) { - data[0] = SALCOLOR_BLUE(nMaskColor); - data[1] = SALCOLOR_GREEN(nMaskColor); - data[2] = SALCOLOR_RED(nMaskColor); + data[0] = nMaskColor.GetBlue(); + data[1] = nMaskColor.GetGreen(); + data[2] = nMaskColor.GetRed(); data[3] = 0xff; } else @@ -1318,7 +1318,7 @@ SalBitmap* SvpSalGraphics::getBitmap( long nX, long nY, long nWidth, long nHeigh return pBitmap; } -SalColor SvpSalGraphics::getPixel( long nX, long nY ) +Color SvpSalGraphics::getPixel( long nX, long nY ) { cairo_surface_t *target = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, 1, 1); cairo_t* cr = cairo_create(target); @@ -1333,7 +1333,7 @@ SalColor SvpSalGraphics::getPixel( long nX, long nY ) sal_uInt8 b = unpremultiply(data[SVP_CAIRO_BLUE], data[SVP_CAIRO_ALPHA]); sal_uInt8 g = unpremultiply(data[SVP_CAIRO_GREEN], data[SVP_CAIRO_ALPHA]); sal_uInt8 r = unpremultiply(data[SVP_CAIRO_RED], data[SVP_CAIRO_ALPHA]); - SalColor nRet = MAKE_SALCOLOR(r, g, b); + Color nRet = Color(r, g, b); cairo_surface_destroy(target); |