aboutsummaryrefslogtreecommitdiff
path: root/render.c
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2019-07-30 17:33:56 +0000
committerDaniel Eklöf <daniel@ekloef.se>2019-07-30 17:33:56 +0000
commitefdb69f2d8d3a2c3aaa09801bf227aaf9e56b64c (patch)
tree758a1a574f6d9a51b487f42891231e1d59d7c7d7 /render.c
parentinput: use keyboard enter serial only for selection serial (diff)
render: remove all traces of glyph-sequence
This was used to optimize the call(s) to cairo_show_glyphs(), which we aren't using anymore.
Diffstat (limited to 'render.c')
-rw-r--r--render.c61
1 files changed, 0 insertions, 61 deletions
diff --git a/render.c b/render.c
index b2d6c16e..b0d2e656 100644
--- a/render.c
+++ b/render.c
@@ -25,17 +25,6 @@ attrs_to_font(struct terminal *term, const struct attributes *attrs)
return &term->fonts[idx];
}
-struct glyph_sequence {
- cairo_glyph_t glyphs[100000];
- cairo_glyph_t *g;
- int count;
-
- struct attributes attrs;
- uint32_t foreground;
-};
-
-static struct glyph_sequence gseq;
-
static inline struct rgb
color_hex_to_rgb(uint32_t color)
{
@@ -55,27 +44,6 @@ color_dim(struct rgb *rgb)
}
static void
-gseq_flush(struct terminal *term, struct buffer *buf)
-{
- if (gseq.count == 0)
- return;
-
- assert(NULL);
- struct rgb fg = color_hex_to_rgb(gseq.foreground);
-
- if (gseq.attrs.dim)
- color_dim(&fg);
-
-#if 0
- cairo_set_scaled_font(buf->cairo, attrs_to_font(term, &gseq.attrs)->font);
- cairo_set_source_rgb(buf->cairo, fg.r, fg.g, fg.b);
- cairo_show_glyphs(buf->cairo, gseq.glyphs, gseq.count);
-#endif
- gseq.g = gseq.glyphs;
- gseq.count = 0;
-}
-
-static void
draw_underline(const struct terminal *term, struct buffer *buf, size_t buf_idx,
const struct font *font, struct rgb color, double x, double y)
{
@@ -251,27 +219,6 @@ render_cell(struct terminal *term, struct buffer *buf, size_t buf_idx,
if (cell->attrs.strikethrough)
draw_strikeout(term, buf, buf_idx, attrs_to_font(term, &cell->attrs), fg, x, y);
- /*
- * cairo_show_glyphs() apparently works *much* faster when
- * called once with a large array of glyphs, compared to
- * multiple calls with a single glyph.
- *
- * So, collect glyphs until cell attributes change, then we
- * 'flush' (render) the glyphs.
- */
-
- if (memcmp(&cell->attrs, &gseq.attrs, sizeof(cell->attrs)) != 0 ||
- gseq.count >= sizeof(gseq.glyphs) / sizeof(gseq.glyphs[0]) - 10 ||
- gseq.foreground != _fg)
- {
- if (gseq.count >= sizeof(gseq.glyphs) / sizeof(gseq.glyphs[0]) - 10)
- LOG_WARN("hit glyph limit");
-
- gseq_flush(term, buf);
- gseq.attrs = cell->attrs;
- gseq.foreground = _fg;
- }
-
struct font *font = attrs_to_font(term, &cell->attrs);
const struct glyph *glyph = font_glyph_for_utf8(font, cell->c);
if (glyph != NULL) {
@@ -423,9 +370,6 @@ grid_render(struct terminal *term)
struct buffer *buf = shm_get_buffer(term->wl.shm, term->width, term->height, 1 + term->render.workers.count);
cairo_set_operator(buf->cairo[0], CAIRO_OPERATOR_SOURCE);
- gseq.g = gseq.glyphs;
- gseq.count = 0;
-
bool all_clean = tll_length(term->grid->scroll_damage) == 0;
/* Erase old cursor (if we rendered a cursor last time) */
@@ -439,9 +383,6 @@ grid_render(struct terminal *term)
term->render.last_cursor.in_view.col,
term->render.last_cursor.in_view.row, false);
- /* Must flush now since scroll damage will shift the entire pixmap */
- gseq_flush(term, buf);
-
wl_surface_damage_buffer(
term->wl.surface,
term->render.last_cursor.in_view.col * term->cell_width,
@@ -613,8 +554,6 @@ grid_render(struct terminal *term)
term->cell_width, term->cell_height);
}
- gseq_flush(term, buf);
-
if (all_clean) {
buf->busy = false;
return;