summaryrefslogtreecommitdiff
path: root/gui/render.c
diff options
context:
space:
mode:
authorWerner Almesberger <werner@almesberger.net>2016-08-23 17:00:55 -0300
committerWerner Almesberger <werner@almesberger.net>2016-08-23 17:00:55 -0300
commitc9b85bd14a54881898d08261f7b9d98288a217b3 (patch)
tree423b685c283e2157c7b1c07d48f39056987c1282 /gui/render.c
parentee5aca2e6cc5a60ea8356e56ca315609c7ea7bc3 (diff)
downloadeeshow-c9b85bd14a54881898d08261f7b9d98288a217b3.tar.gz
eeshow-c9b85bd14a54881898d08261f7b9d98288a217b3.tar.bz2
eeshow-c9b85bd14a54881898d08261f7b9d98288a217b3.zip
gui/: do without the "unrender_all" atrocity
Benefits: - no horrible memory leak - we don't need to jump to the current page (causing zoom_to_extents) Drawbacks: - only supported in non-diff modes
Diffstat (limited to 'gui/render.c')
-rw-r--r--gui/render.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/gui/render.c b/gui/render.c
index 64ddb7c..2e2aa77 100644
--- a/gui/render.c
+++ b/gui/render.c
@@ -181,11 +181,15 @@ static gboolean on_draw_event(GtkWidget *widget, cairo_t *cr,
cro_canvas_prepare(cr);
if (!ctx->old_hist || ctx->diff_mode == diff_new) {
highlight_glabel(ctx, sheet, cr, x, y, f);
+ if (show_extra)
+ cro_canvas_draw(sheet->gfx_ctx_extra, cr, x, y, f);
cro_canvas_draw(sheet->gfx_ctx, cr, x, y, f);
} else if (ctx->diff_mode == diff_old) {
sheet = find_corresponding_sheet(ctx->old_hist->sheets,
ctx->new_hist->sheets, ctx->curr_sheet);
highlight_glabel(ctx, sheet, cr, x, y, f);
+ if (show_extra)
+ cro_canvas_draw(sheet->gfx_ctx_extra, cr, x, y, f);
cro_canvas_draw(sheet->gfx_ctx, cr, x, y, f);
} else if (use_delta) {
struct area *areas = changed_sheets(ctx, x, y, f);
@@ -236,11 +240,15 @@ void render_sheet(struct gui_sheet *sheet)
pl_render(sheet->hist->pl, sheet->hist->sch_ctx.sheets,
sheet->sch);
sch_render(sheet->sch);
- if (show_extra)
- sch_render_extra(sheet->sch);
cro_canvas_end(gfx_ctx,
&sheet->w, &sheet->h, &sheet->xmin, &sheet->ymin);
sheet->gfx_ctx = gfx_ctx;
+
+ gfx_init(&cro_canvas_ops, 1, argv);
+ sch_render_extra(sheet->sch);
+ cro_canvas_end(gfx_ctx, NULL, NULL, NULL, NULL);
+ sheet->gfx_ctx_extra = gfx_ctx;
+
sheet->rendered = 1;
// gfx_end();
}