summaryrefslogtreecommitdiff
path: root/gui/index.c
diff options
context:
space:
mode:
authorWerner Almesberger <werner@almesberger.net>2016-08-24 14:07:45 -0300
committerWerner Almesberger <werner@almesberger.net>2016-08-24 14:19:21 -0300
commitbd9943d473ab96c5d37b0944ed33a1f6766d62e5 (patch)
tree59f27d8fa71f981928293bc8e55e7c0415d08db2 /gui/index.c
parentc58e2ecd39de8f433c787a8feb558509e664ac88 (diff)
downloadeeshow-bd9943d473ab96c5d37b0944ed33a1f6766d62e5.tar.gz
eeshow-bd9943d473ab96c5d37b0944ed33a1f6766d62e5.tar.bz2
eeshow-bd9943d473ab96c5d37b0944ed33a1f6766d62e5.zip
remove global gfx state (pass context as argument)
Diffstat (limited to 'gui/index.c')
-rw-r--r--gui/index.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/gui/index.c b/gui/index.c
index 2477cb7..8a6e4b5 100644
--- a/gui/index.c
+++ b/gui/index.c
@@ -266,13 +266,13 @@ static void index_render_sheet(const struct gui_ctx *ctx,
uint32_t *data;
int stride;
- if (!sheet->gfx_ctx_thumb) {
+ if (!sheet->gfx_thumb) {
char *argv[] = { "index", NULL };
- gfx_init(&cro_canvas_ops, 1, argv);
- sch_render(sheet->sch);
- cro_canvas_end(gfx_ctx, NULL, NULL, NULL, NULL);
- sheet->gfx_ctx_thumb = gfx_ctx;
+ sheet->gfx_thumb = gfx_init(&cro_canvas_ops, 1, argv);
+ sch_render(sheet->sch, sheet->gfx_thumb);
+ cro_canvas_end(gfx_user(sheet->gfx_thumb),
+ NULL, NULL, NULL, NULL);
}
if (ctx->old_hist && ctx->diff_mode == diff_delta) {
@@ -295,7 +295,7 @@ static void index_render_sheet(const struct gui_ctx *ctx,
sheet->thumb_surf = NULL;
}
- record_bbox((const struct record *) sheet->gfx_ctx_thumb,
+ record_bbox((const struct record *) gfx_user(sheet->gfx_thumb),
&xmin, &ymin, &w, &h);
if (!w || !h)
return;
@@ -306,13 +306,13 @@ static void index_render_sheet(const struct gui_ctx *ctx,
xo = -(xmin + w / 2) * f + thumb_w / 2;
yo = -(ymin + h / 2) * f + thumb_h / 2;
- data = cro_img(sheet->gfx_ctx_thumb, NULL, xo, yo, thumb_w, thumb_h, f,
- NULL, &stride);
+ data = cro_img(gfx_user(sheet->gfx_thumb), NULL,
+ xo, yo, thumb_w, thumb_h, f, NULL, &stride);
if (yellow)
paint_yellow(data, thumb_w, thumb_h, stride);
- sheet->thumb_surf = cro_img_surface(sheet->gfx_ctx_thumb);
+ sheet->thumb_surf = cro_img_surface(gfx_user(sheet->gfx_thumb));
sheet->thumb_w = thumb_w;
sheet->thumb_h = thumb_h;
sheet->thumb_yellow = yellow;