Related: tdf#148433 experiment with CAIRO_OPERATOR_EXCLUSION

export SAL_DISABLE_CAIRO_DIFFERENCE=1 to experiment with this

Change-Id: If0e5fee8c71ae3d2181b1e0b90bf9ecd6536ffc0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133671
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
diff --git a/vcl/headless/CairoCommon.cxx b/vcl/headless/CairoCommon.cxx
index 02c281f..7cf2951 100644
--- a/vcl/headless/CairoCommon.cxx
+++ b/vcl/headless/CairoCommon.cxx
@@ -966,6 +966,7 @@ bool bDisableDifference(nullptr != pDisableDifference);

#if defined CAIRO_VERSION && CAIRO_VERSION < CAIRO_VERSION_ENCODE(1, 10, 0)
#define CAIRO_OPERATOR_DIFFERENCE (static_cast<cairo_operator_t>(23))
#define CAIRO_OPERATOR_EXCLUSION (static_cast<cairo_operator_t>(24))
#endif

void CairoCommon::invert(const basegfx::B2DPolygon& rPoly, SalInvert nFlags, bool bAntiAlias)
@@ -980,13 +981,13 @@ void CairoCommon::invert(const basegfx::B2DPolygon& rPoly, SalInvert nFlags, boo

    cairo_set_source_rgb(cr, 1.0, 1.0, 1.0);

    if (cairo_version() >= CAIRO_VERSION_ENCODE(1, 10, 0) && !bDisableDifference)
    if (bDisableDifference)
    {
        cairo_set_operator(cr, CAIRO_OPERATOR_DIFFERENCE);
        cairo_set_operator(cr, CAIRO_OPERATOR_EXCLUSION);
    }
    else
    {
        SAL_WARN("vcl.gdi", "SvpSalGraphics::invert, archaic cairo");
        cairo_set_operator(cr, CAIRO_OPERATOR_DIFFERENCE);
    }

    if (nFlags & SalInvert::TrackFrame)