vcl/headless/CairoCommon.cxx |    7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

New commits:
commit 00e43c14558fa4d0369820fa3d2cd7b987e61377
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Sun May 1 15:58:22 2022 +0100
Commit:     Caolán McNamara <caol...@redhat.com>
CommitDate: Mon May 2 18:37:33 2022 +0200

    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 <caol...@redhat.com>

diff --git a/vcl/headless/CairoCommon.cxx b/vcl/headless/CairoCommon.cxx
index 02c281fea3cb..7cf2951b9da6 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)

Reply via email to