1
0
mirror of git://projects.qi-hardware.com/eda-tools.git synced 2024-12-23 12:54:35 +02:00

eeshow/cro.c (cr_png_end): was almost identical to cro_img_end, unify

This commit is contained in:
Werner Almesberger 2016-08-08 16:49:37 -03:00
parent f8cc8ba598
commit 52ab16d62a

View File

@ -356,24 +356,9 @@ static cairo_status_t stream_to_stdout(void *closure,
static void cr_png_end(void *ctx)
{
struct cro_ctx *cc = ctx;
int w, h;
end_common(cc, &w, &h, NULL, NULL);
cc->s = cairo_image_surface_create(CAIRO_FORMAT_RGB24, w, h);
cc->cr = cairo_create(cc->s);
set_color(cc, COLOR_WHITE);
cairo_paint(cc->cr);
cairo_select_font_face(cc->cr, "Helvetica", CAIRO_FONT_SLANT_NORMAL,
CAIRO_FONT_WEIGHT_BOLD);
cairo_set_line_width(cc->cr, 2);
cairo_set_line_cap(cc->cr, CAIRO_LINE_CAP_ROUND);
record_replay(&cc->record);
record_destroy(&cc->record);
int w, h, stride;
cro_img_end(cc, &w, &h, &stride);
cro_img_write(cc, cc->output_name);
}