summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWerner Almesberger <werner@almesberger.net>2016-08-23 17:54:26 -0300
committerWerner Almesberger <werner@almesberger.net>2016-08-23 17:54:26 -0300
commitc2de063fc1c4a0816984588db335e20cd4446fe1 (patch)
tree78d979f8774e19e5560b183aee1f27180b5e9293
parent1ec2c88d8368174f27358a0084cad5b2bd3b8607 (diff)
downloadeeshow-c2de063fc1c4a0816984588db335e20cd4446fe1.tar.gz
eeshow-c2de063fc1c4a0816984588db335e20cd4446fe1.tar.bz2
eeshow-c2de063fc1c4a0816984588db335e20cd4446fe1.zip
support showing pin types also in diff mode (hackishly, but works)
-rw-r--r--gfx/cro.c7
-rw-r--r--gfx/cro.h3
-rw-r--r--gfx/diff.c7
-rw-r--r--gfx/diff.h3
-rw-r--r--gui/render.c3
5 files changed, 16 insertions, 7 deletions
diff --git a/gfx/cro.c b/gfx/cro.c
index 4a52bcb..af5faf5 100644
--- a/gfx/cro.c
+++ b/gfx/cro.c
@@ -573,7 +573,8 @@ void cro_canvas_draw(struct cro_ctx *cc, cairo_t *cr, int xo, int yo,
/* ----- Image for external use (simplified API) --------------------------- */
-uint32_t *cro_img(struct cro_ctx *ctx, int xo, int yo, int w, int h,
+uint32_t *cro_img(struct cro_ctx *ctx, struct cro_ctx *ctx_extra,
+ int xo, int yo, int w, int h,
float scale, cairo_t **res_cr, int *res_stride)
{
int stride;
@@ -603,6 +604,10 @@ uint32_t *cro_img(struct cro_ctx *ctx, int xo, int yo, int w, int h,
ctx->scale = scale;
ctx->color_override = COLOR_NONE;
+ if (ctx_extra) {
+ ctx_extra->record.user = ctx->record.user; /* @@@ eww ! */
+ record_replay(&ctx_extra->record);
+ }
record_replay(&ctx->record);
if (res_cr)
diff --git a/gfx/cro.h b/gfx/cro.h
index 3e9d9fd..270231c 100644
--- a/gfx/cro.h
+++ b/gfx/cro.h
@@ -43,7 +43,8 @@ void cro_canvas_prepare(cairo_t *cr);
void cro_canvas_draw(struct cro_ctx *cc, cairo_t *cr,
int x, int y, float scale);
-uint32_t *cro_img(struct cro_ctx *ctx, int x0, int yo, int w, int h,
+uint32_t *cro_img(struct cro_ctx *ctx, struct cro_ctx *ctx_extra,
+ int x0, int yo, int w, int h,
float scale, cairo_t **res_cr, int *res_stride);
#endif /* !GFX_CRO_H */
diff --git a/gfx/diff.c b/gfx/diff.c
index 1eb8d35..cf7c80e 100644
--- a/gfx/diff.c
+++ b/gfx/diff.c
@@ -338,7 +338,8 @@ static void merge_coord(int pos_a, int pos_b, int dim_a, int dim_b,
void diff_to_canvas(cairo_t *cr, int cx, int cy, float scale,
- struct cro_ctx *old, struct cro_ctx *new,
+ struct cro_ctx *old, struct cro_ctx *old_extra,
+ struct cro_ctx *new, struct cro_ctx *new_extra,
const struct area *areas)
{
int old_xmin, old_ymin, old_w, old_h;
@@ -363,12 +364,12 @@ void diff_to_canvas(cairo_t *cr, int cx, int cy, float scale,
merge_coord(old_xmin, new_xmin, old_w, new_w, &xmin, &w);
merge_coord(old_ymin, new_ymin, old_h, new_h, &ymin, &h);
- img_old = cro_img(old,
+ img_old = cro_img(old, old_extra,
sw / 2.0 - (cx + xmin) * scale,
sh / 2.0 - (cy + ymin) * scale,
sw, sh,
scale, &old_cr, &stride);
- img_new = cro_img(new,
+ img_new = cro_img(new, new_extra,
sw / 2.0 - (cx + xmin) * scale,
sh / 2.0 - (cy + ymin) * scale,
sw, sh,
diff --git a/gfx/diff.h b/gfx/diff.h
index 26bc062..5bee90c 100644
--- a/gfx/diff.h
+++ b/gfx/diff.h
@@ -37,7 +37,8 @@ void add_area(struct area **areas, int xa, int ya, int xb, int yb,
void free_areas(struct area **areas);
void diff_to_canvas(cairo_t *cr, int cx, int cy, float scale,
- struct cro_ctx *old, struct cro_ctx *new,
+ struct cro_ctx *old, struct cro_ctx *old_extra,
+ struct cro_ctx *new, struct cro_ctx *new_extra,
const struct area *areas);
#endif /* !GFX_DIFF_H */
diff --git a/gui/render.c b/gui/render.c
index 5396f63..050f428 100644
--- a/gui/render.c
+++ b/gui/render.c
@@ -160,7 +160,8 @@ static void hack(const struct gui_ctx *ctx, cairo_t *cr,
areas = changed_sheets(ctx, xo, yo, f);
diff_to_canvas(cr, ctx->x, ctx->y, ctx->scale,
- old->gfx_ctx, new->gfx_ctx, areas);
+ old->gfx_ctx, show_extra ? old->gfx_ctx_extra : NULL,
+ new->gfx_ctx, show_extra ? new->gfx_ctx_extra : NULL, areas);
free_areas(&areas);
}