summaryrefslogtreecommitdiff
path: root/vcl/headless
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2023-01-03 20:12:43 +0000
committerCaolán McNamara <caolanm@redhat.com>2023-01-04 15:41:54 +0000
commite9749cf0e9a4110fe47ba2f3693b2f7dbf2dd7a3 (patch)
tree1ea3b416df05fdfb10808f45d37edefac33e30d9 /vcl/headless
parent5de1d0472b319e9d48972eb067fd8189507fa640 (diff)
make applyColor static
Change-Id: I69cdc922488351d8bd7c0facf9c7209f56f24291 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145027 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'vcl/headless')
-rw-r--r--vcl/headless/CairoCommon.cxx2
-rw-r--r--vcl/headless/SvpGraphicsBackend.cxx14
2 files changed, 8 insertions, 8 deletions
diff --git a/vcl/headless/CairoCommon.cxx b/vcl/headless/CairoCommon.cxx
index 511799dff9ce..3a8010f21b59 100644
--- a/vcl/headless/CairoCommon.cxx
+++ b/vcl/headless/CairoCommon.cxx
@@ -567,7 +567,7 @@ cairo_t* CairoCommon::createTmpCompatibleCairoContext() const
void CairoCommon::applyColor(cairo_t* cr, Color aColor, double fTransparency)
{
- if (cairo_surface_get_content(m_pSurface) == CAIRO_CONTENT_COLOR_ALPHA)
+ if (cairo_surface_get_content(cairo_get_target(cr)) == CAIRO_CONTENT_COLOR_ALPHA)
{
cairo_set_source_rgba(cr, aColor.GetRed() / 255.0, aColor.GetGreen() / 255.0,
aColor.GetBlue() / 255.0, 1.0 - fTransparency);
diff --git a/vcl/headless/SvpGraphicsBackend.cxx b/vcl/headless/SvpGraphicsBackend.cxx
index 10667e53e4dd..a47332173676 100644
--- a/vcl/headless/SvpGraphicsBackend.cxx
+++ b/vcl/headless/SvpGraphicsBackend.cxx
@@ -112,7 +112,7 @@ void SvpGraphicsBackend::drawPixel(tools::Long nX, tools::Long nY, Color aColor)
m_rCairoCommon.clipRegion(cr);
cairo_rectangle(cr, nX, nY, 1, 1);
- m_rCairoCommon.applyColor(cr, aColor, 0.0);
+ CairoCommon::applyColor(cr, aColor, 0.0);
cairo_fill(cr);
basegfx::B2DRange extents = getClippedFillDamage(cr);
@@ -141,7 +141,7 @@ void SvpGraphicsBackend::drawLine(tools::Long nX1, tools::Long nY1, tools::Long
AddPolygonToPath(cr, aPoly, basegfx::B2DHomMatrix(), !getAntiAlias(), false);
- m_rCairoCommon.applyColor(cr, m_rCairoCommon.m_aLineColor);
+ CairoCommon::applyColor(cr, m_rCairoCommon.m_aLineColor);
basegfx::B2DRange extents = getClippedStrokeDamage(cr);
extents.transform(basegfx::utils::createTranslateB2DHomMatrix(0.5, 0.5));
@@ -187,7 +187,7 @@ void SvpGraphicsBackend::implDrawRect(double nX, double nY, double nWidth, doubl
cairo_rectangle(cr, nX, nY, nWidth, nHeight);
- m_rCairoCommon.applyColor(cr, m_rCairoCommon.m_aFillColor, fTransparency);
+ CairoCommon::applyColor(cr, m_rCairoCommon.m_aFillColor, fTransparency);
// Get FillDamage (will be extended for LineDamage below)
extents = getClippedFillDamage(cr);
@@ -317,7 +317,7 @@ bool SvpGraphicsBackend::drawPolyPolygon(const basegfx::B2DHomMatrix& rObjectToD
{
add_polygon_path(cr, rPolyPolygon, rObjectToDevice, !getAntiAlias());
- m_rCairoCommon.applyColor(cr, m_rCairoCommon.m_aFillColor, fTransparency);
+ CairoCommon::applyColor(cr, m_rCairoCommon.m_aFillColor, fTransparency);
// Get FillDamage (will be extended for LineDamage below)
extents = getClippedFillDamage(cr);
@@ -333,7 +333,7 @@ bool SvpGraphicsBackend::drawPolyPolygon(const basegfx::B2DHomMatrix& rObjectToD
add_polygon_path(cr, rPolyPolygon, rObjectToDevice, !getAntiAlias());
- m_rCairoCommon.applyColor(cr, m_rCairoCommon.m_aLineColor, fTransparency);
+ CairoCommon::applyColor(cr, m_rCairoCommon.m_aLineColor, fTransparency);
// expand with possible StrokeDamage
basegfx::B2DRange stroke_extents = getClippedStrokeDamage(cr);
@@ -842,7 +842,7 @@ bool SvpGraphicsBackend::drawAlphaRect(tools::Long nX, tools::Long nY, tools::Lo
{
cairo_rectangle(cr, nX, nY, nWidth, nHeight);
- m_rCairoCommon.applyColor(cr, m_rCairoCommon.m_aFillColor, fTransparency);
+ CairoCommon::applyColor(cr, m_rCairoCommon.m_aFillColor, fTransparency);
// set FillDamage
extents = getClippedFillDamage(cr);
@@ -860,7 +860,7 @@ bool SvpGraphicsBackend::drawAlphaRect(tools::Long nX, tools::Long nY, tools::Lo
cairo_rectangle(cr, nX, nY, nWidth, nHeight);
- m_rCairoCommon.applyColor(cr, m_rCairoCommon.m_aLineColor, fTransparency);
+ CairoCommon::applyColor(cr, m_rCairoCommon.m_aLineColor, fTransparency);
// expand with possible StrokeDamage
basegfx::B2DRange stroke_extents = getClippedStrokeDamage(cr);