|
 |
135360 |
From d89abe0806947149eafbd9d7ce4b3095ec38b236 Mon Sep 17 00:00:00 2001
|
|
 |
135360 |
From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= <caolanm@redhat.com>
|
|
 |
135360 |
Date: Thu, 4 Aug 2016 17:23:30 +0100
|
|
 |
135360 |
Subject: [PATCH] Resolves: tdf#101213 drop use of CAIRO_OPERATOR_DIFFERENCE
|
|
 |
135360 |
|
|
 |
135360 |
for tdf#99446 and rhbz#1283420 there is a hackaround which ended up in 5.1.5,
|
|
 |
135360 |
which is not in 5.1.4, for corrupt glyphs under X. I can still reproduce the
|
|
 |
135360 |
problem if I drop the CAIRO_OPERATOR_DIFFERENCE usage here with master and
|
|
 |
135360 |
gtk2.
|
|
 |
135360 |
|
|
 |
135360 |
This alternative hackaround to force a read of the underlying surface works
|
|
 |
135360 |
just as well (help->license information is the reproducer) but reportedly
|
|
 |
135360 |
solves the performance regression.
|
|
 |
135360 |
|
|
 |
135360 |
(cherry picked from commit 705d7597480b2307d7e4929ce9386d80ce2a0f16)
|
|
 |
135360 |
|
|
 |
135360 |
Change-Id: Ie3c5b07409537a1734226b4ce034620351297e25
|
|
 |
135360 |
Reviewed-on: https://gerrit.libreoffice.org/27984
|
|
 |
135360 |
Tested-by: Jenkins <ci@libreoffice.org>
|
|
 |
135360 |
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
|
|
 |
135360 |
---
|
|
 |
135360 |
vcl/unx/generic/gdi/x11cairotextrender.cxx | 23 +++++++++--------------
|
|
 |
135360 |
1 file changed, 9 insertions(+), 14 deletions(-)
|
|
 |
135360 |
|
|
 |
135360 |
diff --git a/vcl/unx/generic/gdi/x11cairotextrender.cxx b/vcl/unx/generic/gdi/x11cairotextrender.cxx
|
|
 |
135360 |
index 17cb462..c2242b5 100644
|
|
 |
135360 |
--- a/vcl/unx/generic/gdi/x11cairotextrender.cxx
|
|
 |
135360 |
+++ b/vcl/unx/generic/gdi/x11cairotextrender.cxx
|
|
 |
135360 |
@@ -42,10 +42,6 @@ struct _XRegion
|
|
 |
135360 |
BOX extents;
|
|
 |
135360 |
};
|
|
 |
135360 |
|
|
 |
135360 |
-#if CAIRO_VERSION < CAIRO_VERSION_ENCODE(1, 10, 0)
|
|
 |
135360 |
-# define CAIRO_OPERATOR_DIFFERENCE (static_cast<cairo_operator_t>(23))
|
|
 |
135360 |
-#endif
|
|
 |
135360 |
-
|
|
 |
135360 |
X11CairoTextRender::X11CairoTextRender(X11SalGraphics& rParent)
|
|
 |
135360 |
: mrParent(rParent)
|
|
 |
135360 |
{
|
|
 |
135360 |
@@ -83,17 +79,16 @@ cairo_t* X11CairoTextRender::getCairoContext()
|
|
 |
135360 |
cairo_t *cr = cairo_create(surface);
|
|
 |
135360 |
cairo_surface_destroy(surface);
|
|
 |
135360 |
|
|
 |
135360 |
- //rhbz#1283420 bodge to draw and undraw something which has the side effect
|
|
 |
135360 |
- //of making the mysterious xrender related problem go away
|
|
 |
135360 |
- if (cairo_version() >= CAIRO_VERSION_ENCODE(1, 10, 0))
|
|
 |
135360 |
+ //rhbz#1283420 bodge to force a read from the underlying surface which has
|
|
 |
135360 |
+ //the side effect of making the mysterious xrender related problem go away
|
|
 |
135360 |
{
|
|
 |
135360 |
- cairo_save(cr);
|
|
 |
135360 |
- cairo_set_source_rgb(cr, 1.0, 1.0, 1.0);
|
|
 |
135360 |
- cairo_set_operator(cr, CAIRO_OPERATOR_DIFFERENCE);
|
|
 |
135360 |
- cairo_rectangle(cr, 0, 0, 1, 1);
|
|
 |
135360 |
- cairo_fill_preserve(cr);
|
|
 |
135360 |
- cairo_fill(cr);
|
|
 |
135360 |
- cairo_restore(cr);
|
|
 |
135360 |
+ cairo_surface_t *target = cairo_get_target(cr);
|
|
 |
135360 |
+ cairo_surface_t *throw_away = cairo_surface_create_similar(target, cairo_surface_get_content(target), 1, 1);
|
|
 |
135360 |
+ cairo_t *force_read_cr = cairo_create(throw_away);
|
|
 |
135360 |
+ cairo_set_source_surface(force_read_cr, target, 0, 0);
|
|
 |
135360 |
+ cairo_paint(force_read_cr);
|
|
 |
135360 |
+ cairo_destroy(force_read_cr);
|
|
 |
135360 |
+ cairo_surface_destroy(throw_away);
|
|
 |
135360 |
}
|
|
 |
135360 |
|
|
 |
135360 |
return cr;
|
|
 |
135360 |
--
|
|
 |
135360 |
2.9.3
|
|
 |
135360 |
|