vcl/headless/CairoCommon.cxx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
New commits: commit 90057e372cd07b41c8dbba4e7b7f107568a5f451 Author: Caolán McNamara <caol...@redhat.com> AuthorDate: Mon Apr 25 20:03:35 2022 +0100 Commit: Caolán McNamara <caol...@redhat.com> CommitDate: Tue Apr 26 11:37:08 2022 +0200 Related: tdf#148433 test if CAIRO_OPERATOR_DIFFERENCE is the problem export SAL_DISABLE_CAIRO_DIFFERENCE=1 to experiment with this Change-Id: I61ec30c818727cb6ab382b4cf9fe9bd29d8d179d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133419 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caol...@redhat.com> diff --git a/vcl/headless/CairoCommon.cxx b/vcl/headless/CairoCommon.cxx index cc5d9df10243..02c281fea3cb 100644 --- a/vcl/headless/CairoCommon.cxx +++ b/vcl/headless/CairoCommon.cxx @@ -957,6 +957,13 @@ cairo_pattern_t* create_stipple() } } // end anonymous ns +namespace +{ +// check for env var that deciding to disable CAIRO_OPERATOR_DIFFERENCE +const char* pDisableDifference(getenv("SAL_DISABLE_CAIRO_DIFFERENCE")); +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)) #endif @@ -973,7 +980,7 @@ 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)) + if (cairo_version() >= CAIRO_VERSION_ENCODE(1, 10, 0) && !bDisableDifference) { cairo_set_operator(cr, CAIRO_OPERATOR_DIFFERENCE); }