summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2015-12-15 12:35:05 +0000
committerAndras Timar <andras.timar@collabora.com>2016-06-13 22:23:21 +0200
commitcd624e04bd4a8432517fec696c037ffc36534e88 (patch)
tree9db07fbe8298aef3e6e8a7bc8a078e8d961aa6ad /vcl
parentf7a8e465aa73a842702ab09db9af9bd8f4a26450 (diff)
Related: tdf#99446 cairo text + xrender bodge
(cherry picked from commit 1d18db339242a535d956b7e944ad1488fd2b4fd8) Change-Id: I926881bcfa4911f3d7f4899711be44a2f6d82026 Reviewed-on: https://gerrit.libreoffice.org/26087 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com> (cherry picked from commit c55d703ea00de67793765f8da7ca17dfb54281fc)
Diffstat (limited to 'vcl')
-rw-r--r--vcl/unx/generic/gdi/x11cairotextrender.cxx18
1 files changed, 18 insertions, 0 deletions
diff --git a/vcl/unx/generic/gdi/x11cairotextrender.cxx b/vcl/unx/generic/gdi/x11cairotextrender.cxx
index 8734526193fd..17cb4622b6cf 100644
--- a/vcl/unx/generic/gdi/x11cairotextrender.cxx
+++ b/vcl/unx/generic/gdi/x11cairotextrender.cxx
@@ -42,6 +42,10 @@ struct _XRegion
BOX extents;
};
+#if CAIRO_VERSION < CAIRO_VERSION_ENCODE(1, 10, 0)
+# define CAIRO_OPERATOR_DIFFERENCE (static_cast<cairo_operator_t>(23))
+#endif
+
X11CairoTextRender::X11CairoTextRender(X11SalGraphics& rParent)
: mrParent(rParent)
{
@@ -78,6 +82,20 @@ cairo_t* X11CairoTextRender::getCairoContext()
cairo_t *cr = cairo_create(surface);
cairo_surface_destroy(surface);
+
+ //rhbz#1283420 bodge to draw and undraw something which has the side effect
+ //of making the mysterious xrender related problem go away
+ if (cairo_version() >= CAIRO_VERSION_ENCODE(1, 10, 0))
+ {
+ cairo_save(cr);
+ cairo_set_source_rgb(cr, 1.0, 1.0, 1.0);
+ cairo_set_operator(cr, CAIRO_OPERATOR_DIFFERENCE);
+ cairo_rectangle(cr, 0, 0, 1, 1);
+ cairo_fill_preserve(cr);
+ cairo_fill(cr);
+ cairo_restore(cr);
+ }
+
return cr;
}