From bff1a337f3f24c6572a5892455dfddf46c62c1f8 Mon Sep 17 00:00:00 2001 From: Chris Lee <@klee93> Date: Sat, 9 Mar 2019 12:23:20 +0100 Subject: [PATCH] Revert "do not draw text with cairo directly on xlib pixmap (workaround for intel graphics bug, see emacs implementation) (issue #731, issue #732)" This reverts commit e1211a929fbf1c07815112ee109f3258f5547c1e. --- src/util/area.c | 4 ++-- src/util/common.c | 16 ---------------- src/util/common.h | 2 -- 3 files changed, 2 insertions(+), 20 deletions(-) diff --git a/src/util/area.c b/src/util/area.c index f19562e..c1cc949 100644 --- a/src/util/area.c +++ b/src/util/area.c @@ -478,14 +478,14 @@ void draw(Area *a) a->_clear(a); } - cairo_surface_t *cs = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, a->width, a->height); + cairo_surface_t *cs = cairo_xlib_surface_create(server.display, a->pix, server.visual, a->width, a->height); cairo_t *c = cairo_create(cs); draw_background(a, c); + if (a->_draw_foreground) a->_draw_foreground(a, c); - draw_cairo_surface_to_xpixmap(cs, a->pix); cairo_destroy(c); cairo_surface_destroy(cs); } diff --git a/src/util/common.c b/src/util/common.c index a22a9bc..7d868c1 100644 --- a/src/util/common.c +++ b/src/util/common.c @@ -1229,19 +1229,3 @@ void dump_image_data(const char *file_name, const char *name) imlib_free_image(); } - -void draw_cairo_surface_to_xpixmap(cairo_surface_t *cs, Pixmap pix) -{ - int w = cairo_image_surface_get_width(cs); - int h = cairo_image_surface_get_height(cs); - cairo_surface_t *cs_xlib = cairo_xlib_surface_create(server.display, pix, server.visual, w, h); - cairo_xlib_surface_set_size(cs_xlib, w, h); - cairo_t *c_xlib = cairo_create(cs_xlib); - - cairo_set_source_surface(c_xlib, cs, 0, 0); - cairo_paint(c_xlib); - cairo_surface_flush(cs_xlib); - - cairo_destroy(c_xlib); - cairo_surface_destroy(cs_xlib); -} diff --git a/src/util/common.h b/src/util/common.h index b41e020..8eb2729 100644 --- a/src/util/common.h +++ b/src/util/common.h @@ -154,8 +154,6 @@ void get_image_mean_color(const Imlib_Image image, Color *mean_color); void dump_image_data(const char *file_name, const char *name); -void draw_cairo_surface_to_xpixmap(cairo_surface_t *cs, Pixmap pix); - #define free_and_null(p) \ { \ free(p); \