summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWerner Almesberger <werner@almesberger.net>2016-09-30 00:21:18 (GMT)
committerWerner Almesberger <werner@almesberger.net>2016-09-30 00:21:18 (GMT)
commit2c9e549c9554e0cabb4d4ccdb2c3a2238d62bcf4 (patch)
tree108f5bbe637eae4da7c09d7c1f482b63994625ee
parentda054390b0b924be7e42da258524d86358491c55 (diff)
downloadeeshow-2c9e549c9554e0cabb4d4ccdb2c3a2238d62bcf4.zip
eeshow-2c9e549c9554e0cabb4d4ccdb2c3a2238d62bcf4.tar.gz
eeshow-2c9e549c9554e0cabb4d4ccdb2c3a2238d62bcf4.tar.bz2
gfx/record.h (record_replay): add "extra" argument for feature selection
-rw-r--r--gfx/cro.c20
-rw-r--r--gfx/record.c7
-rw-r--r--gfx/record.h2
3 files changed, 16 insertions, 13 deletions
diff --git a/gfx/cro.c b/gfx/cro.c
index fe2bd69..f1d44b6 100644
--- a/gfx/cro.c
+++ b/gfx/cro.c
@@ -730,13 +730,13 @@ static int cr_pdf_end(void *ctx)
set_color(cc, COLOR_WHITE);
cairo_paint(cc->cr);
- record_replay(cc->sheets + i);
+ record_replay(cc->sheets + i, 0);
record_destroy(cc->sheets + i);
cairo_show_page(cc->cr);
}
- record_replay(&cc->record);
+ record_replay(&cc->record, 0);
record_destroy(&cc->record);
cairo_show_page(cc->cr);
@@ -826,13 +826,13 @@ static int ps_end(struct cro_ctx *cc, int eps)
set_color(cc, COLOR_WHITE);
cairo_paint(cc->cr);
- record_replay(cc->sheets + i);
+ record_replay(cc->sheets + i, 0);
record_destroy(cc->sheets + i);
cairo_show_page(cc->cr);
}
- record_replay(&cc->record);
+ record_replay(&cc->record, 0);
record_destroy(&cc->record);
cairo_show_page(cc->cr);
@@ -908,13 +908,13 @@ static int cr_svg_end(void *ctx)
set_color(cc, COLOR_WHITE);
cairo_paint(cc->cr);
- record_replay(cc->sheets + i);
+ record_replay(cc->sheets + i, 0);
record_destroy(cc->sheets + i);
cairo_show_page(cc->cr);
}
- record_replay(&cc->record);
+ record_replay(&cc->record, 0);
record_destroy(&cc->record);
cairo_show_page(cc->cr);
@@ -990,7 +990,7 @@ uint32_t *cro_img_end(struct cro_ctx *cc, int *w, int *h, int *stride)
cairo_set_line_width(cc->cr, 2);
cairo_set_line_cap(cc->cr, CAIRO_LINE_CAP_ROUND);
- record_replay(&cc->record);
+ record_replay(&cc->record, 0);
record_destroy(&cc->record);
cairo_surface_flush(cc->s);
@@ -1062,7 +1062,7 @@ void cro_canvas_draw(struct cro_ctx *cc, cairo_t *cr, int xo, int yo,
cc->scale = scale;
cc->xo = xo;
cc->yo = yo;
- record_replay(&cc->record);
+ record_replay(&cc->record, 0);
}
@@ -1123,10 +1123,10 @@ uint32_t *cro_img(struct cro_ctx *cc, struct cro_ctx *cc_extra,
void *old = cc_extra->record.user;
cc_extra->record.user = cc->record.user; /* @@@ eww ! */
- record_replay(&cc_extra->record);
+ record_replay(&cc_extra->record, 0);
cc_extra->record.user = old;
}
- record_replay(&cc->record);
+ record_replay(&cc->record, 0);
if (res_cr)
*res_cr = cr;
diff --git a/gfx/record.c b/gfx/record.c
index 1cad6ff..ee989c2 100644
--- a/gfx/record.c
+++ b/gfx/record.c
@@ -295,7 +295,7 @@ void record_wipe(struct record *rec)
/* ----- Replay ------------------------------------------------------------ */
-void record_replay(const struct record *rec)
+void record_replay(const struct record *rec, enum gfx_extra extra)
{
const struct gfx_ops *ops = rec->ops;
void *ctx = rec->user;
@@ -303,7 +303,9 @@ void record_replay(const struct record *rec)
const struct record_obj *obj;
for (layer = rec->layers; layer; layer = layer->next)
- for (obj = layer->objs; obj; obj = obj->next)
+ for (obj = layer->objs; obj; obj = obj->next) {
+ if (obj->extra && !(obj->extra & extra))
+ continue;
switch (obj->type) {
case ro_line:
ops->line(ctx, obj->x, obj->y,
@@ -339,6 +341,7 @@ void record_replay(const struct record *rec)
default:
BUG("invalid object type %d", obj->type);
}
+ }
}
diff --git a/gfx/record.h b/gfx/record.h
index 1fefc68..cb36d97 100644
--- a/gfx/record.h
+++ b/gfx/record.h
@@ -56,7 +56,7 @@ void record_set_extra(void *ctx, enum gfx_extra extra);
void record_init(struct record *rec, const struct gfx_ops *ops, void *user);
void record_wipe(struct record *rec);
-void record_replay(const struct record *rec);
+void record_replay(const struct record *rec, enum gfx_extra extra);
void record_bbox(const struct record *rec, int *x, int *y, int *w, int *h);
void record_destroy(struct record *rec);